title: Disable atd (and other unnecessary startup processes) in Ubuntu?

text: I just spun up a new 12.04 server and have been having a bit of trouble getting the `atd` daemon to stop auto-launching. There's been a bit of changing around on the management of startup processes, and I've viewed dozens of web pages on upstart, sysv-rc-conf, and other start management systems (not to mention `chk-config`, which isn't available anymore on Ubuntu anyway)… I tried using sysv-rc-conf, but with the configuration as follows, I still have `atd` running on reboot:               # sysv-rc-conf --list atd      atd          0:off  1:off   2:off   3:off   4:off   5:off   6:off      Even though it's not upstart-compatible, I put "manual" into /etc/init/atd.override I've also tried a couple of variant invocations of update-rc.d, but despite the promising output, `atd` still launches on reboot:               # update-rc.d atd disable 0123456     update-rc.d: warning:  start runlevel arguments (none) do not match atd Default-Start values (2 3 4 5)     update-rc.d: warning:  stop runlevel arguments (none) do not match atd Default-Stop values (0 1 6)      Disabling system startup links for /etc/init.d/atd ...      Removing any system startup links for /etc/init.d/atd ...        /etc/rc0.d/K80atd        /etc/rc1.d/K80atd        /etc/rc2.d/K80atd        /etc/rc3.d/K80atd        /etc/rc4.d/K80atd        /etc/rc5.d/K80atd        /etc/rc6.d/K80atd      Adding system startup for /etc/init.d/atd ...        /etc/rc0.d/K80atd -> ../init.d/atd        /etc/rc1.d/K80atd -> ../init.d/atd        /etc/rc6.d/K80atd -> ../init.d/atd        /etc/rc2.d/K80atd -> ../init.d/atd        /etc/rc3.d/K80atd -> ../init.d/atd        /etc/rc4.d/K80atd -> ../init.d/atd        /etc/rc5.d/K80atd -> ../init.d/atd      I'd prefer not to just brute-force it and whack the scripts, but after all this, that's what I'm tempted to do. Are there any **recommended** (or just practical and _maintainable_ ) ways to deal with startup issues like this in Ubuntu 14.04?


title: Can not access to samba4.1 shares on gentoo box

text: I have one Windows 7 x64 PC, and a Gentoo Box, which act as a NAS. I tried to migrate from Samba3 to Samba4.1.6, and while Samba isup, I fail to connect; I have the following error that is popping (it worked on Samba 3).               [18:24:35.494397,3] ../source3/auth/auth.c:177(auth_check_ntlm_password)  check_ntlm_password:  Checking password for unmapped user [WindowsHost]\[WindowsUser]@[WindowsHost] with the new password interface     [18:24:35.494421,3] ../source3/auth/auth.c:180(auth_check_ntlm_password)  check_ntlm_password:  mapped user is: [GentooBox]\[GentooUser]@[WindowsHost]     [18:24:35.494645,3] ../source3/passdb/lookup_sid.c:1560(get_primary_group_sid)  Forcing Primary Group to 'Domain Users' for GentooUser     [18:24:35.494908,3] ../source3/auth/auth.c:226(auth_check_ntlm_password)  check_ntlm_password: sam authentication for user [WindowsUser] succeeded     [18:24:35.495065,2] ../source3/auth/pampass.c:577(smb_pam_account)  smb_pam_account: PAM: There was an authentication error for user GentooUser     [18:24:35.495088,2] ../source3/auth/pampass.c:89(smb_pam_error_handler)  smb_pam_error_handler: PAM: Account Check Failed : Authentication failure     [18:24:35.495168,0] ../source3/auth/pampass.c:797(smb_pam_accountcheck)  smb_pam_accountcheck: PAM: Account Validation Failed - Rejecting User GentooUser!     [18:24:35.495240,3] ../source3/auth/auth.c:268(auth_check_ntlm_password)  check_ntlm_password:  PAM Account for user [GentooUser] FAILED with error NT_STATUS_WRONG_PASSWORD     [18:24:35.495269,2] ../auth/gensec/spnego.c:743(gensec_spnego_server_negTokenTarg)  SPNEGO login failed: NT_STATUS_WRONG_PASSWORD     [18:24:35.495625,3] ../source3/smbd/server_exit.c:212(exit_server_common)  Server exit (NT_STATUS_CONNECTION_RESET)      I might not have understood it well, but is that still possible to configure Samba without AD, LDAP and simply accept, that Windows user is Linux user, only based on password information ? -- My conf is the following :               [global]             workgroup = WHITE_SPACE             server string = WHITE SPACE             map to guest = Bad User             obey pam restrictions = Yes             guest account = smbconsu             username map = /etc/samba/users.map             log file = /var/log/samba/samba.log             max log size = 1000             load printers = No             dns proxy = No             idmap config * : backend = tdb             hosts allow = 192.168.113., 127.0.0.1             hosts deny = ALL             log level=3     [animes]             comment = Animes Repository             path = /mnt/raid5/samba/animes             valid users = +smbshare             write list = GentooUser             guest ok = Yes             case sensitive = No      And the users.map :               GentooUser = "WindowsHost/WindowsUser" "WindowsUser"     smbconsu = guest pcguest smbguest


title: Keeping copies of the X log file on Debian

text: I recently tried to replace my Nvidia driver with the Nouveau driver for my Nvidia card, (see Switching from Nvidia proprietary driver to Nouveau driver for Nvidia card on Debian wheezy). Unfortunately, this attempt crashed and burned, so I aborted it. However, after I booted back into my customary configuration, and the smoke cleared, I discovered something I knew already, that Debian only keeps one copy of the X server logs around, namely `/var/log/Xorg.0.log`. Therefore the log of my ill- fated attempt to switch to Nouveau had been lost. So, my question is, how can I change Debian's configuration to keep old copies of the X log file?: I thought this kind of logic was handled by logrotate, but `/etc/logrotate.conf` and `/etc/logrotate.d/` don't have any specific logic about this, that I can see. Is it just a matter of adding something there? If so, I wonder why it isn't there already.


title: Save motion output videos in USB Drive

text: I'm using a USB drive in my Raspberry to store my website. Now I want also save my videos made with `motion`. I wasn't able to save in a folder different from `/tmp/motion` so googling I found I had to give permission to the folder where I wanted to use.               $ sudo chmod 777 /path/      I tried in the user directory `/home/pi` and it worked, then I tried the same on my USB drive.   * Filesystem /dev/sda1   * Size 3.6G   * Used 1.3M   * Avail 3.6G   * Use% 1%   * Mounted On /home/pi/usbdrv               $ sudo chmod 777 /home/pi/usbdrv      But didn't work. * * * **Some info:** So               $ sudo service motion start      motion start working, I can see images via browser, but as soon as the webcam try to save a file (e.g. a photo) the thread of the webcam crash. Trying stop motion in the same way               $ sudo service motion stop      I get               [....] Stopping motion detection demon: motionNo /usr/bin/motion found running; none killed.     . ok      else if there are more webcams service still run until when all of them try to save datas. * * * **Another test:** While if I try, always from terminal:               $ sudo motion      I get               [0] Processing thread 0 - config file /etc/motion/motion.conf     [0] Processing config file /etc/motion/thread1.conf     [0] Processing config file /etc/motion/thread2.conf     [0] Motion 3.2.12 Started     [0] Exit motion, cannot create process id file (pid file) /var/run/motion/motion.pid: No such file or directory     [0] Motion going to daemon mode     $      PS: I have two thread file, because I have two webcams * * * **My USB:**               /dev/sda1 on /home/pi/usbdrv type vfat (rw,nosuid,relatime,sync,uid=1000,gid=1000,fmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors,remount-ro)      * * * **More info:** http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=75136


title: Caps lock doesn't take effect on all letters

text: I have a laptop running Debian Jessie with only the Linux console (X server not installed). On this laptop caps lock doesn't take effect on the special Danish characters æøå (I just get æøå instead of ÆØÅ). To troubleshoot I've done some testing on my other computer which runs Debian Wheezy. On this computer, when I log into the Linux console, caps lock does indeed work on those characters. After discovering this, I've made sure to have identical settings for keyboard on both machines:               dpkg-reconfigure keyboard-configuration: Generic 105-key (Intl) PC, Danish     dpkg-reconfigure console-data: Do not touch keymap     dpkg-reconfigure console-setup: UTF8, # Latin1 and Latin5 - western Europe and Turkic languages      With the above settings the problem (which is absent on the Wheezy computer) persist on the Jessie computer. It should be noted that after running `dpkg- reconfigure keyboard-setup` on the Jessie machine I get this error:               update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults      Does this mean that the changes havn't taken effect? It should also be noted that I managed to reproduce the problem on the Wheezy machine by running `dpkg-reconfigure console-data` and choosing these options (instead of `Do not touch keymap`):               Select keyboard from list, qwerty, Danish, deadkeys      This gives me the output:               Looking for keymap to install:     dk-latin1      After that, caps lock didn't take effect on the Danish characters on the Wheezy machine either (luckily this changed back after reboot). This could indicate the Jessie machine runs with the above settings and that's what's causing the problem but when I run `dpkg-reconfigure console-data` and chose the same settings as above on my Jessie machine I get another problem (until reboot): my tmux prefix which I've mapped to `C-\` isn't recognized. This probably mean that the settings effectuated by running `dpkg-reconfigure console-data` aren't the default settings on my Jessie machine. What is causing the issue? Can it be fixed or is there a workaround to rebind æøå to ÆØÅ when caps lock is on?


title: My Atheros Ethernet network drive is not working with Xen Redhat client

text: First I am a beginner in use Linux operating system, and I am not familiar with the error messages I have TOSHIBA Satellite laptop Intel (R) Core (TM) i5-4200m CPU I have installed Red Hat Enterprise Linux server 5 operating system into a Xen VM. After I used these commands:               ifconfig eth0     /sbin/ifconfig      I get these outputs:               [root@localhost ~]# ifconfig eth0      eth0: error fetching interface information: Device not found          [root@localhost ~]# /sbin/ifconfig     lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:8 errors:0 dropped:0 overruns:0 frame:0               TX packets:8 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)          virbr0    Link encap:Ethernet  HWaddr 52:54:00:02:DA:F5                 inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0               UP BROADCAST RUNNING 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:0                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)      So my Atheros Ethernet network drive is not supported in RHEL-5. I have a second operating system Ubuntu 13.10 release which is supported my Atheros Ethernet network, After I used this command:lspci | grep –I net I get this output:               02:00.0 Network controller: Atheros Communications Inc. AR9565 Wireless Network Adapter (rev 01)          03:00.0 Ethernet controller: Qualcomm Atheros QCA8172 Fast Ethernet (rev 10)      So can I install Qualcomm Atheros QCA8172 Fast Ethernet (rev 10) manually in Red Hat Enterprise Linux server 5? If it is possible how I can do it? And how I can download my driver for Red Hat Enterprise Linux server 5?


title: Can capabilities be used in scripts without setcap'ing the interpreter binary?

text: Right now I'm using `cap_net_bind_service MY_USERNAME` in /etc/security/capability.conf.   Now I just need to set `cap_net_bind_service+i` on the interpreter of my favouite scripting language to be able to add `CAP_NET_BIND_SERVICE` to the _effective_ set via libcap[-ng]. This works fine, but I wonder if there's a way to achieve the same thing without setting any caps to the interpreter binary. While it's not a big problem (other user accounts don't have the cap so they can't use it even with the bit set on the interpreter binary) it's somewhat annoying since I have to re-set the flag everytime the interpreter is updated.


title: Apache not responding on port 80 after forwarding port?

text: I'm trying to set up a web server for my first time. I'm running Ubuntu 12.04.1 and i've installed LAMP. I have also set up a static IP for the server, 192.168.0.111 and reserved it in the router settings. So far so good. Now to the problem. I forwarded port 80 to the servers IP address, but the server is not responding to any connections. If i try to access the public IP through a webbrowser when the port is NOT forwarded, i get an error saying "Could not connect to host". If i do forward the port i get a timeout error. Correct me if i'm wrong, but that should mean the port is being forwarded to the server, but what happens after that i don't know. Am i right? And any suggestions about how to troubleshoot this? EDIT: I should also mention that Apache does in fact work and if i type in 127.0.0.1 in a browser, the page does indeed load. I just can't access it from the outside world.


title: Optimizing c++ compiliation for a specific machine

text: I am programming a code to simulate a membrane which will run on computation cluster (single node). I want to optimize the code for that machine. I have used the -optimize, -O3 and -march=core2. How can I tell if I can improve the march factor and is there any other thing I can do to improve this? thanks


title: nVidia fail after update

text: I have a 64-bit computer with Ubuntu 14.04, Gnome and nVidia. I had the official drivers from nVidia installed, all working perfectly, even Steam games. I did a reboot after a recent update and the next time I switched on the PC I found that after entering my password, the system hangs. I tried then CTRL+ALT+F1 and when killing lightdm and doing startx I found this error (look at the screenshot). ![error at startx](http://i.stack.imgur.com/6ITzn.jpg) I can't understand why this update failed. Can't find anything googling just by looking for the error message. I got also this log file when making "Xorg -configure". There is an error at the end.                [   315.646]       X.Org X Server 1.15.1      Release Date: 2014-04-13      [   315.647] X Protocol Version 11, Revision 0      [   315.647] Build Operating System: Linux 3.2.0-37-generic x86_64 Ubuntu      [   315.647] Current Operating System: Linux martin 3.11.0-20-generic #35-Ubuntu SMP Fri May 2 21:32:49 UTC 2014 x86_64      [   315.647] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.11.0-20-generic root=UUID=2718dd63-0056-4e1d-954b-d3c6d0b31b90 ro recovery nomodeset      [   315.647] Build Date: 16 April 2014  01:36:29PM      [   315.648] xorg-server 2:1.15.1-0ubuntu2 (For technical support please see http://www.ubuntu.com/support)       [   315.648] Current version of pixman: 0.30.2      [   315.648]   Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.      [   315.648] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.      [   315.649] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Aug 11 20:17:56 2014      [   315.649] (II) Loader magic: 0x7f3e96be2d60      [   315.649] (II) Module ABI versions:      [   315.649]   X.Org ANSI C Emulation: 0.4      [   315.649]   X.Org Video Driver: 15.0      [   315.649]   X.Org XInput driver : 20.0      [   315.649]   X.Org Server Extension : 8.0      [   315.650] (--) PCI:*(0:1:0:0) 10de:0f00:1458:3544 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000e000/128, BIOS @ 0x????????/524288      [   315.650] List of video drivers:      [   315.651]   ati      [   315.651]   sisusb      [   315.651]   savage      [   315.651]   r128      [   315.651]   intel      [   315.651]   mach64      [   315.652]   radeon      [   315.652]   modesetting      [   315.652]   cirrus      [   315.652]   s3      [   315.652]   trident      [   315.653]   openchrome      [   315.653]   tdfx      [   315.653]   qxl      [   315.653]   mga      [   315.653]   vboxvideo      [   315.653]   siliconmotion      [   315.654]   spiceqxl      [   315.654]   neomagic      [   315.654]   nvidia      [   315.654]   sis      [   315.654]   vesa      [   315.654]   fbdev      [   315.654] (II) LoadModule: "ati"      [   315.655] (II) Loading /usr/lib/xorg/modules/drivers/ati_drv.so      [   315.660] (II) Module ati: vendor="X.Org Foundation"      [   315.660]   compiled for 1.15.1, module version = 7.3.0      [   315.660]   Module class: X.Org Video Driver      [   315.660]   ABI class: X.Org Video Driver, version 15.0      [   315.660] (II) LoadModule: "sisusb"      [   315.660] (II) Loading /usr/lib/xorg/modules/drivers/sisusb_drv.so      [   315.668] (II) Module sisusb: vendor="X.Org Foundation"      [   315.668]   compiled for 1.15.0, module version = 0.9.6      [   315.668]   Module class: X.Org Video Driver      [   315.668]   ABI class: X.Org Video Driver, version 15.0      [   315.668] (II) LoadModule: "savage"      [   315.668] (II) Loading /usr/lib/xorg/modules/drivers/savage_drv.so      [   315.676] (II) Module savage: vendor="X.Org Foundation"      [   315.676]   compiled for 1.15.0, module version = 2.3.7      [   315.676]   Module class: X.Org Video Driver      [   315.676]   ABI class: X.Org Video Driver, version 15.0      [   315.676] (II) LoadModule: "r128"      [   315.676] (II) Loading /usr/lib/xorg/modules/drivers/r128_drv.so      [   315.689] (II) Module r128: vendor="X.Org Foundation"      [   315.689]   compiled for 1.15.0, module version = 6.9.2      [   315.689]   Module class: X.Org Video Driver      [   315.689]   ABI class: X.Org Video Driver, version 15.0      [   315.689] (II) LoadModule: "intel"      [   315.689] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so      [   315.734] (II) Module intel: vendor="X.Org Foundation"      [   315.734]   compiled for 1.15.0, module version = 2.99.910      [   315.734]   Module class: X.Org Video Driver      [   315.734]   ABI class: X.Org Video Driver, version 15.0      [   315.734] (II) LoadModule: "mach64"      [   315.734] (II) Loading /usr/lib/xorg/modules/drivers/mach64_drv.so      [   315.748] (II) Module mach64: vendor="X.Org Foundation"      [   315.748]   compiled for 1.15.0, module version = 6.9.4      [   315.748]   Module class: X.Org Video Driver      [   315.748]   ABI class: X.Org Video Driver, version 15.0      [   315.748] (II) LoadModule: "radeon"      [   315.748] (II) Loading /usr/lib/xorg/modules/drivers/radeon_drv.so      [   315.788] (II) Module radeon: vendor="X.Org Foundation"      [   315.788]   compiled for 1.15.1, module version = 7.3.0      [   315.788]   Module class: X.Org Video Driver      [   315.788]   ABI class: X.Org Video Driver, version 15.0      [   315.788] (II) LoadModule: "modesetting"      [   315.788] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so      [   315.800] (II) Module modesetting: vendor="X.Org Foundation"      [   315.800]   compiled for 1.15.0, module version = 0.8.1      [   315.800]   Module class: X.Org Video Driver      [   315.800]   ABI class: X.Org Video Driver, version 15.0      [   315.800] (II) LoadModule: "cirrus"      [   315.801] (II) Loading /usr/lib/xorg/modules/drivers/cirrus_drv.so      [   315.806] (II) Module cirrus: vendor="X.Org Foundation"      [   315.806]   compiled for 1.15.0, module version = 1.5.2      [   315.806]   Module class: X.Org Video Driver      [   315.806]   ABI class: X.Org Video Driver, version 15.0      [   315.806] (II) LoadModule: "s3"      [   315.806] (II) Loading /usr/lib/xorg/modules/drivers/s3_drv.so      [   315.808] (II) Module s3: vendor="X.Org Foundation"      [   315.808]   compiled for 1.15.0, module version = 0.6.5      [   315.808]   Module class: X.Org Video Driver      [   315.808]   ABI class: X.Org Video Driver, version 15.0      [   315.808] (II) LoadModule: "trident"      [   315.808] (II) Loading /usr/lib/xorg/modules/drivers/trident_drv.so      [   315.820] (II) Module trident: vendor="X.Org Foundation"      [   315.820]   compiled for 1.15.0, module version = 1.3.6      [   315.820]   Module class: X.Org Video Driver      [   315.820]   ABI class: X.Org Video Driver, version 15.0      [   315.821] (II) LoadModule: "openchrome"      [   315.821] (II) Loading /usr/lib/xorg/modules/drivers/openchrome_drv.so      [   315.832] (II) Module openchrome: vendor="http://openchrome.org/"      [   315.832]   compiled for 1.15.0, module version = 0.3.3      [   315.832]   Module class: X.Org Video Driver      [   315.832]   ABI class: X.Org Video Driver, version 15.0      [   315.832] (II) LoadModule: "tdfx"      [   315.833] (II) Loading /usr/lib/xorg/modules/drivers/tdfx_drv.so      [   315.842] (II) Module tdfx: vendor="X.Org Foundation"      [   315.842]   compiled for 1.15.0, module version = 1.4.5      [   315.842]   Module class: X.Org Video Driver      [   315.842]   ABI class: X.Org Video Driver, version 15.0      [   315.842] (II) LoadModule: "qxl"      [   315.842] (II) Loading /usr/lib/xorg/modules/drivers/qxl_drv.so      [   315.855] (II) Module qxl: vendor="X.Org Foundation"      [   315.855]   compiled for 1.15.0, module version = 0.1.1      [   315.855]   Module class: X.Org Video Driver      [   315.855]   ABI class: X.Org Video Driver, version 15.0      [   315.855] (II) LoadModule: "mga"      [   315.855] (II) Loading /usr/lib/xorg/modules/drivers/mga_drv.so      [   315.869] (II) Module mga: vendor="X.Org Foundation"      [   315.869]   compiled for 1.15.0, module version = 1.6.3      [   315.869]   Module class: X.Org Video Driver      [   315.869]   ABI class: X.Org Video Driver, version 15.0      [   315.869] (II) LoadModule: "vboxvideo"      [   315.869] (II) Loading /usr/lib/xorg/modules/drivers/vboxvideo_drv.so      [   315.881] (II) Module vboxvideo: vendor="Oracle Corporation"      [   315.881]   compiled for 1.15.0, module version = 1.0.1      [   315.881]   Module class: X.Org Video Driver      [   315.881]   ABI class: X.Org Video Driver, version 15.0      [   315.881] (**) Load address of symbol "VBOXVIDEO" is 0x7f3e8ca8f460      [   315.881] (II) LoadModule: "siliconmotion"      [   315.881] (II) Loading /usr/lib/xorg/modules/drivers/siliconmotion_drv.so      [   315.892] (II) Module siliconmotion: vendor="X.Org Foundation"      [   315.892]   compiled for 1.15.0, module version = 1.7.7      [   315.892]   Module class: X.Org Video Driver      [   315.892]   ABI class: X.Org Video Driver, version 15.0      [   315.893] (II) LoadModule: "spiceqxl"      [   315.893] (II) Loading /usr/lib/xorg/modules/drivers/spiceqxl_drv.so      [   316.008] (II) Module spiceqxl: vendor="X.Org Foundation"      [   316.008]   compiled for 1.15.0, module version = 0.1.1      [   316.008]   Module class: X.Org Video Driver      [   316.008]   ABI class: X.Org Video Driver, version 15.0      [   316.008] (II) LoadModule: "neomagic"      [   316.008] (II) Loading /usr/lib/xorg/modules/drivers/neomagic_drv.so      [   316.019] (II) Module neomagic: vendor="X.Org Foundation"      [   316.019]   compiled for 1.15.0, module version = 1.2.8      [   316.019]   Module class: X.Org Video Driver      [   316.019]   ABI class: X.Org Video Driver, version 15.0      [   316.019] (II) LoadModule: "nvidia"      [   316.019] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so      [   316.101] (II) Module nvidia: vendor="NVIDIA Corporation"      [   316.101]   compiled for 4.0.2, module version = 1.0.0      [   316.101]   Module class: X.Org Video Driver      [   316.118] (II) LoadModule: "sis"      [   316.118] (II) Loading /usr/lib/xorg/modules/drivers/sis_drv.so      [   316.138] (II) Module sis: vendor="X.Org Foundation"      [   316.138]   compiled for 1.15.0, module version = 0.10.7      [   316.138]   Module class: X.Org Video Driver      [   316.138]   ABI class: X.Org Video Driver, version 15.0      [   316.138] (II) LoadModule: "vesa"      [   316.138] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so      [   316.138] (II) Module vesa: vendor="X.Org Foundation"      [   316.138]   compiled for 1.15.0, module version = 2.3.3      [   316.138]   Module class: X.Org Video Driver      [   316.138]   ABI class: X.Org Video Driver, version 15.0      [   316.138] (II) LoadModule: "fbdev"      [   316.138] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so      [   316.140] (II) Module fbdev: vendor="X.Org Foundation"      [   316.140]   compiled for 1.15.0, module version = 0.4.4      [   316.140]   Module class: X.Org Video Driver      [   316.140]   ABI class: X.Org Video Driver, version 15.0      [   316.140] (WW) Falling back to old probe method for sisusb      [   316.140] (II) modesetting: Driver for Modesetting Kernel Drivers: kms      [   316.140] (WW) Falling back to old probe method for cirrus      [   316.140] (II) Loading sub module "cirrus_laguna"      [   316.140] (II) LoadModule: "cirrus_laguna"      [   316.140] (II) Loading /usr/lib/xorg/modules/drivers/cirrus_laguna.so      [   316.148] (II) Module cirrus_laguna: vendor="X.Org Foundation"      [   316.148]   compiled for 1.15.0, module version = 1.0.0      [   316.148]   ABI class: X.Org Video Driver, version 15.0      [   316.148] (II) Loading sub module "cirrus_alpine"      [   316.148] (II) LoadModule: "cirrus_alpine"      [   316.148] (II) Loading /usr/lib/xorg/modules/drivers/cirrus_alpine.so      [   316.149] (II) Module cirrus_alpine: vendor="X.Org Foundation"      [   316.149]   compiled for 1.15.0, module version = 1.0.0      [   316.149]   ABI class: X.Org Video Driver, version 15.0      [   316.149] (WW) Falling back to old probe method for s3      [   316.149] (WW) Falling back to old probe method for trident      [   316.149] (WW) Falling back to old probe method for siliconmotion      [   316.149] (WW) Falling back to old probe method for spiceqxl      [   316.149] (WW) Falling back to old probe method for neomagic      [   316.149] (II) NVIDIA dlloader X Driver  331.38  Wed Jan  8 18:51:00 PST 2014      [   316.149] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs      [   316.149] (WW) Falling back to old probe method for sis      [   316.149] (II) VESA: driver for VESA chipsets: vesa      [   316.149] (II) FBDEV: driver for framebuffer: fbdev      [   316.172] (++) Using config file: "/root/xorg.conf.new"      [   316.172] (==) Using system config directory "/usr/share/X11/xorg.conf.d"      [   316.172] (==) ServerLayout "X.org Configured"      [   316.172] (**) |-->Screen "Screen0" (0)      [   316.172] (**) |   |-->Monitor "Monitor0"      [   316.172] (**) |   |-->Device "Card0"      [   316.172] (**) |-->Input Device "Mouse0"      [   316.172] (**) |-->Input Device "Keyboard0"      [   316.172] (==) Automatically adding devices      [   316.172] (==) Automatically enabling devices      [   316.172] (==) Automatically adding GPU devices      [   316.172] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.      [   316.172]   Entry deleted from font path.      [   316.172] (**) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/Type1,         built-ins,         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/Type1,         built-ins      [   316.172] (**) ModulePath set to "/usr/lib/xorg/modules"      [   316.172] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.      [   316.172] (WW) Disabling Mouse0      [   316.172] (WW) Disabling Keyboard0      [   316.172] (EE) open /dev/dri/card0: No such file or directory      [   316.172] (WW) Falling back to old probe method for modesetting      [   316.172] (EE) open /dev/dri/card0: No such file or directory      [   316.172] (EE)       [   316.173] (EE) Backtrace:      [   316.173] (EE) 0: Xorg (xorg_backtrace+0x48) [0x7f3e9695ec78]      [   316.173] (EE) 1: Xorg (0x7f3e967b6000+0x1ac969) [0x7f3e96962969]      [   316.173] (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7f3e958b3000+0x10340) [0x7f3e958c3340]      [   316.174] (EE)       [   316.174] (EE) Segmentation fault at address 0x0      [   316.174] (EE)       Fatal server error:      [   316.174] (EE) Caught signal 11 (Segmentation fault). Server aborting      [   316.175] (EE)       [   316.175] (EE)       Please consult the The X.Org Foundation support           at http://wiki.x.org       for help.       [   316.176] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.      [   316.181] (EE)       I tried the steps at http://www.binarytides.com/install-nvidia-drivers- ubuntu-14-04/ The output for lspci was: ![Install verification](http://i.stack.imgur.com/ahitF.jpg) And the output for the commands: Glxinfo: Couldn't find the module Modprobe -R nvidia: It returned nvidia_304 Modinfo nvidia_304: Couldn't find nvidia_304


title: how to grep for c:\

text: I'm using cygwin's grep to find all instances of hardcoded paths on c drive. doing:               grep -r "c:\\" .      gives `grep: trailing backslash` Does anybody know how I can do this?


title: Is it a bug for join with -t\t?

text: I have a problem with the command `join`. "The default join field is the first, delimited by whitespace" (Cited from `join --help`). However, there is a field containing sentences in my tab-delimted files. Thus, I want to join the two files using `-t\t` (I also tried `-t "\t"` which reported errors under Cygwin, but not under CentOS). Unexpectedly, the command outputted the fields in two consecutive lines. I have processed the two files with `dos2unix` and `sort`. The example of output is as follows. The 1st and 3rd lines are from file1, and the 2nd and 4th lines are from file2. The 1st and 2nd lines should appear in the same line. However, if `-t\t` is used, they appear in two consecutive lines (as below); if no `-t`, they appear in the same line.               LM00089 0.6281  0       Q27888  L-lactate dehydrogenase     LM00089 gi|2497622|sp|Q27888|LDH_CAEEL  0.6281  0.422     LM00136 0.3219  0.376741        O62619  Pyruvate kinase     LM00136 gi|27923979|sp|O62619|KPYK_DROME        0.3219  0.111      I want to know whether it is a bug or I made some mistakes.


title: Get the chmod numerical value for a file

text: In FreeBSD and also in Linux, how can I get the numerical `chmod` value of a file? For example, `644` instead of `-rw-r--r--`? I need an automatic way for a Bash script.


title: recovering ext4 partition after dd'ing over start of HD

text: I accidentally used `dd` and wrote over the first 208MB of my external disk. What I wrote over is a partition on its own (Debian nestinstaller) so what I see now is not my old (now damaged) ext4 partition but another smaller partition. This limits the tools and advices I could follow. My plan was to recreate the partition table with `testdisk` and then fix everything with the backup superblocks as described here. I'd lose the first 208MB but that's ok compared to the other 300GB of data in there. Something like the following:               mke2fs -n /dev/sdb1   # doesn't work because sdb1 is the 208MB new partition     testdisk ...          # used this to create new correct partition table     mke2fs -n /dev/sdb1   # now works fine, get backup superblock positions     e2fsck -b backup_position -y /dev/sdb1 # returns many errors hence the -y      However, I have been unable to recover anything. I used `testdisk` to write a new partition table that matched what I had before. When I then run e2fsck I get many different errors. I get a filesystem after that but it's completely empty, no files. The lost+found directory is full of files (recovered ones I think) but I need to recover the directory tree, not just the files. I need the filename and previous directories to know what the files are (microscope images, mass spec data, etc.. Without the names and the directories where they were, they mean nothing). I got another HD exactly the same and made a copy of the whole HD with `dd` so I can experiment recovery without losing anything. Any advice?


title: linux mint 11 64 bit Citrix Client

text: Does anyone have Citrix Client 64 bit client working on Linux Mint 11? Been searching for a while and applying several suggestions without success. I've even attempted to get the 32 bit version of Citrix client to work, also without success.


title: How to chop the last "/script.sh" part from a string?

text: How could I modify this INPUT:               /home/USER/Desktop/script.sh      to this OUTPUT:               /home/USER/Desktop/      ...using `bash` or `perl`? Of course `script.sh` could be anything: (e.g. `scrasdfipt.sh`, etc) and the path before it could be anything.


title: How to rescan scsi bus devices?

text: How can I rescan a scsi bus for new devices under OpenSUSE? I think it contains something like this:               echo "- - -" > scan


title: If I run ./configure, then make again, then will it ruin things if I want to run make a 2nd time?

text: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-install/Quick- Instructions.html#Quick-Instructions is what I'm trying to install. Anyways, I ran ./configure and make but then I ran make without "make check install". So I'm thinking of running make with "make check install". Is the possibility of this ruined now?


title: no internet connection (wireless or wired) on ubuntu 12.04

text: I have win7 and ubuntu 12.04 on dell inspiron 1545 with Dell Wireless 1397 WLAN MiniCard. wireless works fine on windows, but I cannot connect with ubuntu. when I tried connect with a cable - it said the cable was unplugged. when I check wireless networks - it says there are no devices detected. I've tried a few things I found on forums, for example sudo apt-get install --reinstal bcmwl-kernel-source or sudo apt-get purge bcmwl-kernel-source but it says bcmwl-kernel-source was not found. anyone knows what can I do? Thank you in advance


title: Make terminal print name of parent process OSX

text: Slightly above n00b, but not by much. I made an alias to search for and display all of the processes associated with a specific user account that seem to auto initiate every time I log in, which are about 15 and through a process of elimination I found the parent process. Basically I want the alias to display, just the parent process and not the whole list, I know I will have to pipe but beyond that I'm not sure. ### Example:               ps -u *someuser* | grep <parent process name/PID>      ### EDIT #1 This is not exactly related to the process tree in which I'm referring, but I opened a man page so I could paste the associated processes:               966 man pidof ---      969 sh -c (cd '/usr/local/share/man' && (echo ".ll 12.8i"; echo ".nr LL 12.8i"; /usr/bin/gunzip -c '/usr/local/share/man/ ---      970 sh -c (cd '/usr/local/share/man' && (echo ".ll 12.8i"; echo ".nr LL 12.8i"; /usr/bin/gunzip -c '/usr/local/share/man/ --- 975 sh -c (cd '/usr/local/share/man' && (echo ".ll 12.8i"; echo ".nr LL 12.8i"; /usr/bin/gunzip -c '/usr/local/share/man/ ---      977 /usr/bin/less -is` how `kill 966` kills all the rest


title: How can I "cache" a variable in Bash?

text: I have a bash script which is run every 10m by `cron`. The script performs an expensive calculation for some value (say variable x=value). I need to "cache" this value for 2-3 hours. What are possible solutions to this problem? I tried memcached but it doesn't seem to play well with bash.


title: Recovering from 'grub rescue>' crash

text: _Originally posted to AskUbuntu.com ..._ > AskUbuntu has adopted a policy of closing questions about EOL (End Of Life) > versions. There's a vocal contingent to remove them as well. To prevent > possible loss of this popular question (342335 views to date), am placing a > revised version here. --- docsalvager _The "classic" system..._   * Puppy Linux 5.2.8 (Lucid) based on Ubuntu 10.04 (Lucid Lynx)   * GRUB 2 boot loader GRUB 2 puts a number of `*.mod` files (kernel modules) in `/boot/grub`. Deleting these files (thinking they were misplaced sound files) resulted in failure on reboot and the prompt `grub rescue>`. _How to recover in this situation?_


title: If Else in Gawk

text: I have an example:               echo $(seq 9) | awk '{for(i=1;i<=NF;i++) if(i!=5&&i!=6) {printf "%s ",i}else{printf "%s ",""} print ""}'     1 2 3 4   7 8 9       Is it possible to use the shorthand of this command?               echo $(seq 9)| awk '{for(i=1;i<=NF;i++) (i!=5&&i!=6) ? {printf "%s ",i} : {printf "%s ",""} print ""}'      Thank you for the explanation.


title: How do I find which files are missing from a list?

text: I have a list of files that I want to check if they exist on my filesystem. I thought of doing this using `find` as in:               for f in $(cat file_list); do     find . -name $f > /dev/null || print $f     done      (using `zsh`) but that doesn't work as `find` seems to exit `0` whether or not it finds the file. I guess I could pass it through some other test which tests to see if `find` produces any output (crude but effective would be to replace the `> /dev/null` with `|grep ''`) but this feels like using a troll to catch a goat (other nationalities might say something about sledgehammers and walnuts). Is there a way to coerce `find` in to giving me a useful exit value? Or at least to get a list of those files that _weren't_ found? (I can imagine the latter being perhaps easier by some cunning choice of logical connectives, but I seem to always get tied up in knots when I try to figure it out.) **Background/Motivation:** I have a "master" backup and I want to check that some files on my local machine exist on my master backup before deleting them (to create a bit of space). So I made a list of the files, `ssh`ed them to the master machine, and was then at a loss for figuring out the best way to find the missing files.


title: How can I reliably get the operating system's name?

text: Say I am logged into a remote system, how can I know what it's running? On most modern Linuxes (Linuces?), you have the `lsb_release` command:               $ lsb_release -ic         Distributor ID: LinuxMint     Codename:       debian      Which as far as I can tell just gives the same info as `/etc/lsb-release`. What if that file is not present? I seem to recall that the `lsb_release` command is relatively new so what if I have to get the OS of an older system? In any case, `lsb` stands for `Linux Standard Base` so I am assuming it won't work on non-Linux Unices. As far as I know, there is no way of getting this information from `uname` so how can I get this on systems that do not use `lsb_release`?


title: Using node.js and shelljs as interactive shell

text: Following the answer given at unix.stackexchange.com/questions/58011/is-there- a-javascript-shell That requires me to always execute               var shell=require("/usr/local/lib/node_modules/shelljs");      It seems like node forces execute a script and read stdin to be mutally exclusive so i tried               cat ~/.jshrc /dev/stdin | node       Which works expect that node output is not printed immediately. Can the pipe echo earlier or is there another way to do it like adding a special file that is always executed?


title: How to discard mails sent from a specific local user to external addresses?

text: How can I configure Postfix to silently drop / discard mails that were sent from one of my users to an external address? I'm already able to discard all mails to external addresses using the following transport_maps               example.com      :     *          discard:      However I want to apply this rule to one user within my Postfix server only. Also mails addressed to external and local addresses should get deliverd to the local users only. ### Why do I need this? The company I work at thinks that an intern should not sent mails directly to the customer. So the intern would send a mail using the customers address for `to` and adding his supervisor into the `cc`. Then Postfix shoud only deliver the mail to the supervisor so that he can check and sent the mail to the customer without searching for the customers address.


title: Is there a program which gives the X screen co-ords of the Text-cursor (insertion point)?

text: `xdotools` gives the ability to insert text at the current text insertion point, but it doesn't seem(?) to have an option which gets the actual screen x,y co-ordinates... Is there any such program? ... the reason is: I want the mouse to jump to the current text insertion point.. ie to the text-cursor..


title: Faster way to delete large number of files

text: I have a directory where lots of cached files are getting generated very quickly. Since these are very small files, it is consuming all my inodes very quickly. Currently I am running the following command to find all the files older than 12 hours and delete them.               $ find ./cache -mtime +0.5 -exec rm {} \;      But the rate at which this command is deleting is slower than the rate at which files are being generated. Can someone tell me some alternative way to remove large number of files quickly.


title: Making md5sum understand file names with spaces

text: I need to use `md5sum` in Python by using pipe to calculate checksum for a bunch of .mp3 files... is there a command which ignore whitespaces in filenames on the command line of `md5sum` program? For example:               import os     def index(directory):         stack = [directory]         files = []         while stack:             directory = stack.pop()             for file in os.listdir(directory):                 fullname = os.path.join(directory, file)                 if fullname.endswith('mp3'):                     files.append(fullname)                 if os.path.isdir(fullname) and not os.path.islink(fullname):                     stack.append(fullname)         return files          def check(directory):         files = index(directory)         hvalues = []         for x in files:             cmd = 'md5sum' + ' ' + x             fp = os.popen(cmd)             res = fp.readline()             hvalues.append(res)             stat = fp.close() # What to do with stat?         return hvalues      Command `cmd = 'md5sum' + ' ' + x` won't work as it should on files that include whitespaces or special characters, because 'md5sum' tool lacks the ability of properly handling (hashing) files with whitespaces in filenames.


title: Vim config for specific filetypes

text: I'm struggling with using .vimrc to apply specific configurations based on the filetype. Following the `autocmd FileType` suggestion here, I have attempted to apply a configuration based on filetype. Here is what I have in my .vimrc:               autocmd FileType tex call Tex_config()       function Tex_config()         let g:LatexBox_viewer = 'skim'         let g:LatexBox_latexmk_options = '-pvc'         let g:tex_flavor = "latex"         setlocal spell spelllang=en_ca       endfunction      I can call the function Tex_config() with :debug Tex_config: Vim happily spets through the function. So, everything seems like it should work. But, when I issue `:set filetype=tex` something strange happens: spell checking turns off. And when I issue `:set filetype=foo` spell checking turns on. Just the reverse of what I expect to happen from this configuration snippet! Any assistance would be greatly appreciated. Here is the full vimrc (function at 44-50). Thanks. Update: Another part of the puzzle: when I load a TeX file, preferences are read without a problem. The problem arises on `:set filetype=tex`.


title: iptables --set-mark - Route diferent ports through different interfaces

text:
Short story,   3 interfaces, eth0 (LAN), eth1(ADSL), eth2(4G).   eth0 -> eth1: Works   (ports 80, 443, 4070) eth0 -> eth2: Doesn't happen         # This is a graphical representation of the idea:   Port 80 & 443 via eth2   ant the rest via eth1   ![enter image description here](http://i.stack.imgur.com/iRn44.png) ## Netscheme:               eth0: -ip 10.0.0.1 -net 10.0.0.0/8 -gw 10.0.0.1 (the servers own intf)      eth1: -ip 192.168.1.74 -net 192.168.1.0/24 -gw 192.168.1.254      eth2: -ip 192.168.1.91 -net 192.168.0.0/24 -gw 192.168.0.1       * * *             * * * **This new script reroutes 22 and 4070 to the proper table, i think..   however after getting to that table it doesn't get rerouted to eth2.** * * *          # This script works, except for 22 and 4070! (Port 80 is un-commented and it works but via eth1 which is wrong.)                 modprobe iptable_nat     modprobe ip_conntrack          echo "1" > /proc/sys/net/ipv4/ip_forward          iptables -P INPUT ACCEPT     iptables -F INPUT     iptables -P OUTPUT ACCEPT     iptables -F OUTPUT     iptables -P FORWARD DROP     iptables -F FORWARD     iptables -F PREROUTING     iptables -t nat -F     iptables -t mangle -F     iptables -F     # This next line, restores any issues trying to connect to something     # if you get weird ACK packets when trying to connect (at least i did)!     iptables -t mangle -A PREROUTING -p tcp -j CONNMARK --restore-mark     ip route flush table main          iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 22 -j MARK --set-mark 1     ###  iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 80 -j MARK --set-mark 1     iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 4070 -j MARK --set-mark 1          ## Setup routes     # LAN     route add -net 10.0.0.0 netmask 255.0.0.0 dev eth0     # ADSL     route add -net 192.168.1.0 netmask 255.255.255.0 dev eth1     # 4G (Only accessible if marking packages with \x01     route add -net 192.168.0.0 netmask 255.255.255.0 dev eth2     # Default via ADSL     ## -- Does the same as ip route below? route add default gw 192.168.1.254               echo "201 eth2.out" >> /etc/iproute2/rt_tables          ip rule add fwmark 1 table eth2.out     ip route add default via 192.168.0.1 dev eth2 table eth2.out     ip route add default via 192.168.1.254 dev eth1                    ## Setup forwards     # From 4G to LAN     iptables -A FORWARD -i eth2 -o eth0 -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT     # From ADSL to LAN     iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT     # From LAN to ADSL (Default route out)     # - Note: If marked packages is sent to ADSL they will be mangled and rerouted to 4G     iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT     iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE     iptables -t nat -A POSTROUTING -o eth2 -j MASQUERADE                              # Old script: * * *                 Ignore everything below unless you're interested in retracing my steps!!      * * *       I've created a router.sh script to setup my environment in case i do something bad. I've got 3 ports which i want to send to a 4G connection and the rest via a landline ADSL connection. To do this, I've instructed iptables to mangle packages on the default route and send them via my 4G interface if the --dport == 443 | 80 | 4070 However this doesn't work, i'm still getting routed through my landline no matter what. This is what my script looks like:               #!/bin/bash          ## routing tables     # wireless = 4G via eth2     # adsl = adsl via eth1          modprobe iptable_nat     modprobe ip_conntrack          echo "1" > /proc/sys/net/ipv4/ip_forward          iptables -P INPUT ACCEPT     iptables -F INPUT     iptables -P OUTPUT ACCEPT     iptables -F OUTPUT     iptables -P FORWARD DROP     iptables -F FORWARD     iptables -t nat -F     ip route flush table main     ip route flush table wireless     ip route flush table adsl          ## Setup routing tables     # ADSL     ip route add table adsl to 192.168.1.0/24 dev eth1     # 4G     ip route add table wireless to 192.168.0.0 dev eth2     ip rule add fwmark 0x1 table wireless          ## Setup routes     # LAN     route add -net 10.0.0.0 netmask 255.0.0.0 dev eth0     # ADSL     route add -net 192.168.1.0 netmask 255.255.255.0 dev eth1     # 4G (Only accessible if marking packages with \x01     route add -net 192.168.0.0 netmask 255.255.255.0 dev eth2     # Default via ADSL     route add default gw 192.168.1.254               ## Forward ports into the LAN     iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to 10.0.0.3:80               ## Lets mark all packets we want for 4G forward     # HTTPS     iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 443 -j MARK --set-mark 1     # HTTP     iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 80 -j MARK --set-mark 1     # Spotify     iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 4070 -j MARK --set-mark 1          ## Setup forwards     # From 4G to LAN     iptables -A FORWARD -i eth2 -o eth0 -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT     # From ADSL to LAN     iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT     # From LAN to ADSL (Default route out)     # - Note: If marked packages is sent to ADSL they will be mangled and rerouted to 4G     iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT     iptables -A FORWARD -j LOG     #iptables --table nat --append POSTROUTING --out-interface eth2 --jump SNAT --to-source "192.168.1.74"     iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE      I've also tried to add these 3 to the bottomg of the script:               iptables -t nat -A POSTROUTING -o eth2 -p tcp --dport 80 -j SNAT --to "192.168.0.91"     iptables -t nat -A POSTROUTING -o eth2 -p tcp --dport 443 -j SNAT --to "192.168.0.91"     iptables -t nat -A POSTROUTING -o eth2 -p tcp --dport 4070 -j SNAT --to "192.168.0.91"      Also tried without success:               iptables -A PREROUTING -t mangle -i eth0 -p tcp --dport 80 -j MARK --set-mark 1      Last but not least, tried:               ## Lets mark all packets we want for 4G forward     # HTTPS     iptables -A POSTROUTING -t mangle -o eth1 -p tcp --dport 443 -j MARK --set-mark 1     # HTTP     iptables -A POSTROUTING -t mangle -o eth1 -p tcp --dport 80 -j MARK --set-mark 1     # Spotify     iptables -A POSTROUTING -t mangle -o eth1 -p tcp --dport 4070 -j MARK --set-mark 1      The routing works, i can browse the web, listen to music and what not but i'm doing it through the wrong interface. I've Googled around for a long while now and found bits and peaces to understand what i'm doing and why i'm doing it. I could do traffic shaping via tc but if it's possible via marking packages in iptables it would help me a long way. My guess is that i'm doing the order wrong on the different rules, mainly the **MASQUERADE** part? or if that should even be there? Also, if someone could explain how to **DNAT** port say, tcp:80 from an external interface (either one or BOTH protocols) to a internal 10.0.0.0 address space, that would be lovely! I wouldn't post this here normally but i'm in a real hurry to get this up and running or i'm in a big pickle!       Outputs:               root@Netbridge:~# route -n Kernel IP routing table Destination              Gateway         Genmask         Flags Metric Ref    Use Iface
     0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth1
     10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth0
     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2
     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1                       root@Netbridge:~# ifconfig          eth0      Link encap:Ethernet  HWaddr 00:0c:29:7e:9e:4e                 inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0          eth1      Link encap:Ethernet  HWaddr 00:0c:29:7e:9e:58                 inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0          eth2      Link encap:Ethernet  HWaddr 00:0c:29:7e:9e:62                 inet addr:192.168.0.91  Bcast:192.168.0.255  Mask:255.255.255.0      Followed these instructions:   output-traffic-on-different-interfaces-based-on-destination-por   iptables-forward-specific-port-to-specific-nic   Among a few other related threads.


title: dhclient-exit-hooks was not executed with NetworkManager

text: I configured `/etc/dhclient-exit-hooks`, in the old days, when I do `dhclient eth0` like stuff, that script got executed automatically. Now I switched to NM, the script were never called! Althrough `ps` clearly shows it was running. > /usr/sbin/dhclient -d -4 -sf /usr/lib/networkmanager/nm-dhcp-client.action > -pf /var/run/dhclient-wlan0.pid -lf > /var/lib/dhclient/dhclient-85e57415-affe-4375-921d-f2eb45bc1002-wlan0.lease > -cf /var/run/nm-dhclient-wlan0.conf wlan0 Any thoughts?


title: Arch does not mount btrfs array on boot

text: As data partition I have a multi-disk btrfs filesystem. My root disk is ext4 Fstab:               UUID=290624c6-6b95-41fd-94a1-923ebca64b83   /           ext4        rw,relatime,data=ordered    0 1     /dev/sdc    /mnt/btrfs  btrfs   rw,relatime,compress-force=zlib,autodefrag  0   0      When I boot the machine, it will wait for 1m30s with the message               A start job is running for dev-sdc.device      And after that               Dependency failed for /mnt/btrfs      When I do log in I can do               mount /mnt/btrfs     systemctl default      And it will work. The system will boot normally. I first though I might need to do something with a mkinitcpio hook, but this page says: > Arch's default mkinitcpio package contains a standard btrfs hook, which is > enough to get multi-device (RAID) support. Beside that, the kernel is > capable of booting a single-device btrfs root without any hook So everything should work out of the box. Why doesn't it work, and what should I do to fix it?


title: Using 'find' to email me those files modified recently

text: I'm using 'find' at the end of a script to email me any .log files in the current directory that have been modified in the last 6 hours. I need this because the file names change so I can't be any more specific than requesting the recently changed ones. eg,               for file in `find ./*.log -type f -mmin -360` ; do mail -s "MY LOG FILE - $file" me@mydomain.com  < $file ; done      ...and it works sometimes, but more often it doesn't work even when I know there is a file in the directory that fits the criteria (having just been modified). Any ideas why it's not working consistently for me?


title: How to tie a keyword (to be pasted) to a key in Linux

text: I have to configure the keyboard to paste text 'abc123' into any program after pressing key combination Alt or Ctrl + a number. It has to work for every program, and I prefer to do it through the command line to have a list that can be run when new combinations are available. So, what is the command for: make Alt + 1 => paste 'abc123' on the cursor.


title: How to make sd card as default boot in uboot?

text: U-Boot 2013.07 (Nov 21 2013 - 18:12:40)          Memory: ECC disabled     DRAM:  1 GiB     MMC:   zynq_sdhci: 0     SF: Detected N25Q128A with page size 64 KiB, total 16 MiB     In:    serial     Out:   serial     Err:   serial     Net:   Gem.e000b000     Hit any key to stop autoboot:  0     SF: Detected N25Q128A with page size 64 KiB, total 16 MiB     SF: 11010048 bytes @ 0x520000 Read: OK     Wrong Image Format for bootm command     ERROR: can't get kernel image!     U-Boot-PetaLinux>      then I would type `run sdboot`, and it boots from sd card, where I have put an image for sd booting. It shows that by default UBoot is booting from flash. What changes do I need to make in uboot and where so that the default boot device is SD card and not the flash? Is there any environmental variable I have to set for this?


title: Is it possible to make thunar sort by ASCII order?

text: I'm currently using Debian 6 with Xfce desktop, and I can't find any setting to make Thunar sort files properly; i.e., by ASCII order. I haven't been able to turn up anything via search engines either. Is there a setting in some config file somewhere that will do this?


title: /dev mounted as readonly

text: i am trying to write a device driver for my gps module. somehow the linux os when loaded to my arm board have /dev directory read only. when i try to do a "vi /dev/gps" it says file is read only. due to this reason my application program can't open the /dev/gps. Anybody know what is the problem here. May be i am too vague.


title: Where are the program calls of the boot process stored

text: I just wrote a little program which logs all calls of bash during the boot process. This is a part of the output produced:               (root) '/bin/bash-' '-c' 'gzip -d -c /usr/share/kbd/keymaps/i386/qwerty/us.map.gz'     (root) '/bin/bash-' '-c' 'gzip -d -c /usr/share/kbd/keymaps/i386/qwerty/../include/euro1.map.gz'     (root) '/bin/bash-' '/etc/rc.multi'     (root) '/bin/bash-' '/etc/rc.d/syslog-ng' 'start'     (root) '/bin/bash-' '/etc/rc.d/dbus' 'start'     (root) '/bin/bash-' '/etc/rc.d/network' 'start'     (root) '/bin/bash-' '/usr/lib/dhcpcd/dhcpcd-run-hooks'     (root) '/bin/bash-' '/usr/lib/dhcpcd/dhcpcd-run-hooks'     (root) '/bin/bash-' '/usr/lib/dhcpcd/dhcpcd-run-hooks'     (root) '/bin/bash-' '/etc/rc.d/netfs' 'start'      First column is the user, 2nd the program called (I only log bash here), 3rd column are the arguments. Now assume I want to replace one of these calls: Where can I find them? I assume there must be some program/script/data file which has all these calls in it?!?


title: How to store packages on a separate drive to save disk space in Linux Mint?

text: I'm running Linux Mint 9 from an 8G USB stick and it's nearly full with installed packages. How can I move some (but not all) packages to my internal drive?


title: Bash aliases/functions and command line options

text: I want to set an alias to start nedit together with command line option -noautosave (due to text files up to 500MB). What seemed to be easy:               alias nn="nedit -noautosave $1 &"      just raises some error _"Permission denied"_ of a different file and another error about _unexpected EOF while looking for matching "'"_ and _"unexpected end of file"_. One solution I found after a Google Search would be to check the quotes, but I cant see any possible errors with them. I also tried declaring a function:               function nn () { nedit -noautosave $1 &}      which also failed with same errors.


title: How to call a kuu from a shell script

text: I want to kuu to an account which requires a password, but I want to do this inside a shell script. How can I provide the password from the shell script?


title: How can I swap my two screens, left to right?

text: I pressed something and accidentally swapped my two screens. My left one is actually considered as the right one, and vice versa. How can I swap them back? **Edit** - Specifically, I'm using Gnome, though we might also want to keep this question generic. **Edit 2** - It appears that my driver isn't compatible with xrandr. I'm attaching log of `/var/log/Xorg.0.log` here


title: IDE for website development

text: This question has popped up in many open forum sites if you do a search term, but I think most of them are either talking about the remote explorer functionality or the design view. However this is how I use a glorified text editor (Dreamweaver) in Windows and I was wondering if there is such functionality present in Linux. I use the site manager to keep a local copy of my PHP files, and on save they are uploaded to the remote server. It also keeps an eye out for all my changes, which i can commit when I decide im done with my process, Sort of like Eclipse. Now there are IDEs or other software that do one or the other, however none that I found that perform both the tasks easily as one entity. The question is, has anyone got comfortable using Linux as a prime PHP development platform to develop for remote servers.


title: How to extract archive via network

text: I have two Solaris servers. On server1 I have a file, `archive.tar.gz`. I need to extract it using ssh to server2. So, I write the commands:               ssh server2 < archive.tar.gz | gunzip -c | tar -xf - -C /home/      But I got an error: > Pseudo-terminal will not be allocated because stdin is not a terminal. How to copy the file correctly?


title: How do I set a newly created user account to NOT prompt the user to change their password?

text: I created a new user account, but the user is prompted to change their password on first login. I don't want them to change their password, I want them to use the password they were assigned. How do I change their account so they aren't prompted to change their password when they log in?


title: relocate ext4 structures to survive truncation

text: I have a 6Gb raw disk image with 1 ext4 partition on it. I have only 1Gb worth of data on it Is there a way to reposition/adjust ext4 datastructures such that I can truncate the disk at 1 GB or 1.2Gb and still retain all the relevant structures I want to do a dd of the 1.2Gb truncated image on a target volume and still create the original 6GB disk with all the partition info & ext4 journals/superblocks valid Is this possible?


title: sshd without pam slower

text: I am running **OpenSSH_6.5** with `UsePAM yes` in my board. I have observed that with `UsePAM no` in `/etc/ssh/sshd_config`, `sshd` runs slower than previous case. How is this possible? My understanding is that without pam, `sshd` must execute faster than with pam. Here is **sshd_config**               $ cat /etc/ssh/sshd_config      #       $OpenBSD: sshd_config,v 1.82 2010/09/06 17:10:19 naddy Exp $          # This is the sshd server system-wide configuration file.  See     # sshd_config(5) for more information.          # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin          # The strategy used for options in the default sshd_config shipped with     # OpenSSH is to specify options with their default value where     # possible, but leave them commented.  Uncommented options change a     # default value.          #Port 22     #AddressFamily any     #ListenAddress 0.0.0.0     #ListenAddress ::          # The default requires explicit activation of protocol 1     #Protocol 2          # HostKey for protocol version 1     #HostKey /etc/ssh/ssh_host_key     # HostKeys for protocol version 2     #HostKey /etc/ssh/ssh_host_rsa_key     #HostKey /etc/ssh/ssh_host_dsa_key     #HostKey /etc/ssh/ssh_host_ecdsa_key          # Lifetime and size of ephemeral version 1 server key     #KeyRegenerationInterval 1h     #ServerKeyBits 1024          # Logging     # obsoletes QuietMode and FascistLogging     #SyslogFacility AUTH     #LogLevel INFO          # Authentication:          #LoginGraceTime 2m     #PermitRootLogin yes     #StrictModes yes     #MaxAuthTries 6     #MaxSessions 10          #RSAAuthentication yes     PubkeyAuthentication no     #AuthorizedKeysFile     .ssh/authorized_keys          # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts     #RhostsRSAAuthentication no     # similar for protocol version 2     #HostbasedAuthentication no     # Change to yes if you don't trust ~/.ssh/known_hosts for     # RhostsRSAAuthentication and HostbasedAuthentication     #IgnoreUserKnownHosts no     # Don't read the user's ~/.rhosts and ~/.shosts files     #IgnoreRhosts yes          # To disable tunneled clear text passwords, change to no here!     #PasswordAuthentication yes     #PermitEmptyPasswords no          # Change to no to disable s/key passwords     #ChallengeResponseAuthentication yes          # Kerberos options     #KerberosAuthentication no     #KerberosOrLocalPasswd yes     #KerberosTicketCleanup yes     #KerberosGetAFSToken no          # GSSAPI options     #GSSAPIAuthentication no     #GSSAPICleanupCredentials yes          # Set this to 'yes' to enable PAM authentication, account processing,      # and session processing. If this is enabled, PAM authentication will      # be allowed through the ChallengeResponseAuthentication and     # PasswordAuthentication.  Depending on your PAM configuration,     # PAM authentication via ChallengeResponseAuthentication may bypass     # the setting of "PermitRootLogin without-password".     # If you just want the PAM account and session checks to run without     # PAM authentication, then enable this but set PasswordAuthentication     # and ChallengeResponseAuthentication to 'no'.     UsePAM yes          #AllowAgentForwarding yes     AllowTcpForwarding no     #GatewayPorts no     X11Forwarding no     #X11DisplayOffset 10     #X11UseLocalhost yes     #PrintMotd yes     PrintLastLog no     #TCPKeepAlive yes     #UseLogin no     UsePrivilegeSeparation no     #PermitUserEnvironment no     #Compression delayed     #ClientAliveInterval 0     #ClientAliveCountMax 3     UseDNS no     #PidFile /var/run/sshd.pid     #MaxStartups 10     #PermitTunnel no     #ChrootDirectory none          # no default banner path     #Banner none          # override default of no subsystems     Subsystem       sftp    /libexec/sftp-server          # Example of overriding settings on a per-user basis     #Match User anoncvs     #       ForceCommand cvs server     Port 22     ClientAliveInterval 0     ClientAliveCountMax 0      And **/etc/pam.d/sshd**               $ cat /etc/pam.d/sshd      #%PAM-1.0     auth    sufficient      pam_ldap.so     auth    sufficient      pam_unix.so use_first_pass     account sufficient      pam_ldap.so     account sufficient      pam_unix.so     session required        pam_ldap.so     session required        pam_unix.so


title: Executing a command after eth0 is available, but before DHCP client

text: I'm running Debian Weezy on an ARM board. Right now I'm working around an issue with my network driver by running an ethtool command that limits the Ethernet interface to 100 megabit. However, the issue with the driver manifests itself as early as DHCP negotiation, so I need to run ethtool before dhclient runs. I've been trying to find a place where ethtool (or mii-tool, either way) can run before dhclient. So far all of the places I've tried (`/etc/network/if- pre-up.d` and `/etc/dhcp/dhclient-enter-hooks.d`) won't work because "eth0" isn't present yet. Is there a clean hook in the Debian network or system configuration where I can make changes to the Ethernet state before dhclient runs? Or am I trying to do something impossible here?


title: jemalloc and other errors making redis on centos 6.4

text: I am setting up a new, dedicated, centos 6.4 system with redis. I have installed redis many times, but have never hit this issue (and have never been on centos 6.4 before).               cd redis-2.6.16     sudo make install      error:                   sh: ./mkreleasehdr.sh: Permission denied     and later:         zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory         zmalloc.h:55:2: error: #error "Newer version of jemalloc required"      When I try to build jemalloc directly (from the /src area of the redis tarball), other errors include:               cd src && make jemalloc     sh: ./mkreleasehdr.sh: Permission denied     make[1]: Entering directory `/tmp/rediswork/redis-2.6.16/src'     make[1]: *** No rule to make target `jemalloc'.  Stop.     make[1]: Leaving directory `/tmp/rediswork/redis-2.6.16/src'     make: *** [jemalloc] Error 2      I also tried redis 2.6.7 and have the same issue. I have dug all over and can find no path forward.


title: Remove the string before the whitespace

text: I want to remove a word before the whitespace. My file structure is: ant               tiger          static rabbit          lion          dynamic monkey          donkey      I need the output as:               ant          tiger          rabbit          lion          monkey          donkey      Can I use a `grep` command for this, or are there any other methods that are available?


title: raspberry pi pulseaudio server connection failure

text: I purchased a raspberry pi model b , after installing image, the first thing I do is I installed vlc and copy a mp4 video in raspberry pi. Now from command prompt I tried to run my video using vlc. for this I type this command               vlc a.mp4      where a.mp4 is my video name. But I got this error               pulseaudio server connection failure: connection refused      I don't have any idea of raspberry pi, so can anyone tell me what's the problem


title: Solaris can't reach DHCP server with VMWare Player

text: I've got a very creepy problem. 3 days ago I installed some Windows 7 updates. After that my Solaris network has stopped working. I'm working at VMWare Player with OpenIndiana. Everything was okay till this day. I can't access VMWare Player Network configuration from Win7 because I don't have administrative priviliges. OpenIndiana (OI) is working with two interfaces - one local interface working on NAT to connect with Ubuntu machine, and a second one with bridged mode to get an address from a DHCP server. I was trying almost everything, it's not about something with OI because I haven't changed anything till the day when I made Windows Update. Is something blocking my VMWare Host?


title: Removing redirection operator does not change output. Why?

text: I saw this usage of redirection somewhere, and thought it was a typo:               grep root < /etc/passwd      But after I run it, I saw that it gives the same output with `grep root /etc/passwd`:               $ grep root < /etc/passwd     root:x:0:0:root:/root:/bin/bash          $ grep root   /etc/passwd     root:x:0:0:root:/root:/bin/bash      The same thing happens with               cat < /etc/passwd     cat   /etc/passwd      However, redirection is ignored when used with `ls`:               ls < /etc/passwd      does not print the same output with               ls  /etc/passwd      What is happening?


title: /etc/shadow on Mac

text: I've been trying to run this Linux passwd-generator file on my Mac. I modified enough the script to make it to work well with directories under OSX:               #!/bin/sh     # build-passwd.sh - creates a password file which contains all OS users (except root)     PASSWDIR=$(cd "$(dirname "$0")"; pwd)/etc     PASSWFN=$PASSWDIR/passwd     if [ ! -d "$PASSWDIR" ]; then     mkdir $PASSWDIR     echo "$PASSWDIR created"     fi     sudo awk -F":" '     BEGIN {OFS=":"}     {if ($1 != "root" && $2 != "!" && $2 != "*") print $1,$2}     ' /etc/shadow > $PASSWFN **<===here's my problem**     if [ $? = 0 ]; then     echo "Password file saved to $PASSWFN"     fi      But didn't succeed because there is no "/etc/shadow" on Mac. So do you know if there is some alternative to this? (I also tried to copy/paste the file from my Linux installation using the same password)


title: Cannot see aliases

text: I have my root user and another user testuser. Now in the .bashrc of testuser, there are some aliases like la for ls -a. But when I login to testuser and try running la, it gives me the error: -sh: la: not found Even when I try to find $HOME, it says Permission denied (?) This is slowing down my work!! Help!


title: disabling mouse support in `vim` in a `gnome-terminal` environment

text: Edit: The problem of an enabled mouse in `vim` appears to be specific to `gnome-terminal` (version 3.4.1.1-1; I am using gnome 3 fallback mode). If I run `xterm`, mouse support in `vim` is disabled by default, and I have the option to enable it (`:set mouse=a`, which I never do) and disable it (`:set mouse=`). In contrast, when I run `vim` in `gnome-terminal`, mouse support is enabled by default and it is not possible to disable it (`:set mouse=` has no effect). Is there a solution short of changing terminal emulator? * * * I want to completely disable mouse support in `vim`. I am running `vim` version 2:7.3.547-3 through `gnome-terminal` version 3.4.1.1-1. The following commands, whether executed directly in vim or added to my `.vimrc` file, fail to disable mouse support:               set mouse =     set mouse =""      Based on reading the vim manual and posts online, one or both of these commands should work. In particular, the vim manual states the following               'mouse'                 string  (default "", "a" for GUI, MS-DOS and Win32)         The mouse can be enabled for different modes:                 n       Normal mode                 v       Visual mode                 i       Insert mode                 c       Command-line mode                 h       all previous modes when editing a help file                 a       all previous modes                 r       for |hit-enter| and |more-prompt| prompt          Normally you would enable the mouse in all four modes with: >                 :set mouse=a         When the mouse is not enabled, the GUI will still use the mouse for         modeless selection.  This doesn't move the text cursor.      I am using a laptop and each time my hand brushes the trackpad, my cursor position in vim moves abruptly.


title: Force "indent" utility to ignore namespaces

text: I didn't found a mention about a namespaces in the man at all. The problem is that the utility inserts a whitespaces before the code that inside a braces of a `namespace` keyword. I guess the reason is that the utility supposed to use with C-code only, and it doesn't knows about such a things as a namespaces. But I wonder, may be here is a way, e.g. to point some keyword with a matching parentheses that should be ignored..?


title: su options - running command as another user

text: I was wondering how to run a command as another user from a script. I have the script's owner set as root. I also have the following command being run within the script to run the command as the hudson user:               su -c command hudson      Is this the correct syntax?


title: How to enter LVM GUI from CentOS live CD?

text: I'm trying to reduce in size one of my logical volumes in CentOS. I booted from the CentOS 5.10 installation CD into linux rescue and tried running:               lvreduce --resizefs --size 450g /dev/VolGroup00/LogVol00      but it failed with "unary operator expected". I think it would be easier to use the LVM GUI, but how can I enter it from rescue mode?


title: Fluxbox: is there a problem with java modal dialogs and fluxbox?

text: I have got a java application that opens a modal dialog. The modal dialog is shown behind the main window and there is no way I can bring the modal dialog to front. If I switch to Cinnamon everything works as expected but not in Fluxbox. See the screenshot: ![enter image description here](http://i.stack.imgur.com/mYBPM.png) The window with the title "JNLP file" should be shown in front. Even when I try to bring it with the mouse it stays in behind. Is there any way to fix it? PS. When I press `ALT-TAB` the java applicaton is not amoung the ones selectable (using `bbkeys`).


title: MC and MCedit take long time to start

text: I recently discovered that my MidnightCommander takes around 40 seconds for every startup and the same goes for McEdit. I access my machine only via ssh and of course I'm not logging in as root, only to prevent the questions. I did an strace and it puts out two system calls that take around 20 seconds: `poll([{fd =3, events=POLLIN}], 1, -1) = 1 ([{fd=3, revents=POLLIN}]) select(5, [4], NULL, NULL, NULL) = 1 (in [4])` Unfortunately I don't have the heck of a clue what these calls are, any hints or help would be appreciated, thanks in advance! Update: If I do a sudo mc it works as usual, only with my accout it does take that long. Solution: The solution is simple, I had X11 forwarding in Putty enabled, after deactivating it everything works like a charm. Strange, but anyway, it works again. Thanks for your answers!


title: Automatic login for mysql used in CGI script

text: I have written a `CGI` script using `bash` which executes a `MySQL` query. For MySQL authentication , automatic login is used by supplying the credentials in .my.cnf file as shown below .               # the following section will be read by *all* client programs     [client]     user=dbuser     password=password      Since the CGI program is executed as apache user , I placed the .my.cnf under apache's home directory.                 # grep apache /etc/passwd       apache:x:48:48:Apache:/var/www:/sbin/nologin           # ls -l /var/www/.my.cnf      -rw------- 1 apache apache 97 Apr 23 12:36 /var/www/.my.cnf      But looks like this is not working as mysql query is not getting executed . I am confused actually where to put the .my.cnf so that mysql query in CGI script can read it from that location. Code snippet for the script is as follows               #!/bin/bash          echo "Content-type: text/html"     echo ""          echo ""     echo ""          mysql -h 192.168.2.140 -D mysql -e "select User from mysql;"          echo ""     echo ""


title: Subtle WM in Full Floating Style

text: I am using Subtle and I am happy with it. But I want to change it to serve all windows in Floating style like all stacking windows manager. Is it possible and how?


title: What does the hash in ${parameter/#pattern/string} do?

text: I saw the following substitution in this article:               ${PWD/#$HOME/~}      How does it compare to this?               ${PWD/$HOME/~}      Both seem to be the same. I don't know why the hash was included.


title: How to make a bash script wait till a pendrive is mounted?

text: I have a bash script which has a line `cd /run/media/Username/121C-E137/` this script is triggered as soon as the pen-drive is recognized by the CPU but this line should be executed only after the mounting process is complete. As of now what happens is this line is executed before the pen-drive is mounted and returns an error the directory is invalid.


title: multiple ftp user sharing common home directory

text: I want to setup like mentioned, where I can create multiple ftp users with having same home directory. What I have tried so far, Created new user with pointing to the directory of ftp user as home, but as new user is not owner of that directory connection is refusing I guess. I have also tried to mange this using soft link, like I have created soft link of original ftp directory and mapped that links as home of individual user's home directory. I know if I create all home directory separately for all ftp users then this will work, right now my FTP user and apache user both are same, so file I am uploading apache get its execution permission by default, but if I separate out users and if I will uploading file using another user which is not mapped with apache, will apache able to execute that file?


title: Deluge torrent client cannot save files to mounted drive

text: Yesterday I installed an SSD as my new primary drive, and installed Fedora 20 on to it running cinnamon-desktop. I set a 1.5GB partition on my old drive, which was my data partition on the old setup, to automatically mount when the system starts up. I did this through the gui, not manually. I installed the latest Deluge (or at least the latest in the repos), and configured it to point to an existing folder on the mounted partition where all of the old files were saved, and then added all of the torrent files. Deluge can read the files fine, and is seeding them all as well. However, whenever I go to add a new file, I get a permission denied on any of the pieces, and the new folder for that file is never created. I even tried manually creating one of the folders and `chmod` it to 777, but I got the same thing. This is with deluge-gtk, and it is running under the same username that all of the files are owned by. I tried unmounting the drive and re-mounting it manually, but it didn't help. If I manually change the save location to a folder on the SSD then it works fine, and what's really weird is I can have it download to a folder on the SSD, and then tell Deluge to move the file to the mounted drive, and it is able to do so with no issues, it just can't seem to create the folder initially on the mounted drive. It worked yesterday as well, prior to me setting the drive to auto mount. If it helps any, this is what the system created in my fstab when I used the gui to auto mount the drive:               /dev/disk/by-uuid/af7c9906-736b-44e3-a6d0-c4573b74baa1 /mnt/af7c9906-736b-44e3-a6d0-c4573b74baa1 auto nosuid,nodev,nofail,x-gvfs-show 0 0      **Edit:** I discovered that the issue is not with either permissions nor with the way in which the partition was mounted. Apparently when I started Deluge without mounting the partition first (which cause a bunch of errors, and is what lead me to auto-mount it in the first place) one of the effects was it nulled out the default Save location, which I did not notice. I just went in and reset it and it is working fine now. I am unsure if I should delete the question or leave it in case anyone else runs into the same issue, and if I do leave it if I should edit the title. Feedback on that aspect of the question would be appreciated, thanks.


title: Solaris 10 installation on KVM constantly reboot

text: Successfully installed Solaris 10 sparc on KVM. However when I restarted the VM it doesn't go to login screen but just constantly reboots. I've read different documents link1 link2 link3 but none of their solutions helped. I used Ubuntu 12.04 and installed Solaris using Virt-Manager. I updated qemu-kvm to the latest version (2.0) as the one installed in Ubuntu is quite old. I have the following configuration below in setting up Solaris in virt-manager, if this helps.               ISO - sol-10-u11-ga-sparc-dvd.iso               Memory: 2GB     Processors: 1      Hard Disk: raw,      cache=writeback, IDE     Network: E1000     Sound: ac97     OS Type: Other OS types (other) choose Solaris 10     Boot order: Disk 'ide0', CD-ROM     Tablet for Pointer: No     Use local time for RTC: Yes


title: install python module for particular python instance

text: I have 2 python instance on a CentOS machine, i.e. `/usr/bin/python2.4` and `/usr/bin/python2.7`. Modules for 2.4 are in `/usr/lib/python2.4`, and modules for 2.7 are in `/usr/local/python27`. When I do `yum install numpy`, which I want to install for `python2.7`, it automatically install for `python2.4`. How can I appoint which instance to install modules for with `yum`, `easy_install` and `pip`?


title: How can I enable access to USB devices within VirtualBox guests?

text: I cannot see any USB devices within my VirtualBox guest VMs from my host. How do I enable access for my guest VMs?                                ![ss of missing USB devices](http://i.stack.imgur.com/j71NC.png)


title: Can't install Ubuntu because pc keeps shutting down

text: I can't install Ubuntu because during the "copying files" my PC powers off. I've downloaded Ubuntu 14.04 with WUBI on my Windows 8.1 32-bit PC. I made a new partition with 15.9GB, (I don't know if I need more memory on my partition) Then WUBI, correctly, reboots. But then when it gets to "copying files", the computer powers off. Before it shuts down, it looks like this. ![Copying files](http://i.stack.imgur.com/MN3ye.jpg)


title: How do I clear Bash's cache of paths to executables?

text: When I execute a program without specifying the full path to the executable, and Bash must search the directories in `$PATH` to find the binary, it seems that Bash remembers the path in some sort of cache. For example, I installed a build of Subversion from source to `/usr/local`, then typed `svnsync help` at the Bash prompt. Bash located the binary `/usr/local/bin/svnsync` for "svnsync" and executed it. Then when I deleted the installation of Subversion in `/usr/local` and re-ran `svnsync help`, Bash responds:               bash: /usr/local/bin/svnsync: No such file or directory      But, when I start a new instance of Bash, it finds and executes `/usr/bin/svnsync`. How do I clear the cache of paths to executables?


title: Why isn't the first executable in my $PATH being used?

text: I have a script called `jsl` in `/usr/local/bin`. Running `which jsl` finds it there. I want to temporarily use a different version, and when I `echo $PATH` I see that `/usr/bin` is earlier in the path. So I added a script called `jsl` in that folder and I've verified that it is executable and runs correctly when called with the full path. However, `which jsl` still finds the first version, and `jsl` still runs it. Why isn't my new `jsl` being found by `which` or executed by name?


title: Avoid completing directory names when changing vim buffers

text: Suppose I have a directory structure, such as               dir     ├── foo     │   ├── bar.c     │   ├── bar.h     │   ├── foo.c     │   └── foo.h     └── config         └── foo.conf      And I have each of the files in `foo/`, as well as `foo.conf` open in a vim buffer. If I want to switch to `foo.c`, I type `:b foo<TAB>`. However, since “foo” matches the name of the parent directory, vim suggests all the files in `foo/` as possible matches. I would like only `foo.conf`,`foo.c` and `foo.h` to be suggested. Is this possible in any way?


title: Delete whitespace for a  set of lines in Vim editor

text: I have some text like the following in a file:                 sample text         some random text                 even more random text     text with no indent      worst indention      I need to delete the empty space before each of the lines. For one line what I do is `0dw` I can repeat the same command using . but by manually navigating to the next lines. But is there a way to apply '0dw' to those block of lines? I suppose there is a way using macros, but I haven't used them before. But I am willing to learn them if ther is no other choice.


title: Number of X screens corresponding to number of "Screen" sections in xorg.conf file for multi-monitor configuration

text: I want to set up a multi-monitor configuration where two "landscape" oriented monitors one above the other and two "portrait" oriented monitors one right of the other combine into a single large screen. I'm trying to create a `xorg.conf` file that would provide a single X screen for multiple (four) monitors attached to several (two) videocards (NVidia) on the same machine (Ubuntu 11.10). I stumbled upon a `xorg.conf` manual that states that the `Screen` section is the binding of a `Monitor` and a `Device`. I don't understand how to provide the idea that one `Screen` must be composed of several `Monitor`s. I don't want to use `Xinerama` or `TwinView` since it don't meet my requirements for hardware acceleration. I used `nvidia-settings` but it doesn't honor the rotation settings.


title: When to use bash ANSI C style escape, e.g. $'\n'

text: I don't use bash often but I recall in the past to pass a tab or newline on the command line I would have to escape the character using the special `$` character before a single quoted string. Like `$'\t'`, `$'\n'`, etc. I had read about quotes and escaping in the bash manual. What I want to know is when it's appropriate to use an ANSI C style escape. For example I was working with a regex in grep and it appeared I needed an ANSI C style escape for a newline. Then I switched to perl and it seemed I didn't. Take for example my recent question on stackoverflow about a perl regex that didn't work. Here's the regex I was using:               echo -e -n "ab\r\ncd" | perl -w -e $'binmode STDIN;undef $/;$_ = <>;if(/ab\r\ncd/){print "test"}'      It turns out that is actually incorrect because I gave the string ANSI C style escape by using `$`. I just don't understand when I'm supposed to prepend the dollar sign and when I'm not.


What is the Fedora equivalent of the Debian build-essential package?


title: Network Configuration Get Removed After Restarting Zentyal Linux Server

text: I'm facing a issue with my wireless configuration in Zentyal Linux Server. I configured my wifi network setting in /etc/network/interfaces like this :               # interfaces(5) file used by ifup(8) and ifdown(8)          auto lo     iface lo inet loopback          auto wlan1     iface wlan1 inet dhcp     wireless-essid <name>     wireless-key1 <key>     address 192.168.1.100     netmask 255.255.255.0     gateway 192.168.1.1     ...      It is working fine but when i restart my Server. Network settings get removed every time and shows following lines only :               # interfaces(5) file used by ifup(8) and ifdown(8)          auto lo     iface lo inet loopback      Every time i have to write these settings again to start my wifi. What is going on, and how can I fix this ?


title: Tell mplayer to prevent the screensaver from kicking in while playing

text: I know mplayer has some heartbeat setting but I don't recall what it is, could anyone tell me? _another one of those annoying things that used to just work and somewhere along the line stopped being default_


title: Linux, openSuse on virtualBox not showing usb

text: My virtual box is installed on the host(Win 8.1). In the virtual box, I have installed OpenSuse as the virtual machine, but I am having trouble accessing the usb in OpenSuse(vm). I can't see any option to access the usb. My usb is in FAT32 format,as I am trying to get some files from other win machine to openSuse. The following are the screen shots, please let me know what all I need to do to access the USB in openSuse(vm). ![VirtualBox Settings on Win8 host](http://i.stack.imgur.com/UE5Uk.png) ![Cannot see any usb option in openSuse](http://i.stack.imgur.com/vO28m.png) when I do lsusb, following is the output.               linux-gn77:~ # lsusb     Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


title: Installing a second hard drive

text: My system currently runs an XBMC live install. I am installing a second hard drive in my system, but I am somewhat of a linux newb and only know the basics. Since it is XBMC I believe I need to do everything from the command line. **Can anyone give me a little step by step on what I need to do with the commands and proper parameters?** As an aside, I am planning on formatting as ext2. The game plan is to share this drive on my network, so I can copy files to it from my Mac running OSX. Should I use a different format?


title: Trying to install spotify with libssl1.0.0

text: I would like to install spotify client but it's complaining that it can't find the old libssl0.9.8 So I created a symlink to libssl1.0.0:               sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so**.1.0.0** /usr/lib/libssl.so.0.9.8      This did not work. So I made another one:               sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so**.1.0.0** /usr/lib/x86_64-linux-gnu/libssl.so.0.9.8      Also failed to install the spotify client. What am I doing wrong?


title: Determine if zfs is the actual filesystem

text: With Solaris 11 the default filesystem should be zfs, but following the official guide I obtained (with `cat /etc/default/fs`)               LOCAL=ufs      Is this an error? I thought that the same information was in the output of the `mount` command, but it wasn't. It is just a list of all the mountpoints. With `mount -p` instead:               rpool/ROOT/GUI - / zfs - no      /devices - /devices devfs - no      /dev - /dev dev - no      ctfs - /system/contract ctfs - no      proc - /proc proc - no      mnttab - /etc/mnttab mntfs - no      swap - /system/volatile tmpfs - no xattr     objfs - /system/object objfs - no      sharefs - /etc/dfs/sharetab sharefs - no      /usr/lib/libc/libc_hwcap1.so.1 - /lib/libc.so.1 lofs - no      fd - /dev/fd fd - no rw     rpool/ROOT/GUI/var - /var zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     swap - /tmp tmpfs - no xattr     rpool/VARSHARE - /var/share zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/export - /export zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/export/home - /export/home zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/export/home/user - /export/home/user zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool - /rpool zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/VARSHARE/zones - /system/zones zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/VARSHARE/pkg - /var/share/pkg zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime     rpool/VARSHARE/pkg/repositories - /var/share/pkg/repositories zfs - no rw,devices,setuid,nonbmand,exec,rstchown,xattr,atime      It shows that the root filesystem has zfs. Also with `zfs list` I obtain               NAME                              USED  AVAIL  REFER  MOUNTPOINT     rpool                            7,09G  42,1G  4,65M  /rpool     rpool/ROOT                       4,97G  42,1G    31K  legacy     rpool/ROOT/GUI                   4,96G  42,1G  4,40G  /     rpool/ROOT/GUI/var                462M  42,1G   231M  /var     rpool/ROOT/solaris               9,97M  42,1G  2,42G  /     rpool/ROOT/solaris/var            570K  42,1G   305M  /var     rpool/VARSHARE                   2,53M  42,1G  2,44M  /var/share     rpool/VARSHARE/pkg                 63K  42,1G    32K  /var/share/pkg     rpool/VARSHARE/pkg/repositories    31K  42,1G    31K  /var/share/pkg/repositories     rpool/VARSHARE/zones               31K  42,1G    31K  /system/zones     rpool/dump                       1,03G  42,2G  1,00G  -     rpool/export                     49,4M  42,1G    32K  /export     rpool/export/home                49,4M  42,1G    32K  /export/home     rpool/export/home/user           49,3M  42,1G  49,3M  /export/home/user     rpool/swap                       1,03G  42,2G  1,00G  -      So what is the right way to determine the actual filesystem?


title: Is there a utility that interprets /proc/interrupts data in time?

text: is there something out there ? Like **top** is for **ps**


title: Filesystem monitoring

text: A script where we need to come up with a way for the disk space monitoring to be smarter. On smaller file systems, we still want to alert at 90% full, but on larger file sytems, we should only alert when there is only a few GB free. Can someone please shed some light on this and do the needful?


title: How to extract only a specific folder from a zipped archive to a given directory?

text: How does one extract a specific folder from a zipped archive to a given directory? I tried using               unzip "/path/to/archive.zip" "in/archive/folder/" -d "/path/to/unzip/to"      but that only creates the folder on the path I want it to unzip to and does nothing else.


title: How to set GTK icon theme in i3?

text: How to change icon theme in i3? If this matters, I'm working on Arch Linux. I googled, but I can only find info about GTK theme, not icons.


title: mkdir multiple directories with a subdirectory name having space in it

text: I want to make multiple directories in one go. The problem is that one of the sub directories have a name with a space in it. The directory structure i want to make is as follows.               project         /level 1         /level2      I tried escaping the space but it does not seem to work. Here is my command.               mkdir -p project/{level\ 1,level2}      But this does not seem to work. and results in directory structure like.               project         /level          1,level2      What am I doing wrong?


title: Keyboard triggering mouse events on Debian on Macbook

text: I installed Debian 6 on my Macbook in a dualboot configuration. Everything is working fine, except for the keyboard. As I'm typing, I see the mouse arrow moving a bit and strange things happen, such as text under the arrow becomes highlighted or clicked. Other things such as Right-Click, selecting text and other mouse-related events also happen. It's really hard to type like this! Does anyone have any ideas of what might be the cause and how I can fix this?


title: How to install mutliple PHP instances and configure for Apache

text: I need to upgrade my PHP installation on CentOS 6 from 5.3 to 5.5. While I have a couple of webprojects running I like first to install the new PHP in parallel and switch back to the old one if problems are occurring.   * How do I install php 5.5 on CentOS in parallel and keep the old one?   * How do I configure Apache to take the new PHP instance?   * Is there a possiblity on Apache to specify for each virtual host which PHP instance has to be taken?   * How do I uninstall the old version?


title: Floating point performance in Linux

text: I've tested Geekbench for my computer for both Windows and Linux. It seems that Linux loses markedly in floating point performance. Is there anything I can do about it? Install an optimization library? Change some setting? How can difference in floating point arithmetic be explained?