title: unable to run bash as new user on an ubuntu docker container

text: i have a docker container and i am trying to enable sshd and log in with a new user rag. it appears that as user 'rag' i am not able to execute /bin/bash. i am not sure why. i cannot figure out whether apparmor plays a part but I remember that I set apparmor in complaining mode for docker binary. strace log on container: `strace -f su rag`               ...     clone(Process 57 attached     child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fa97fb77a10) = 57     [pid    56] rt_sigprocmask(SIG_BLOCK, 0x7fff63a8c770,  <unfinished ...>     [pid    57] setuid(1000 <unfinished ...>     [pid    56] <... rt_sigprocmask resumed> NULL, 8) = 0     [pid    57] <... setuid resumed> )      = 0     [pid    56] rt_sigaction(SIGTERM, {...}, NULL, 8) = 0     [pid    56] rt_sigprocmask(SIG_UNBLOCK, 0x7fff63a8c770, NULL, 8) = 0     [pid    56] wait4(-1,  <unfinished ...>     [pid    57] execve(0xfea780, [0x7fff63a8a400], [/* 0 vars */]) = -1 EACCES (Permission denied)     [pid    57] access(0xfea780, R_OK|X_OK) = 0     [pid    57] execve(0x40658d, [0x7fff63a8a400], [/* 0 vars */]) = -1 EACCES (Permission denied)     [pid    57] dup(2)                      = 3     [pid    57] fcntl(3, F_GETFL)           = 0x1 (flags O_WRONLY)     [pid    57] close(3)                    = 0     [pid    57] write(2, 0x7fff63a89930, 44Cannot execute /bin/bash: Permission denied     ) = 44     [pid    57] exit_group(126)             = ?     [pid    57] +++ exited with 126 +++     <... wait4 resumed> [?], WSTOPPED, N     ...      on container:               root@2bca318903ce:/# getent passwd rag     rag:x:1000:1000::/home/rag:/bin/bash          root@2bca318903ce:/# ls -l /bin/bash     -rwxr-xr-x 1 root root 1017016 Apr  9 01:03 /bin/bash      kernel log on host               Aug 31 00:40:21 rag-tos-laptop kernel: [12333.058944] audit_printk_skb: 768 callbacks suppressed     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.058955] type=1400 audit(1409442021.108:609): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10480 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.060062] type=1400 audit(1409442021.108:610): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10482 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.060485] type=1400 audit(1409442021.108:611): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.060977] type=1400 audit(1409442021.108:612): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061221] type=1400 audit(1409442021.108:613): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061264] type=1400 audit(1409442021.108:614): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061289] type=1400 audit(1409442021.108:615): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061304] type=1400 audit(1409442021.108:616): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061323] type=1400 audit(1409442021.108:617): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"     Aug 31 00:40:21 rag-tos-laptop kernel: [12333.061338] type=1400 audit(1409442021.108:618): apparmor="ALLOWED" operation="ptrace" profile="docker-default" pid=10478 comm="strace" requested_mask="trace" denied_mask="trace" peer="docker-default"      host release               $ cat /etc/lsb-release      DISTRIB_ID=LinuxMint     DISTRIB_RELEASE=17     DISTRIB_CODENAME=qiana     DISTRIB_DESCRIPTION="Linux Mint 17 Qiana"      apparmor status               ....     1 profiles are in complain mode.        docker-default     ...


title: How can I make the eth1 up and always available for remote access, where eth0 will be used for host to host IPSec VPN?

text: I am running Amazon EC2 instance with Red hat enterprise linux, where I have two network interface. Now:   1. eth0 is currently active having public ip where I am remotely logged in via SSH, to configure VPN (once VPN is done, I wont be able to remotely access this IP and interface anymore)   2. eth1 is showing down (using amazon I have assigned on it with another new public ip but cant ping it nor I can login on it using SSH)   3. once I have eth1 up and remotely accessable, I have to configure VPN client on eth0 to connect to another remote server How can I make the eth1 up so that I have remote access on eth1 and eth0 can be dedicated for the VPN IPSec host to host?               [ec2-user@ip-10-0-0-41 ~]$ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0         inet6 fe80::c29:1ff:fea8:c698/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000         link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff      EDIT:               $ system-config-network-tui     eth1 is added as dhcp          $ ifup eth1     Determining IP information for eth1...      _**EDIT:_**               $ ssh amazonec2@eth0...public...ip  - fails     $ ssh amazonec2@eth1...public...ip  - allow to login     $ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 0e:29:01:a8:c6:98 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.41/24 brd 10.0.0.255 scope global eth0         inet6 fe80::c29:1ff:fea8:c698/64 scope link             valid_lft forever preferred_lft forever     3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether 0e:29:01:a9:6e:32 brd ff:ff:ff:ff:ff:ff         inet 10.0.0.110/24 brd 10.0.0.255 scope global eth1         inet6 fe80::c29:1ff:fea9:6e32/64 scope link             valid_lft forever preferred_lft forever      _**EDIT:_**               $ yum install openswan     $ cat /etc/ipsec.conf     version 2.0 # conforms to second version of ipsec.conf specification     config setup         protostack=netkey         nat_traversal=yes         virtual_private=         oe=off     include /etc/ipsec.d/*.conf          $ cat /etc/ipsec.d/test.conf          ### Administrator given this to setup     # Phase1: Encryption: AES128 Integrity: MD5 IKE Lifetime: 28800 sec.     # Phase2: Encryption: AES128 Integrity: MD5 IPsec lifetime: 3600 sec.          ### Red hat we use Phase 1 and Phase 2 for IPSec      conn test         type=tunnel         authby=secret         pfs=no         # Lifetime: 1440 sec         ike=aes128-md5;modp1024!         # Lifetime: 3600 sec         phase2alg=aes128-md5;modp1024         aggrmode=no             left=194.x.x.x         right=54.x.x.x         leftsubnet=10.109.0.0/24         rightsubnet=10.0.0.0/24         #auto=start          $ service ipsec restart && ipsec auto --add test     ipsec_setup: Stopping Openswan IPsec...     ipsec_setup: Starting Openswan IPsec U2.6.32/K2.6.32-358.6.2.el6.x86_64...     ipsec_setup: /usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled     /usr/libexec/ipsec/addconn Non-fips mode set in /proc/sys/crypto/fips_enabled          $ ipsec auto --up test     022 "test": We cannot identify ourselves with either end of this connection.        * If add works without error then config file is correct the rest is other issues for tunnel.


title: How to control keyboard backlight using hotkeys

text: How can I turn increase and decrease the keyboard backlight in notebook on Linux using the same hotkeys used on Windows? In Windows I can control the keyboard backlight by pressing hotkeys (`Fn``F9` to decrease and `Fn``F10` to increase), but in Linux it doesn't seems to have these hotkeys implemented as the keyboard backlight is a new and not most spread feature for the notebooks/ultrabooks. Note: The `Fn` is working for normal features like display brightness and sound, just for controlling the keyboard backlight it is not configured correctly... But it works in the Linux, as I can turn it on in the Grub2 boot device selector, but not in the running Linux OS. Just some extra-specs, if it helps: OS : Linux (Mint Cinnamon 17). Notebook: Samsung Ativ Book 6.


title: Computer speed in flops

text: Nowdays, The speed of supercomputers are measured in Flops. Is there any linux command or tool that can calculate or gives the speed of a processor in Flops. If not, than how do we measure it.


title: problem regarding YUM

text: I have a problem with my Centos 6. Actually, I am trying to run any command like `yum update` or `yum upgrade` or `yum install mysqlmysql-server`. Everytime, I got an error below:               Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile     Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was     14: PYCURL ERROR 22 - "The requested URL returned error: 403"     Error: Cannot find a valid baseurl for repo: base


title: Can zsh access the stdout of last run program?

text: I often use `find` or `locate` to find out about paths.               (~) locate foobar.mmpz     /home/progo/lmms/projects/foobar.mmpz      The next step is often to open or otherwise manipulate the files. In a happy case like above, I can do this:               (~) ls `!!`     ls `locate foobar.mmpz`     /home/progo/lmms/projects/foobar.mmpz      But nobody's too happy when there are many lines of output, some of which may not be paths or something else of that kind. Besides, rerunning potentially wasteful commands is not that elegant either. Would there be a way to hook up zsh to store the stdout into an array for later manipulation? After all, it's the shell's job to redirect the streams to the user. I'm thinking it could store the first N and last N lines in a variable for immediate later use, like `$?` and others. **Ok** so this is pretty cool: http://unix.stackexchange.com/a/59704/5674. I'm now asking about the zsh know-how (and porting the code to zsh) to rig this kind of capture after each run line.


title: Which config files in /etc folder must be unique for each computer?

text: I am doing a restoration test of backup files on a computer. Without putting much thought into it, I did an `rsync` to replace all files in `/etc` folder with the ones in the backup. Then, I realize I shouldn't really be doing it as the passwords and user names for the two computers are not the same. After a reboot, the computer is in a state where it cannot start, and I would possibly have to reinstall it from scratch. Now my question is, given the same OS, what are the files in `/etc` folder that are unique for each computer. This would allow me to fine-tune `rsync` to exclude those files in the future when doing a restoration from backup.


title: copy filenames with special characters to an external ntfs volume

text: I'm trying to copy the `Documents and Settings` folder of a Windows XP system over to an NTFS external disk using a USB Live of Puppy Linux. I encountered am encoding problem for namefiles in which the system doesn't recognize italian special characters (part of utf-8) so that using `cp` or the GUI file manager will bring the error `invalid or incomplete multibyte or wide character`. How can I copy the files whose names include the special characters to the NTFS drive?


title: how to specify session to connect to when xrdp has spawned multiple sessions?

text: I have installed xrdp on Debian 7 like so: `apt-get install xrdp vnc4server ` I have been connecting using Microsoft Remote Desktop Connection. I have noticed that sometimes, my existing session doesn't connected if my connection drops and I reconnect, instead I get a new connection. My `ps` output shows this: `vagrant@devcloud:~$ ps x | grep -i vnc 11233 ? S 0:03 Xvnc :11 -geometry 1440x900 -depth 16 -rfbauth /home/vagrant/.vnc/sesman_vagrant_passwd -bs -ac -nolisten tcp 12404 pts/5 S 0:01 Xvnc :12 -geometry 1440x900 -depth 16 -rfbauth /home/vagrant/.vnc/sesman_vagrant_passwd -bs -ac -nolisten tcp 12855 ? S 6:13 Xvnc :10 -geometry 1600x900 -depth 16 -rfbauth /home/vagrant/.vnc/sesman_vagrant_passwd -bs -ac -nolisten tcp ` **Question:** Is it possible to specify the session to connect to, rather than spawning a new session being spawned?


title: Can't connect to my wireless network though GNOME

text: I am a complete Linux beginner and I managed to install Archlinux today. But I have no access to my wifi for some reason. I get internet access in my terminal with `wifi-menu` but gnome tells me that it can not connect to my wireless network. The password is 100% correct. I followed this guide and installed `network-manager-applet`, and I also changed the `rc.conf` file:               rc.d start networkmanager      I also installed `pacman -S networkmanager` I restarted `networkmanager`, enabled / disabled it, started it again. I also turned the wireless network in GNOME on and off. But nothing helped. Any ideas what went wrong?


title: find flags: -exec rm -rf vs -delete

text: I thought the flags I mentioned in the question are the same, but I get the following message with the former, but nothing with the latter:               $ find . -mindepth 1 -type d -exec rm -rf {} \;     find: `./practice4': No such file or directory     find: `./practice10': No such file or directory     find: `./practice7': No such file or directory     find: `./practice9': No such file or directory     find: `./practice1': No such file or directory     find: `./practice5': No such file or directory     find: `./practice3': No such file or directory     find: `./practice6': No such file or directory     find: `./practice2': No such file or directory     find: `./practice8': No such file or directory      Extra questions I have are:, is there an simpler code to delete all subdirectories? Is the order of deletion random? I created the directories using               $ mkdir practice{1..10}


title: Cinnamon + Gnome = Ignored settings?

text: I recently switched from Gnome to Cinnamon in Fedora 17, and I feel like I did something wrong because it seems as though Cinnamon ignores any Gnome settings, despite being Gnome-based (as far as I understand it). All of the help pages I come across suggest using gconf-editor, dconf-editor, or even the "keyboard settings" to change settings such as the compose key, hotkeys, or the alt+click behavior, but cinnamon ignores anything I change in any of these. I've had to resort to using xbindkeys and running that in a .rc file on startup for hotkeys. It also seems to ignore anything I put into gnome-session-properties to try to run on startup. Does anyone know why Cinnamon seems to run just fine but ignore all gnome settings? Thanks


title: Wired connection going through wrong router

text: My son has a problem not getting a cosistant wifi signal in his bedroom so he uses another router wired to the gateway. The problem I have is that when I connect to the gateway his router issues me my IP address and I cannot access the internet. When his router is turned off I have no problem, the gateway issues the correct IP address and I can access the internet. I have this problem on all three distros that I use, two of which use Gnome Network Manager and one uses wcid. I have no problem at all with wifi connections just wired. The gateway address is 192.168.1.1 and his router address is 192.168.0.1. I assume there is someway to define a default gateway/route but as yet have not found it. Any help would be much appreciated.


title: Why does set -e not work inside () ||

text: I've run across some scripting like this recently:               ( set -e ; do-stuff; do-more-stuff; ) || echo failed      This looks fine to me, but it does not work! The `set -e` does not apply, when you add the `||`. Without that, it works fine:               $ ( set -e; false; echo passed; ); echo $?     1      However, if I add the `||`, the `set -e` is ignored:               $ ( set -e; false; echo passed; ) || echo failed     passed      Using a real, separate shell works as expected:               $ sh -c 'set -e; false; echo passed;' || echo failed     failed      I've tried this in multiple different shells (bash, dash, ksh93) and all behave the same way, so it's not a bug. Can someone explain this?


title: Captured cursor invisible with Centos 6.4 running on VMWare Player 3.1.6 on Ubuntu 11.4

text: I have a very old (c. 2001) computer and the most recent version of Ubuntu that it can run is 11.4. I am thinking of replacing Ubuntu with Centos 6.5 but am not sure if the hardware can handle it. I am therefore trying to install Centos 6.4 on a virtual machine using VMWare Player 3.1.6. I user VMWare Player to install CentOS-6.5-i386 from an ISO. It appears to run successfully and I get a Centos login dialogue. However, when I click on the login dialogue (or do control-G), the cursor disappears. I tried reinstalling Centos and found that the same thing happens during the installation so I suspect the problem lies with VMWare Player rather than with Centos 6.5. The keyboard also appears to have no effect when the cursor is captured.


title: find doesn't return expected files

text: I'm doing a search for files that contain ".anki" in their file name.               root@t500:/home/some1# find / -name .anki     /home/some1/.anki      But there are other files in my home folder that contain .anki:               all-feb-18-2013.anki     all-mar-10-2013.anki     all-oct-06-2012.anki      Why don't those appear with my search?


title: Find files using ls and wildcards

text: `pwd : ../bin` under bin I have a directory called `datafiles`. Use meta characters and the `ls -lL` command (with lower and upper case L) to list all filenames under the `datafiles` directory that contain a dot `.` with the letter 'f' or 'u' anywhere after the dot. I tried: `ls -lL datafiles *.*f*u`               ls -lL datafiles .[f*u]      * * * Thank you for answering. Unfortunately, none of the solutions worked the way I wanted it. By clarifying the question, `/bin/datafiles/file.backup` is the root to the directory. From the `/bin` directory, the command I used is `ls -lL datafiles` followed by meta characters. I'm looking for `file.backup` that has a dot and followed by `f` or `u`, not directly followed by `f` or `u` (anywhere after the dot), and not ending by `f` or `u`.


title: Cannot Compile Apache: “Error, SSL/TLS libraries were missing or unusable”

text: * Arch Linux 2011.08.19 (Linux 3.4.2 i686)   * Apache 2.2.22 → 2.2.22 (recompile & reinstall)   * OpenSSL 1.0.1.c-1 These details are likely irrelevant, but: I’m using yaourt with customizepkg to build Apache from source every time there’s an upgrade available so I can change the suexec docroot to what I want without manually editing the PKGBUILD myself. In the past this has worked flawlessly; however, it seems that now, for whatever reason, Apache won’t compile. I just did a full system upgrade so that may have something to do with it. Here is the configure line from the modified PKGBUILD:               ../configure --enable-layout=Arch \         --enable-modules=all \         --enable-mods-shared=all \         --enable-so \         --enable-suexec \         --with-suexec-caller=http \         --with-suexec-docroot=/srv/www \         --with-suexec-logfile=/var/log/httpd/suexec.log \         --with-suexec-bin=/usr/sbin/suexec \         --with-suexec-uidmin=99 --with-suexec-gidmin=99 \         --enable-ldap --enable-authnz-ldap \         --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache \         --enable-ssl --with-ssl \         --enable-deflate --enable-cgid \         --enable-proxy --enable-proxy-connect \         --enable-proxy-http --enable-proxy-ftp \         --enable-dbd \         --with-apr=/usr/bin/apr-1-config \         --with-apr-util=/usr/bin/apu-1-config \         --with-pcre=/usr \         --with-mpm=${mpm}      When I try to build though, it seems to run fine until it gets to the OpenSSL stuff:               mkdir modules/ssl     checking whether to enable mod_ssl... checking dependencies     checking for SSL/TLS toolkit base... none     checking for OpenSSL version... checking openssl/opensslv.h usability... yes     checking openssl/opensslv.h presence... yes     checking for openssl/opensslv.h... yes     checking openssl/ssl.h usability... yes     checking openssl/ssl.h presence... yes     checking for openssl/ssl.h... yes     OK       forcing SSL_LIBS to "-lssl -lcrypto  "       adding "-lssl" to LIBS       adding "-lcrypto" to LIBS     checking openssl/engine.h usability... yes     checking openssl/engine.h presence... yes     checking for openssl/engine.h... yes     checking for SSLeay_version... no     checking for SSL_CTX_new... no     checking for ENGINE_init... no     checking for ENGINE_load_builtin_engines... no     checking for SSL_set_cert_store... no     configure: error: ... Error, SSL/TLS libraries were missing or unusable     ==> ERROR: A failure occurred in build().         Aborting...     ==> ERROR: Makepkg was unable to build apache.     ==> Restart building apache ? [y/N]     ==> -------------------------------     ==>       Googling around, many reported the solution being `export LDFLAGS=-ldl`, but this has had no effect for me, whether set in the build script or in my bash profile.


title: Restore using dd will not boot

text: My current HDD is failing and I've backed it up using `dd`. After restoring the images onto a new HDD, also using `dd`, the new system will not boot. It goes through the BIOS initialization, then screen goes black, and restarts and back through BIOS. This is the old HDD setup:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048     1026047      512000   83  Linux     /dev/sda2         1026048   103426047    51200000   83  Linux     /dev/sda3       103426048   113666047     5120000   82  Linux swap / Solaris     /dev/sda4       113666048  1250263039   568298496    5  Extended     /dev/sda5       113668096   523268095   204800000   83  Linux     /dev/sda6       523270144   625670143    51200000   83  Linux     /dev/sda7       625672192  1250263039   312295424   83  Linux      `/dev/sda1` is `/boot` `/dev/sda2` is `/` I have `dd`'ed all these 2 partitions. `/dev/sda7` is `/home` Backed it up using `rdiff-backup`. What am I missing and how could I correct this? _**EDIT 1:_** `fstab`               UUID=80c4cde7-b697-46d5-a376-24a6d6a725af /                       ext4    defaults        1 1     UUID=c1967ecb-839c-45d1-bf5b-bba046af3892 /boot                   ext4    defaults        1 2     UUID=c18998dd-0e60-4945-999f-1296b6e69307 /home                   ext4    defaults        1 2     UUID=78d39426-74d4-4299-b3ba-c9ab27a60e17 /mnt/m                  ext4    defaults        1 2     UUID=53574e4d-8af4-4aeb-bcf5-c74c7bbe4d7c /mnt/p                  ext4    defaults        1 2     UUID=3902f59a-f7a8-4ab8-896d-93642a09f083 swap                    swap    defaults        0 0     tmpfs                   /dev/shm                tmpfs   defaults        0 0     devpts                  /dev/pts                devpts  gid=5,mode=620  0 0     sysfs                   /sys                    sysfs   defaults        0 0     proc                    /proc                   proc    defaults        0 0      _**EDIT 2:_** I ended up `dd`'ing the `MBR` as _DrGlitch_ mentioned in his answer. And also I had to manually modify the `fstab` to match the new partitions' `UUID` as shown by `blkid`.


title: Make all new files in a directory accessible to a group

text: Suppose I have two users A and B and a group G and a folder foo, both users are members of G (using linux and ext3). If I save as user A a file under foo, the permissions are: `-rw-r--r-- A A`. However it is possible to achieve that every file saved under some subdirectory of foo has permissions `-rwxrwx--- A G` (i.e. owner A, group G)?


title: What are the differences between runit and supervisord?

text: I'm looking into changing our Django deployments and was reading the deploy page for gunicorn and it talks about both supervisord which I was aware of and planning on using and runit that I don't recall hearing about before. Why would I pick one over the other? We are running red hat.


title: checking running process

text: I am new babe to Linux. So please skip to read if you are not patient with begineer. Let's say I am asked to check and shut down the processes that I am not familiar with. So when I `ls` under bin folder, I see multiple process `.sh`. But I want to know which process is associated with which tomcat process. Is there any easy way to find out that? **Example** `startmyprocess1.sh`, but when I do `ps -ef | grep startmyprocess1` doesn't return the running process. But actually the running tomcat process name is `myprocess`, so when I do `ps -ef | grep myprocess`, I can see the running process. To know that I have to ask the responsible person. So, the names are different. If like that, I need to ask him several times. Any better way to figure this out?


title: Can sed be used to generate a load file for my date lookup fact table?

text: I have an SQL fact table which is used for looking up a date and returning another date. The table schema is as follows:               TABLE date_lookup        (     pk_date DATE,     plus1_months DATE,     plus2_months DATE,     plus3_months DATE        );          UNIQUE INDEX on date_lookup(pk_date);      I have a load file (pipe delimited) containing dates from 01-28-2012 to 03-31-2014. The following is an example of the load file:               01-28-2012|02-28-2012|03-28-2012|04-28-2012|          01-29-2012|02-29-2012|03-29-2012|04-29-2012|          01-30-2012|02-29-2012|03-30-2012|04-30-2012|          01-31-2012|02-29-2012|03-31-2012|04-30-2012|          ...          03-31-2014|04-30-2014|05-31-2014|06-30-2014|      The rules for this fact table are: If pk_date has more than 28 days in its month and plus1, plus2 or plus3_months only has 28, 29 or 30 days, then let plus1, plus2 or plus3 equal the last day of the following month. My question is: Is it possible to use sed to generate more dates past 03-31-2014 following the above rules for my load file, or should I write a program to accomplish this?


title: How to completely remove Java 6 and install Java/JDK 7 on Linux Mint 13

text: How can I completely remove Java 6 and install Java/JDK 7 on Linux Mint 13?


title: Installing Ubuntu, how do I get it to recognize the Crucial RealSSD C300?

text: I'm building a new rig and got the RealSSD C300 for its supposedly stellar performance, but it is not recognized when I try to install Ubuntu 10.4LTS 64-bit. Is there anything that I can do to get this recognized?


title: Read files in Directory and take diff

text: I have two directories named comp1 and comp2 and both have files named file1 and file2. I need a bash script which read file1 from both the directories and take diff of each file and redirect to some other file. For example. diff comp1/file1 comp2/file1 > file1.diff


title: What's a quick Launcher app which will do auto-complete?

text: > **Possible Duplicate:**   >  Which run dialog I'm a unix noob, looking for a good replacement to Windows 7's start menu (pressing Windows key and typing "Ch" will bring up Chrome). I was told I can just press Alt-F2 to get a launcher, but it's a bit slow, and it doesn't seem to do auto-complete (at least not out of the box)


title: can the "cat" command use multi-processes

text: I need to merge bunch of files in a directory on a unix box that has 8 cores. I am looking for a fast way to merge these files. The cat command uses only one core... is there a way where I can make it use multiple cores for parallel processing.


title: Using different versions of Python

text: **Background** : Since I develop python programs that must run on different python versions, I have installed different versions of python on my computer. I am using FC 13 so it came with python 2.6 pre-installed in `/usr/bin/python2.6` and `/usr/lib/python2.6`. I installed python 2.5 from source, and to keep things neat, I used the `\--prefix=/usr` option, which installed python in `/usr/bin/python2.5` and `/usr/lib/python2.5`. Now, when I run `python` my prompt shows I am using version 2.5. However, I am having some issues with the install. **Package management** : Using easy_install, packages are always installed in `/usr/lib/python2.6/site- packages/`. I downloaded `setuptools` .egg for python 2.5 and tried to install it, but it gives me an error:               /usr/lib/python2.5/site-packages does NOT support .pth files      It seems that python2.5 is not in my PYTHONPATH. I thought the default install would add itself to the PYTHONPATH, but when I write `echo $PYTHONPATH` at promt, I just receive an empty line.


title: how to map users and group with sshfs

text: As you can see below I'm able to map the user from kevcoder00 to kevcoder01 but the group gets mapped to marigold although that group does not exists on kevcoder01               l00py@kevcoder00:~$ sshfs -o idmap=user l00py@kevcoder01:/home/l00py ~/kevcoder01/     l00py@kevcoder01's password:      l00py@kevcoder00:~$ ls -hl kevcoder01/     total 0     -rw-r--r-- 1 l00py marigold 0 Jul  4 00:34 I_LIVE     -rw-r--r-- 1 l00py marigold 0 Jul  4 00:59 I_LIVE_AGAIN      What do I need to do to map both user and group?


title: Is it shell portable to run a command on the same line after variable assignment?

text: Is there any standard that covers the portability of running a command after variable assignment on the same line?               APPLE="cider" echo hi      How portable is something like that? Where will it work and where won't it? Also: my shell scripts start with #!/bin/sh if that makes any difference.


title: How to edit a .gpg file with vi?

text: So I created a gpg encrypted file with password:               gpg -c passwords.txt.gpg      how can I open it with vi, edit it, then close it? (So that no passwords.txt file will be created, the decrypted passwords.txt is only in the memory! - better: after closing the passwords.txt.gpg file, the memory should be cleaned, so it shouldn't contain unencrypted passwords).


title: Why do I need to install -devel packages?

text: I am new to Linux and wonder why many times when I install package with `yum` I need to install `package-devel.i386` rather than `package.i386`. What is the difference between them?


title: ntldr.mod missing from GRUB2

text: I use Debian Wheezy on EFI motherboard and need ntldr module in GRUB2 to load bootmgr of Windows 7 installer, because the way it starts on its own (apparently, using the boot sector of the USB flash drive the installer is on) it only installs Windows on MBR-formatted disk. When I install GRUB using grub-install it won't add ntldr.mod to the GRUB modules folder and can't insmod it.   1. Why? When i only download GRUB package without installation (apt-get download..), the module can be found there. If I add the .mod file from the downloaded package to the installed GRUB's modules folder and then "insmod ntldr" from the GRUB command line, it says sth about wrong "ELF magic" (?).   2. How to do it forcibly?   3. Is there another way to boot the Windows installer in the "GPT-mode", as I don't want to format the whole disk into MBR.


title: How can I run a script during GNOME logout if I don't have admin privileges?

text: I want to run a script before I log out of my GNOME session, to warn myself if I have forgotten a pendrive plugged into the machine. However, all solutions I have found have not been enough for me:   * This similar question suggests editing the `/etc/gdm/PostSession/Default` file, but I don't have the permissions to do that. (And the file is currently empty on my machine, so there are no existing hooks to take advantage off)   * I also found this post suggesting a workaround but, according to the first reply, it does not work if I shutdown the computer instead of only logging off.


title: why is FQDN using external IP address

text: When postfix connects to the FQDN dur.bounceme.net it uses the external IP address:               root@dur:~#      root@dur:~# tail /var/log/mail.log     Aug 28 04:39:45 dur postfix/master[6667]: terminating on signal 15     Aug 28 04:39:46 dur postfix/postfix-script[6781]: starting the Postfix mail system     Aug 28 04:39:46 dur postfix/master[6782]: daemon started -- version 2.9.1, configuration /etc/postfix     Aug 28 04:39:52 dur postfix/smtpd[6786]: connect from localhost[127.0.0.1]     Aug 28 04:40:37 dur postfix/smtpd[6786]: B92B518431A: client=localhost[127.0.0.1]     Aug 28 04:41:21 dur postfix/cleanup[6790]: B92B518431A: message-id=<20120828114037.B92B518431A@dur.bounceme.net>     Aug 28 04:41:22 dur postfix/qmgr[6784]: B92B518431A: from=<routing@dur.bounceme.net>, size=438, nrcpt=1 (queue active)     Aug 28 04:41:23 dur postfix/smtp[6792]: connect to dur.bounceme.net[70.71.113.158]:25: Connection refused     Aug 28 04:41:23 dur postfix/smtp[6792]: B92B518431A: to=<thufir@dur.bounceme.net>, relay=none, delay=62, delays=60/0.02/1.6/0, dsn=4.4.1, status=deferred (connect to dur.bounceme.net[70.71.113.158]:25: Connection refused)     Aug 28 04:41:26 dur postfix/smtpd[6786]: disconnect from localhost[127.0.0.1]     root@dur:~#       What's causing the FQDN to behave this way? Can I, and should I, and how would I, configure dur.bounceme.net to resolve to 127.0.0.1?


title: Where does virt-manager store config files?

text: I checked `~/.libvirt*` and `~/.config/libvirt*`, non of them seem to contain config file of created VM, where is the config stored? I'm not running virt- manager as root user.


title: How to log into network in linux?

text: I am using a custom version of OpenWRT linux that is used as a dev enviroment for a a graphic library. I am using it as a Virtualbox image. The distro contains a proxy module that needs to access the network and be assigned it's own IP. I set the network settings to "Internal Network" and now I am stumped on how to log into my network. The distro is all command line, can anyone tell me how to access the network?


title: Shell script to recursively grep data from certain files in the directory and return values to file

text: I am making a simple shell script which will minimize the time I spend in searching all directories under a parent directory and grep some things inside some files. Here's my script.               #!/bin/sh     MainDir=/var/opt/database/1227-1239/          cd "$MainDir"          for dir in $(ls); do          grep -i "STAGE,te_start_seq Starting" "$dir"/his_file | tail -1 >> /home/xtee/sst-logs.out          if [ -f "$dir"/sysconfig.out];     then         grep -A 1 "Drive Model" "$dir"/sysconfig.out | tail -1 >> /home/xtee/sst-logs.out     else         grep -m 1 "Physical memory size" "$dir"/node0/setupsys.out | tail -1 >> /home/xtee/sst-logs.out     fi          done      The script is supposed to grep the string `STAGE,te_start_seq Starting` under the file `his_file` then dump it `sst-logs.out` which it does. My problem though is the part in the `if` statement. The script should check the current directory for `sysconfig.out`, grep `drive model` and dump it to `sst- logs.out` if it exists, otherwise, change directory to `node0` then grep `physical memory size` from `setupsys.out` and dump it to `sst-logs.out`. My problem is, it seems the `if then else` statement seems not to work as it doesn`t dump any data at all but if i execute grep manually, i do have data. What is wrong with my shell script? Is there any more efficient way in doing this?


title: How do I persistently load a kernel module in Fedora 20?

text: I have successfully followed the instructions for setting up 802.1q VLAN tagging in Fedora. Now I need to make sure that when I reboot the 8021q kernel module is loaded again. Should I be doing this through `/etc/sysconfig/modules` as instructed here or should I be doing this through `/etc/rc.modules` as instructed here? Or is there somewhere else I should be looking?


title: No programs will launch after disconnect from a internet network

text: I'm using Arch Linux + Xfce. When I disconnect from a internet network(WiFi or Wire), no programs will run and gets me following error:               [kamix@localhost ~]$ gedit     No protocol specified          ** (gedit:5064): WARNING **: Could not open X display     No protocol specified     Unable to init server: Could not connect: Connection refused          (gedit:5064): Gtk-WARNING **: cannot open display: :0.0


title: Other than via configuration in /etc/yum.repos.d, where else can a repository be configured?

text: Helping out someone who inherited his environment. He wants to disable some repositories. This is an anonymized output of his `yum repolist`:               luke@server1 $ sudo yum repolist     Loaded plugins: rhnplugin, security     This system is receiving updates from RHN Classic or RHN Satellite.     repo id                        repo name                                                 status     acme-rhel-x86-64-server-5      ACME Packages (v.5 for 64-bit)                                 1     epel                           Extra Packages for Enterprise Linux 5 - x86_64             7,745     rhel-x86_64-server-5           Red Hat Enterprise Linux (v. 5 for 64-bit x86_64)         16,133     rhn-tools-rhel-x86_64-server-5 Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)    564     repolist: 24,443      However, doing the following yields no results:               luke@server1 $ grep -ri acme /etc/yum.repos.d /etc/yum/pluginconf.d


title: Bash script for opening screens and compiling the same file

text: I have written a bash script to initiate separate screen sessions and run a command in each of them that compiles the same `C++` source file in `ROOT` (an object-oriented data analysis framework http://root.cern.ch/drupal/content/about) in every screen session. It worked fine at the beginning; however as the compilation time increased(as an observation) it failed to compile and numerous errors were produced. The error message inside the text file is below:               Info in <TUnixSystem::ACLiC>: creating shared library /DIRECTORY/./readerSummerStd_C.so     ACLiC:0: RuntimeWarning: Failed to generate the dependency file for /DIRECTORY/./readerSummerStd_C.so     Note: Link requested for already precompiled class map<string,int,less<string>,allocator<pair<const string,int> > > (ignore this message) :0:     g++: /DIRECTORY/readerSummerStd_C_ACLiC_dict.o: No such file or directory     Error in <ACLiC>: Compilation failed!     Traceback (most recent call last):       File "./NEWrunReader.py", line 87, in <module>         from ROOT import readerSummerStd as reader     ImportError: cannot import name readerSummerStd      The analysis zsh script is provided below for reference, if I wait for one code to compile and then run the other code no problem occurs. How can I circumvent this problem?                   #! /bin/zsh         ### Script for running everything in screens ###         echo You have the following screens running:         screen -ls         echo Press any key to proceed. NOTE THAT YOUR OTHER SCREENS WILL GET KILLED!         read         pkill -15 -U arisevon screen ## We make sure that no screens are running for now         bkgarr=(TopJets BosonJets DiBoson TTbar)         sigarr=(NM1 NM2 NM3 Scenario4 Scenario6)         puarr=(50PU 140PU)         lumarr=(30 300 3000)              echo Please type 1 for 50PU samples and 2 for 140PU samples         read PU         if [[ $PU -ne 1 && $PU -ne 2 ]] ; then             echo You have to enter 1 or 2             return 1         fi              echo Please type 1 for 300fb-1 and 2 for 3000fb-1         read lum              if [[ $lum -ne 1 && $lum -ne 2 ]] ; then             echo You have to enter 1 or 2             return 1         fi              if [ $PU = 1 ]; then             let "lum = $lum + 1"             #echo $lum         fi              ex NEWrunReader.py  <<EOEX           :43s/Lumi.*/Lumi=$lumarr[lum]/           :x         EOEX              echo Press any key to proceed or Ctrl+C to abort!         read         for index in $bkgarr         do             screen -dmS $index             screen -S $index -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'             screen -S $index -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$index >& $index.txt &"$'\r'         done         for sigind in $sigarr         do             screen -dmS $sigind             screen -S $sigind -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'             screen -S $sigind -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$sigind >& $sigind.txt &"$'\r'         done         return 0      These codes are for performing an analysis in high energy physics and I am really curious as this script worked flawlessly before. The only difference is that there is that the C++ source code got more complex than before. The Python code is as follows:               #!/usr/bin/python               import sys     from ROOT import gROOT          # scenarios and samples     scenarios = ['NoPU','50PU','140PU']     #scenarios = ['140PU']     ########################################################     # FOR THE PAPER (SNOWMASS)     #samples   = ['DiBoson','BosonJets','TopJets','TTbar','TDR4','TDR5','TDR6','TDR8','naturalSUSY']     ########################################################     #samples   = ['TTbar']     # by historic reason we have as dir names: bjets  diboson  tdr tdrNew tjets  ttbar for snowmass     # by historic reason we have as dir names: bjets  diboson  tdr        tjets  ttbar for snowmass2     #for (ecfa) PhaseII_C3 / C4v2     ########################################################     #samples w.o weight (snowmass)     #noWeight  = ['TDR4','TDR5','TDR6','TDR8','naturalSUSY']          # nTuple input path     #########################################################     # for susyhit     samples   = ['DiBoson','BosonJets','TopJets','TTbar','NM1','NM2','NM3','Scenario6','Scenario4','Scenario1']     noWeight  = ['NM1','NM2','NM3','Scenario6','Scenario4','Scenario1']     base = '/nfs/dust/cms/user/safarzad/Output/EOSforFutureStudies/14TeV/PhaseII/Configuration4v2/140PileUp'     #########################################################     # for naturalSUSY     #base = 'nTuples/ECFA/PhaseII_C3'     #base = 'nTuples/ECFA/PhaseII_C4'     #########################################################     # FOR THE PAPER (SNOWMASS)     #base = 'nTuples/snowmass2'     #########################################################     # for PhaseII_C3 & PhaseII_C4v2 (ecfa) #################  !!!!!!!!! #####################     #base = 'Output/ECFA/PhaseII_C3' #### noch per Hand aendern, besser in scenarios C3, C4 beruecksichtigen! ####     #base = 'Output/ECFA/PhaseII_C4v2'     #base = 'Output/14TeV/'     #     #     # lumi in fb^-1     Lumi=30               def help():         print 'First argument analysis:'         print '   SingleS'         print ' then a list of inputs - read the code'         sys.exit(0)          from operator import mul     def scale(fac,list):         return map(mul,len(list)*[fac],list)          # choose the analysis and a sample     if len(sys.argv)>1:         if sys.argv[1]=='SingleS':       # single lepton  stop - CMS             gROOT.LoadMacro('readerSingleS.C+')             from ROOT import readerSingleS as reader         if sys.argv[1]=='Claudia_task':       # single lepton  stop - CMS             gROOT.LoadMacro('readerClaudia_task.C+')             from ROOT import readerClaudia_task as reader         elif sys.argv[1]=='Skeleton':  # SKELETON             gROOT.LoadMacro('readerSkeleton.C+')             from ROOT import readerSkeleton as reader         elif sys.argv[1]=='SingleSOld':  # single lepton testing version              gROOT.LoadMacro('readerSingleSOld.C+')             from ROOT import readerSingleSOld as reader         elif sys.argv[1]=='SingleS_P':  # single lepton testing version              gROOT.LoadMacro('readerSingleS_P.C+')             from ROOT import readerSingleS_P as reader         elif sys.argv[1]=='SingleSDelphMET':  # single lepton testing version              gROOT.LoadMacro('readerSingleSDelphMET.C+')             from ROOT import readerSingleSDelphMET as reader         elif sys.argv[1]=='EWKino':  # EWKino             gROOT.LoadMacro('readerEWKino.C+') # used to be EWKinoNew             from ROOT import readerEWKino as reader         elif sys.argv[1]=='AtlasH_Sb':  # Exc             gROOT.LoadMacro('readerAtlasH_Sb.C+') # used to be EXc             from ROOT import readerAtlasH_Sb as reader         elif sys.argv[1]=='AtlasH':  # Atlas hadronic             gROOT.LoadMacro('readerAtlasH.C+') # used to be ?????             from ROOT import readerAtlasH as reader         elif sys.argv[1]=='SummerStd':  #             gROOT.LoadMacro('readerSummerStd.C+') # used to be ?????             from ROOT import readerSummerStd as reader         else:              help()     else:          help()               #prepare empty dictionaries     do={}     for scene in scenarios:         do[scene]={}         for samp in samples:             do[scene][samp] = 0     # read input line and set flags what to process     flag=False     for e in sys.argv:         for scene in scenarios:             for samp in samples:                 if e==scene+'_'+samp:                      do[scene][samp] = 1                     if scene=='140PU': Lumi=Lumi*10  # lumi*10 for 140PU                     flag=True     if not flag: help()               # prepare empty dictionaries     dirsHT={}     inDir={}     weights={}     for scene in scenarios:         inDir[scene]={}     #   weights[scene]={}               ### for PhaseII_C3 / C4v2 ((from ecfa)) ONLY TTbar                    #--------------------------------------------- sample properties for processing <<<<<<<<<<<<<<<<<<<<<<<<<<<     #                                               I:  HT dirs, xsecs --> 33TeV     #                                              II:  HT dirs, xsecs --> 14TeV     #------------------------------------------------ diboson     # HT dirs      #I:dirsHT['DiBoson']  = ['0-400/','400-1000/','1000-2000/','2000-3400/','3400-100000/']     dirsHT['DiBoson']  = ['0-300/','300-700/','700-1300/','1300-2100/','2100-100000/']     #    xsec     #I:weights['DiBoson'] = [776.00399, 106.85023, 10.16835, 0.86136, 0.09507]     weights['DiBoson'] = [249.97710, 35.23062, 4.13743, 0.41702, 0.04770]     #    multiply all by lumi     weights['DiBoson'] = scale(Lumi,weights['DiBoson'])     #     # NoPU     inDir['NoPU']['DiBoson']  = base+'/NoPU/diboson/'     # 50PU     inDir['50PU']['DiBoson']  = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/diboson/'      # 140PU     #inDir['140PU']['DiBoson'] = base+'/diboson/'          inDir['140PU']['DiBoson'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/1st_Output/PhaseII_140PU_ProdJul28/diboson/'     #'/140PU/diboson/'     #     #------------------------------------------------ boson+jets     # HT dirs      #I:dirsHT['BosonJets']  = ['0-400/','400-1000/','1000-1800/','1800-3000/','3000-4600/','4600-6600/','6600-100000/']     dirsHT['BosonJets']  = ['0-300/','300-600/','600-1100/','1100-1800/','1800-2700/','2700-3700/','3700-100000/']     #    xsec     #I:weights['BosonJets'] = [129824.79383, 6598.37529, 325.55814, 32.45249, 3.16778, 0.32737, 0.04045]     weights['BosonJets'] = [34409.92339, 2642.85309, 294.12311, 25.95000, 2.42111, 0.22690, 0.02767]     #    multiply all by lumi     weights['BosonJets'] = scale(Lumi,weights['BosonJets'])     #     # NoPU     inDir['NoPU']['BosonJets']  = base+'/NoPU/bjets/'     # 50PU     inDir['50PU']['BosonJets']  = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/bjets/'      # 140PU     inDir['140PU']['BosonJets'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/bjets/'     #inDir['140PU']['BosonJets'] ='/nfs/dust/cms/user/safarzad/Output/EOSforFutureStudies/14TeV/PhaseII/Configuration4v2/140PileUp/bjets/'     #inDir['140PU']['BosonJets'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Output/delphes/ProdJun14/bjets/'     #base+'/bjets/'     #'/140PU/bjets/'     #     #---------------------------------------------- ttbar     # HT dirs      #I:dirsHT['TTbar']  = ['0-600/','600-1200/','1200-2000/','2000-3200/','3200-4800/','4800-100000/']     dirsHT['TTbar']  = ['0-600/','600-1100/','1100-1700/','1700-2500/','2500-100000/']     #    xsec     #I:weights['TTbar'] = [3438.70635, 505.82210, 61.81892, 7.65752, 0.72643, 0.07147]     weights['TTbar'] = [530.89358, 42.55351, 4.48209, 0.52795, 0.05449]     #    multiply all by lumi     weights['TTbar'] = scale(Lumi,weights['TTbar'])     #     # NoPU     inDir['NoPU']['TTbar']  = base+'/NoPU/ttbar/'     # 50PU     inDir['50PU']['TTbar']  = '/nfs/dust/cms/user/clseitz/Delphes/FILES/PhaseI_50PU_ProdAug6/ttbar/'      # 140PU     inDir['140PU']['TTbar'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/ttbar/'     #inDir['140PU']['TTbar'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Output/delphes/ProdJun14/ttbar/'     #inDir['140PU']['TTbar'] = base+'/ttbar/'     #'/140PU/ttbar/'     #     #--------------------------------------------- tjets     # HT dirs      #I:dirsHT['TopJets']  = ['0-600/','600-1200/','1200-2200/','2200-3600/','3600-100000/']     dirsHT['TopJets']  = ['0-500/','500-1000/','1000-1600/','1600-2400/','2400-100000/']     #    xsec     #I:weights['TopJets'] = [493.50469, 23.51848, 1.97369, 0.13199, 0.01099]     weights['TopJets'] = [109.73602, 5.99325, 0.37680, 0.03462, 0.00312]     #    multiply all by lumi     weights['TopJets'] = scale(Lumi,weights['TopJets'])     #     # NoPU     inDir['NoPU']['TopJets']  = base+'/NoPU/tjets/'     # 50PU     inDir['50PU']['TopJets']  = '/nfs/dust/cms/user/clseitz/Delphes/FILES/PhaseI_50PU_ProdAug6/tjets/'      # 140PU     inDir['140PU']['TopJets'] = '/afs/desy.de/user/t/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/PhaseII_140PU_ProdJul28/tjets/'     #inDir['140PU']['TopJets'] = base+'/tjets/'     #'/140PU/tjets/'     #---------------------------------------------STCs     # HT dirs - none for STC samples     #dirsHT['TDR4'] = ['/']     #dirsHT['TDR5'] = ['/']     #dirsHT['TDR6'] = ['/']     #dirsHT['TDR8'] = ['/']     # naturalSUSY     #dirsHT['naturalSUSY'] = ['/']     # susyhit     dirsHT['Scenario1'] = ['/']     dirsHT['Scenario4'] = ['/']     dirsHT['Scenario6'] = ['/']     dirsHT['NM1'] = ['/']     dirsHT['NM2'] = ['/']     dirsHT['NM3'] = ['/']          # xsec - we multiply by lumi   xsec*k-factor*Lumi calculated with parse.py: values for 33 TeV with 140 Pile Up     # 33TeV      #weights['TDR4'] = [68.31*1.3626*Lumi]    # values for ? 14 TeV      #12.80      #weights['TDR5'] = [19.08*1.4105*Lumi]                               # 3.82     #weights['TDR6'] = [10.87*1.4438*Lumi]                               # 2.53     #weights['TDR8'] = [ 7.777*1.4917*Lumi]                              # 2.19     # 14TeV ####### wrong ##########     #weights['TDR4'] = [9.060*1.3626*Lumi]      # values for ? 14 TeV     #12.80      #weights['TDR5'] = [4.299*1.4105*Lumi]                                # 3.82     #weights['TDR6'] = [2.039*1.4438*Lumi]                                # 2.53     #weights['TDR8'] = [1.788*1.4917*Lumi]                                # 2.19     # 14TeV     weights['TDR4'] = [12.80*Lumi]      weights['TDR5'] = [3.82*Lumi]       weights['TDR6'] = [2.53*Lumi]       weights['TDR8'] = [2.19*Lumi]     weights['naturalSUSY'] = [1.211*Lumi]     # susyhit     weights['Scenario1'] = [2.52*Lumi]     weights['Scenario4'] = [0.009635*Lumi]      weights['Scenario6'] = [2.52*Lumi]      #weights['Scenario6'] = [2.19*Lumi]      weights['NM1'] = [0.15*Lumi]      weights['NM2'] = [0.07*Lumi]      weights['NM3'] = [1.1*Lumi]      #     bit=''     if base=='nTuples/snowmass/':bit='New'      # NoPU     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr/'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr/'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr/'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr/'+bit+'/8/'     # 50PU     #inDir['50PU']['TDR4'] = base+'/50PU/tdr/'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr/'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr/'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr/'+bit+'/8/'     # 140PU     #inDir['140PU']['TDR4'] = base+'/140PU/tdr/'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr/'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr/'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr/'+bit+'/8/'     #     ############## susyhit ############################     #inDir['140PU']['Scenario1'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/STC_Third/'     inDir['140PU']['Scenario4'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseII_140PU_ProdJul28/Ntuple/STOC'     inDir['140PU']['Scenario6'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/stc/READY/'     inDir['140PU']['NM1'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/1/READY/'     inDir['140PU']['NM2'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/2/READY/'     inDir['140PU']['NM3'] = '/nfs/dust/cms/user/trippk/dust/AN_PAS_TP/DELPHES/nTUPLER/batch/Output/naturalModel/3/READY/'          inDir['50PU']['NM1'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM1/'     inDir['50PU']['NM2'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM2/'     inDir['50PU']['NM3'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/NM3/'     inDir['50PU']['Scenario4'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/STOC/'      inDir['50PU']['Scenario6'] = '/afs/desy.de/user/s/safarzad/dust/Output/delphes/PhaseI_50PU_ProdAug6/STC/'     #inDir['140PU']['Scenario6'] = '/afs/desy.de/user/t/trippk/dust/snowmass/NewTupler_topness/Batch/Output/14TeV/140PU/tdr_delphes3.0.9.1_card3.0.9.1/8'     #inDir['140PU']['NM1'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM1/'     #inDir['140PU']['NM2'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM2/'     #inDir['140PU']['NM3'] = '/nfs/dust/cms/user/safarzad/Delphes/nTupler_topness/Batch/Ntuple/NM3/'     ####################################################     ################# naturalSUSY ######################     ####################################################     # 140PU     #inDir['140PU']['naturalSUSY'] = 'Output/naturalSUSY/14TeV/140PU/PhaseII_conf3/'     #inDir['140PU']['naturalSUSY'] = 'Output/naturalSUSY/14TeV/140PU/PhaseII_conf4/'     #     # NoPU 3.0.10     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     #3.0.10 - 3.0.9.1     #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     #3.0.9.1      #inDir['NoPU']['TDR4'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['NoPU']['TDR5'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['NoPU']['TDR6'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['NoPU']['TDR8'] = base+'/NoPU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #     #     # 50PU 3.0.10     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     # 50PU 3.0.10 - 3.0.9.1     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     # 50PU 3.0.9.1     #inDir['50PU']['TDR4'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['50PU']['TDR5'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['50PU']['TDR6'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['50PU']['TDR8'] = base+'/50PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #     #     # 140PU 3.0.10     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.10_card3.0.10'+bit+'/8/'     # 140PU 3.0.10 - 3.0.9.1     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.10_card3.0.9.1'+bit+'/8/'     # 140PU 3.0.9.1     #print  base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR4'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/4/'     #inDir['140PU']['TDR5'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/5/'     #inDir['140PU']['TDR6'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/6/'     #inDir['140PU']['TDR8'] = base+'/140PU/tdr_delphes3.0.9.1_card3.0.9.1'+bit+'/8/'     #--------------------------------------------- end of sample properties          from ROOT import TFile     from glob import glob     from sys import exit     def GetEntries(dirname):         files = glob(dirname+'/*nTuple.root')         if len(files)>1:             print 'GetEntries: there is more than 1 root file in '+dirname             exit(0)         print dirname,files         file=TFile(files[0])         tree = file.Get("delphTree")         return tree.GetEntries()          # do it     for scene in scenarios:         for samp in samples:             if do[scene][samp]:                  f=''                 print dirsHT, samp                 for i in range(len(dirsHT[samp])):                     entries = GetEntries(inDir[scene][samp]+dirsHT[samp][i])                     f=f+inDir[scene][samp]+dirsHT[samp][i]+' '+str(weights[samp][i]/entries)+' '                 print f,samp,scene                 if samp in noWeight:                     reader(f,scene+'_'+samp,False)                 else:                        reader(f,scene+'_'+samp)


title: Have netstat not display port numbers for foreign address

text: I would like to get netstat to not display port numbers on the foreign address so I can run some statistics on it. This is for a FreeBSD system. The following is a example of the output.               <root>:/# netstat -an | grep .80 |head     tcp4       0      0  61.129.65.176.80      123.120.207.172.51972   ESTABLISHED     tcp4     491      0  61.129.65.176.80      171.250.180.211.51000  ESTABLISHED     tcp4     286      0  61.129.65.176.80      123.120.207.17210399     ESTABLISHED     tcp4     299      0  61.129.65.176.80      211.8.128.46.35458    ESTABLISHED     tcp4       0      0  61.129.65.176.80      123.139.147.112.62778    ESTABLISHED     tcp4     361      0  61.129.65.176.80      239.187.139.47.17607  ESTABLISHED     tcp4     509      0  61.129.65.176.80      74.74.87.36.7822   ESTABLISHED     tcp4     324      0  61.129.65.176.80      75.30.126.198.60721     ESTABLISHED     tcp4     508      0  61.129.65.176.80      149.78.116.66.12120   ESTABLISHED     tcp4     321      0  61.129.65.176.80      48.150.75.171.2617     ESTABLISHED     <root>:/#


title: Disable changelogs

text: I'm using Synaptic (and occasionally `aptitude` via ssh) under Debian. When upgrading packages, there is the extremely annoying behavior of scanning changelogs, which can take a minute or two when there are lots of updates, and displaying them. The time spent scanning the changelogs is not the critical factor, but the fact that the upgrade process blocks until I acknowledge that I have read information that I _do not read_ , and _do not want to read_. I want to tell the computer "go ahead, upgrade", go to lunch, and come back an hour later, and should be done. If some package is so broken that it is already known not to work, it should not install in the first place, I'd rather stay with the one that works (one would hope that packagers are are smart enough for this). And otherwise, I'm _really_ not interested in whatever they have to say. Is there a configuration switch (preferrably globally, within `apt`) to disable changelogs once and forall, and maybe an option that does not consider upgrade packages which break?


title: How to disable window decorations in Cinnamon

text: I'm using Cinnamon, but would like to remove all window decorations -- I never use them, they only cost screen estate, and moving / resizing can be conveniently done with alt-mouse1 and alt-mouse2. Is there a way to achieve this? EDIT: Clarification. I am using Ubuntu 12.04 with a custom ppa providing Cinnamon. I switched from the default Unity/Compiz combo because Compiz in 12.04 is a painful regression, plagued by bugs, compared to the 10.04 version (see for example this bug). I got impatient waiting for correction of this and other bugs. I achieved the desired effect previously and on my 10.04 workstation with Compiz. However, as I understand it, Cinnamon is using libmuffin, and not Compiz (correct me if I'm wrong). I am quite happy with the Cinnamon interface, in especially as the effect I got used to (equivalent to the "scale" plugin in Compiz) works without glitches. Also, I would not like to change the distribution, as I got used to Ubuntu and was very happy with the 10.04 LTS. Getting rid of window decorations is the only thing that is still missing.


title: Any LiveCD or LiveDVD Distro whith multi session burning onto LiveMedia

text: I'm looking for any Distro or LiveLinux for CD/DVD (NOT usb/SD card usage) which does the following: 1) All changes to the filesystem are written to the RAM disk with an overlaid filesystem. 2) Upon shutdown, one inserts the booting media again and the overlay is burned as a new session in the multi-session dvd/cd. Puppy Linux does exactly that, and this feature is VERY GREAT. however, as excellent as Puppy is, it follows a minimalistic approach, focusing on old hardware on small programs, and Puppy does very little automatic configuration but provides configuration tools for all kind of setup. I am looking for a more modern distro which offers a decent desktop environment, xfce or, even better, a full blown Gnome would be perfect, but more important is to have standard programs users are familiar with (firefox, openoffice, pidgin etc). The ubuntu livecd would be perfect for that, fits onto 700mb and brings all what is needed IMHO. Puppy Linux copies over all disc content to RAM so you can remove the media after booting. The distro that I am looking for will be much bigger in space, so it would be better if the system is not copied to leave enough RAM to the applications. Any suggestions greatly appreciated! Disclaimer why USB/Sdcard solutions are not feasible for my purpose:   1. Lots of machines which are not that old are still unable to boot from usb or SD card 2) I want a larger amount of discs to be created, an empty dvd disc can be obtained from below 35 cents and stores 4.7gig, any 4GB or even 2GB usb media will be lots more expensive in larger quantities


title: VirtualBox: mount a shared folder automatically in Gentoo

text: I'm currently writing a template (in veewee) to build a vagrant box running Funtoo x86_64. Currently, my box fails the last step for `vagrant basebox validate`, in which a shared folder has to be mounted automatically in the guest system. What are the prerequisites for automounting of shared folders? I searched for it in the documentation for Gentoo and for VirtualBox, had a look at templates for Ubunto boxes - but still don't know how to replicate the automounting behavior of the default Ubuntu box. I'm using genkernel with the gentoo-sources. The virtualbox-guest-additions are installed and the virtualbox daemon is started. I'd love an answer containing these requirements (with some of my best guesses):   * Kernel config (NFS v3/4, automounter, ...?)   * Userspace programs (do I need additional packages? which daemons in which runlevel?)   * Directories and permissions (do I need a `/media` dir belonging to some user, do certain users like `vagrant` and `root` need a membership in the `vboxguest` group or a `vboxsf` group - which does not exist yet?) but any kind of help would be great - even a single link or a hunch... **UPDATE:** What I did so far...   I _can_ mount shared folders manually, what I'm interested in is automatic mounting. The VirtualBox website mentions a group `vboxsf` that should be created on installation of the additions - I don't see that group in `/etc/group`, I have `vboxguest`, though. It also says that shared folders are mounted under `/media` with a prefix of `sf_` (controllable by `/VirtualBox/GuestAdd/SharedFolders/MountDir` and `/VirtualBox/GuestAdd/SharedFolders/MountPrefix`). I don't have a `/media` directory either - and both properties were not set on my VM. I created both the directory and the group and set the properties to their default values, but I'm still out of luck.


title: How to dual boot Linux and Windows from small boot drive?

text: I am a Linux newbie, and I am trying to dual boot Linux Mint with Windows 7. Right now, Windows 7 boots from a small SSD, which has little extra room on it. Is there a way to set up a dual boot where I can put my Linux files on my larger HDD, without completely redoing my drives? For example, could I put the bootloader on the SSD and have it load an OS on the HDD? How would I do this?


title: Touchpad does not work anymore. How to reenable?

text: I dont know what I did and if it was my fault. But for two days my touchpad does not work anymore. Google does not help me. Fact that may help:   * I have no xorg.conf.   * Ubuntu system settings (gnome-control-center) dont show the mousepad.   * gconf-tool says touchpad is enabled.   * xinput list says touchpad is enabled. (SynPS/2 Synaptics TouchPad)   * In Windows it works so no hardware problem here.   * I use awesome, but in unity it does not work too.   * New: Tap for a mouseclick click works!! I dont know if I had an xorg.conf before. So I cant tell if it would be of use. Awesome WM worked with the pad before. But I read something about lightdm-session or gnome-session-manager disabling the pad. These are two tools I played around with because awesome starts none of them. Any approaches to solve this? _EDIT:_ Omg, I am sorry for the people coming across here an reading the following, because I encountered the same situation a lot in the last two days. **My pad works again. And I dont know why!!!!** I am sorry that I dont have the time to dig deeper. Thanks for all the help. One tip I can give the readers: I guess it was the driver that apparently was not started, because in the time the pad did not work I could not start synclient.


title: Read snort.u2 files

text: I am just getting started with learning and testing snort. I have some snort data in snort.u2. _timestamp_ files. What is the best way to view / read these files? I have found some info via Google search but it discusses how to capture traffic using snort, parse it using barnyard2 and then load it into a mysql database. I can't find anything clear on how to read existing snort.u2 files. Also, I should mention that I have a barnyard2.waldo file along with the snort.u2. _timestamp_ files. Not sure where this file comes in. Also, is it possible to view snort.u2 files on Windows? It would be convient, but not a big deal if it is not possible.


title: ifconfig + FAILED from ifconfig on solaris machines

text: please advice - what the meaning of FAILED word from ifconfig command   1. Dose its mean that network from NIC isn't stable until this moment ?   2. Not clearly if ifconfig read network status each some mili seconds?, I mean if network is stable so ifconfig should return the FAILED status to OK ?  yael                ifconfig -a             lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1            inet 127.0.0.1 netmask ff000000          e1000g0: flags=19000802<BROADCAST,MULTICAST,IPv4,NOFAILOVER,FAILED> mtu 0 index 2              inet 0.0.0.0 netmask 0               groupname Mgmt_ipmp              ether 0:21:28:58:ff:6          e1000g1: flags=11000803<UP,BROADCAST,MULTICAST,IPv4,FAILED> mtu 1500 index 3               inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255               groupname Mgmt_ipmp               ether 0:21:28:58:ff:7


title: pmount - omit rules in fstab

text: How use pmount that it omit fstab rules? For example               # fstab:     /dev/sr0 /media/cdrom  ... (etc.)          # in terminal     pmount /dev/sr0 /media/xxx     # it will omit /media/xxx mount point and it will mount in /media/cdrom      Is there any easily solution to mount other mount point that is in fstab. In this case I must use pmount beacause I mount as regular user and I am not allowed to add any new entry to fstab.


title: ZSH: What's the difference between `.` and `source`?

text: I used to think that the built-ins `.` and `source` are equivalent. This question agrees with me when it comes to `bash`. However I encountered the following using `zsh`:               desktop➜  ~/pst  . env     /usr/bin/env:1: no such file or directory:  ^@^A^@^@^@X^Z@^@^@^@^@^@@^@^@^@^@^@^@^@\M-8q^@^@^@^@^@^@^@^@^@^@@^@8^@     /usr/bin/env:2: parse error near `)'     desktop➜  ~/pst  source env     desktop➜  ~/pst  file env     env: ASCII text      `source` did what I expected, but what's `.` trying to do?


title: Grub-EFI: disable signature check?

text: Following on from my previous question, it seems that Grub-EFI refuses to boot any kernel which isn't signed. Which is a problem, because the kernel I want to boot isn't signed. So what I'm wondering is... Is there any configuration option to switch this check off?


How to maximize the use of computer performance Core i7 960 / 12GB Ram?. My operating system is Debian 6 (Linux kernel - 3.0.0-1-amd64). I think it does not work very quickly. Looking for some ways to increase productivity, may be that the system is loaded into memory at once, then it will be faster? It may be necessary to use some features of the processor? In general, I need advice.


title: How to make apt-get accept new config files in an unattended install of debian from Repo

text: I am writing a script for a unattended install of a package that is in our repo, it is a software package with one of Debian's marked config files. Is there any option that I can pass to `apt-get`/`aptitude` so that it accepts the new config files? Basically I need an `apt`/`aptitude` equivalent of `dpkg --force-confnew` I need to answer the following question posed while `apt-get` is installing with a Y * * * Configuration file ``/opt/application/conf/XXX.conf`'               ==> File on system created by you or by a script.     ==> File also in package provided by package maintainer.          What would you like to do about it ?  Your options are:     Y or I  : install the package maintainer's version     N or O  : keep your currently-installed version       D     : show the differences between the versions       Z     : background this process to examine the           The default action is to keep your current version.      * * * Additional Info: Also,I am passing the `sudo` password in a pipe to execute the command               echo "mysudopass"|sudo -S apt-get mypackage      This is flagging an error in installation when the installation is at the config interactive phase. I am on Ubuntu 10.04   apt version: apt 0.7.25.3 **Why I cannot use`dpkg`: These Debians are to be installed from Repo and I dont have local Debians on my machine** Thanks Guys for your Help in advance !!!!


title: Launching applications from a terminal with specific window size and location

text: I am running Linux Mint 13, with a KDE 4 desktop manager. I would like to launch applications from a terminal (`konsole` in my specific case) and setting the exact size of the window and the location of the window. As an example, if I launch `Kate` and `Chromium` from a terminal, I want Kate's window the cover the left-half of my screen and I want Chromium to cover the upper-right quarter of my screen. How can I accomplish this? ps: I have a 15.6" screen set to a 1920x1080 resolution.


title: ATOP shows red line vmcom and vmlim. What does it mean?

text: utility atop shows:               ATOP - MyServer         2013/01/07  00:03:57               10 seconds elapsed     PRC | sys   2.18s | user   8.33s | #proc    141 | #zombie    0 | #exit      0 |     CPU | sys     21% | user    139% | irq       0% | idle    228% | wait     11% |     cpu | sys      5% | user     40% | irq       0% | idle     51% | cpu002 w  3% |     cpu | sys      5% | user     35% | irq       0% | idle     56% | cpu001 w  3% |     cpu | sys      7% | user     30% | irq       0% | idle     61% | cpu000 w  2% |     cpu | sys      4% | user     34% | irq       0% | idle     61% | cpu003 w  1% |     CPL | avg1   1.00 | avg5    1.12 | avg15   1.25 | csw   389208 | intr  223367 |     MEM | tot   23.6G | free  136.3M | cache   6.7G | buff   66.5M | slab  205.1M |     SWP | tot    0.0M | free    0.0M |              | vmcom  21.8G | vmlim  11.8G |     DSK |         sdc | busy     12% | read      70 | write    109 | avio    6 ms |     DSK |         sde | busy      4% | read      37 | write    131 | avio    2 ms |     DSK |         sdd | busy      3% | read      38 | write    144 | avio    1 ms |     NET | transport   | tcpi     160 | tcpo     171 | udpi       0 | udpo       0 |     NET | network     | ipi      188 | ipo      172 | ipfrw      0 | deliv    160 |     NET | vnet1    0% | pcki     510 | pcko     442 | si   60 Kbps | so   26 Kbps |     NET | eth0     0% | pcki     449 | pcko     527 | si   27 Kbps | so   65 Kbps |     NET | vnet0    0% | pcki       0 | pcko      44 | si    0 Kbps | so    3 Kbps |     NET | vnet7    0% | pcki       1 | pcko      44 | si    0 Kbps | so    3 Kbps |     NET | vnet2    0% | pcki       0 | pcko      43 | si    0 Kbps | so    3 Kbps |     NET | vnet3    0% | pcki       0 | pcko      43 | si    0 Kbps | so    3 Kbps |     NET | vnet6    0% | pcki       0 | pcko      43 | si    0 Kbps | so    3 Kbps |     NET | vnet5    0% | pcki       0 | pcko       5 | si    0 Kbps | so    0 Kbps |     NET | vnet4    0% | pcki       0 | pcko       5 | si    0 Kbps | so    0 Kbps |     NET | vnet8    0% | pcki       0 | pcko       5 | si    0 Kbps | so    0 Kbps |     NET | bond0  ---- | pcki     449 | pcko     527 | si   27 Kbps | so   65 Kbps |     NET | br0    ---- | pcki     157 | pcko     126 | si   12 Kbps | so   17 Kbps |     NET | lo     ---- | pcki      46 | pcko      46 | si    3 Kbps | so    3 Kbps |      My questions are following: 1)All is white, only line with SWP is RED. I have 24GB RAM and I don't use swap. How may I fix this? Is it big problem? I'm working on without problems, but who knows if is it bad or not? 2)What does vmcom and vmlim means? CPU is Quad core. 3HDDs in RAID5. I have Debian Squeeze x64 and using KVM and MySQL. Thank you for answer


title: Windows losing focus on Gnome on Fedora 17

text: I have a problem using Gnome on Fedora 17 where, after a period of time, I cannot regain focus on any windows; that is, I can only see the desktop screen. If I Alt-Tab I can see the other windows, but if I try to switch to them it immediately goes back to desktop. My usual solution is to log out and log back in, which fixes the problem. Any advice? _Edit_ : Ctrl-Alt-Left/Right does not do anything. If I do Crtl-Alt-Up/Down to move to another desktop it still does the same thing. _Edit 2_ : I can now replicate the problem, and it always occurs when Alt- Tabbing. I've disabled the "Coverflow Alt-Tab" extension; if I don't get it again, I guess there is a bug in this extension


title: How to enable 'daw' vi command in zsh?

text: I've seen that the vi mode option in zsh is rather limited. For example, 'daw' (delete around word) and 'diw' don't work. What is the reason and how can I solve it?


title: Writing a "telnet server" type program that uses SSH instead of telnet

text: So people have written server programs using telnet in which the user simply does `telnet server.com` and this connects them to the server program, which then provides them with a textual program they can use over the net (like a MUD). There are some here, for example: http://www.telnet.org/htm/places.htm I wanted to write a server program like that, but I want it to have security against evesdropping and MITM attacks that SSH offers. So is it possible to write a program in which the user can do this on a linux machine `ssh server.com` or maybe this `ssh guest@server.com` and be patched into a similar text program as these telnet servers?


title: How can I partition a volume in a regular file without loop?

text: I'm trying to play around with OS development, and I started with a boot loader, where phase 0 loads phase 1 from a file (specified by inode) on an ext4 partition (specified by first LBA). Of course, I need something to boot from, so I grabbed QEMU. Now what? What has worked fine so far is this:               truncate -s64M /tmp/SomeVolume     /sbin/mke2fs -t ext4 -F /tmp/SomeVolume     yasm phase0.asm     dd if=phase0 of=/tmp/SomeVolume conv=notrunc      I make a volume of about 64 MB, format it as ext4, and overwrite the first 1024 octets with phase0 (which is always 1024 bytes in size). This works fine. But now I want to make a properly partitioned file, to test it for more realistic scenarios. I know I could `/sbin/cfdisk` my volume file, but `mke2fs` doesn't have a parameter that lets me choose a span within the file. Now I'm aware of solutions using loop, but unfortunately, it doesn't seem to work for me (I can't seem to be able to change `max_part` in Debian jessie). There seems to be another module called `nbd`, but I don't have the server and client for that module installed. And it's getting a little ridiculous that I need root privileges for something that could clearly be done in userland. How can I do this as a user? Or should I just build the MBR/GPT-partitioned volume around the ext4-formatted file I created?


title: Is monitoring rsync with a pts device possible?

text: I have a rsync backup script, and I was wondering about methods of monitoring it as it runs. I could have it save a log and use watch and tail, but I had a more elegant solution in mind that might be possible. I'm just not sure how it would be done. Would it be possible to get rsync to run on it's own pts device, and run a command to monitor that device? It's not an area I'm familiar on, and any information about how this would be done or why it couldn't would be a valuable lesson for me.


title: Zsh auto complete suggest complete functions (_git _vim etc)

text: I have a small annoyance with how `zsh` is doing complete suggestions for my commands. If I type the beginning of a command that I don't have installed and press `tab` it will suggest the completion function that is installed. Lets say I want to execute `vim` but it isn't installed it will suggest `_vim`. Is there a way to turn this off? Or have I done something wrong in my setup? All my dotfiles are public at `github.com/henrikbjorn/castle`.


title: Real-World Use of TCP_DEFER_ACCEPT?

text: I was perusing the Apache httpd manual online and came across a directive for enabling this. Found a description in the man page for `tcp`:                  TCP_DEFER_ACCEPT (since Linux 2.4)               Allow a listener to be awakened only when data arrives on the               socket.  Takes an integer value (seconds), this can bound the               maximum number of attempts TCP will make to complete the               connection.  This option should not be used in code intended               to be portable.      Then I found this article but I'm still unclear what kind of workloads this would be useful for. I'm assuming that if `httpd` has an option specifically for this, it must have some relevance to web servers. I'm also assuming from the fact it's an option and not just how `httpd` does network connections, that there are use cases where you want it and others where you don't. Even after reading the article, I'm unclear on what the advantage to waiting for the three way handshake to complete would be. It would seem advantageous to ensure it's not going to need to swap-in the relevant `httpd` instance by doing so while the handshake is still going on instead of potentially causing that delay after a connection is formed. For the article, it would also seem to me that no matter the `TCP_DEFER_ACCEPT` status of a socket, you're still going to need four packets (handshake then data in each case). I don't know how they get the count down to three, nor how that provides a meaningful enhancement. So my question is basically: Is this just an old obsolete option or is there an actual use case for this option?


title: How do I fix these broken dependencies?

text: aptitude tells me I have some packages with broken dependencies:               kmiller@debian-dev-box:~$ sudo aptitude search '.*' | grep ^.B     iB  console-setup-linux             - Linux specific part of console-setup           iB  gir1.2-freedesktop              - Introspection data for some FreeDesktop co     iB  gir1.2-glib-2.0                 - Introspection data for GLib, GObject, Gio      iB  gir1.2-gstreamer-0.10           - Description: GObject introspection data fo     iB  gir1.2-json-1.0                 - GLib JSON manipulation library (introspect     iBA libatk-adaptor                  - AT-SPI 2 toolkit bridge                        iB  libgcc1                         - GCC support library                            iBA libgfortran3                    - Runtime library for GNU Fortran applicatio     iBA libgomp1                        - GCC OpenMP (GOMP) support library              iB  libstdc++6                      - GNU Standard C++ Library v3                     But the 'broken'-ness can't be too bad because:               kmiller@debian-dev-box:~$ sudo apt-get -f install     Reading package lists... Done     Building dependency tree            Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.          kmiller@debian-dev-box:~$ sudo apt-get -u dist-upgrade     Reading package lists... Done     Building dependency tree            Reading state information... Done     Calculating upgrade... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.      It's most worrying that libgcc1 has broken dependencies. What do I do to find out what to fix?!               kmiller@debian-dev-box:~$ sudo aptitude install -f     ...     0 packages upgraded, 11 newly installed, 177 to remove and 0 not upgraded.     ...     The following packages have unmet dependencies:      libstdc++6 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.5-4 is to be installed.      gir1.2-json-1.0 : Conflicts: gir1.0-json-glib-1.0 but 0.10.2-2squeeze1 is to be installed.      gir1.2-gstreamer-0.10 : Conflicts: gir1.0-gstreamer-0.10 but 0.10.30-1 is to be installed.      libgfortran3 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.5-4 is to be installed.      libgomp1 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.5-4 is to be installed.      libgcc1 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.5-4 is to be installed.      gir1.2-freedesktop : Conflicts: gir1.0-freedesktop but 0.6.14-1+b1 is to be installed.      gir1.2-glib-2.0 : Conflicts: gir1.0-glib-2.0 but 0.6.14-1+b1 is to be installed.      libatk-adaptor : Conflicts: at-spi but 1.32.0-2 is to be installed.      console-setup-linux : Breaks: console-terminus but 4.30-2 is to be installed.


title: Gaussian, which is run with nohup on remote linux machine, gets killed when the local computer is powered down before the shell is exited

text: I have a problem running Gaussian on remote Linux via SecureCRT on Windows. ## Gaussian Gaussian spawns different child executables ("link"s) when running. For example, I start Gaussian by running `nohup g09 < test.in > test.out 2> test.out &`, and `g09` will spawns different `link`s such as `l301.exe` and `l502.exe` at specific circumstances. ## Run Gaussian When I connect to the remote Linux box, and run Gaussian using `nohup ${Path_Of_Gaussian}/g09 < jobname.in > jobname.out 2> jobname.out &`:   1. If I exit the shell by typing `exit` and press `Enter`, I can exit while Gaussian on Linux keeps running (name of the specific executable depends on specific timing).   2. If I power down the computer (then the SecureCRT will be shutdown), Gaussian on Linux gets killed and complains "hang up".   3. If I exit by typing `exit` and press `Enter`, and then log on, I can power down the computer and Gaussian on Linux keeps running.   4. `jlliagre`'s answer does not work in this case. ## Run simple command Taken a simple executable, which does nothing (i.e., deals nothing with input & output) but sleeps for 10 minutes, for example. When I run it by `nohup ${Path_Of_Executable}/executable &`:   1. If I exit the shell by typing `exit` and press `Enter`, I can exit and the executable keeps running on Linux.   2. If I power down the computer (then the SecureCRT will be shutdown), the executable running on Linux gets killed.   3. If I exit by typing `exit` and press `Enter`, and then log on, I can power down the computer (then the SecureCRT will be shutdown) and the executable on Linux keeps running.   4. As in `jlliagre`'s knowledgeable answer, if I run `nohup ${Path_Of_Executable}/executable </dev/null >/dev/null 2>&1 &`, I can power down while the executable on Linux keeps running. In other words, why would Gaussian, which is run on a remote machine with `nohup`, get killed when the local computer is powered down before the shell is exited?


title: Is there a way to set network proxy system-wide?

text: If I want to have GNOME applications (as well as Firefox and Chrome) access the network through a proxy, I need only use **`gnome-network-properties`** (a nice and simple GUI I must say). For other apps (e.g. APT, Transmission, XChat), I have to use their specific ways of doing it. Is there a way to avoid this, something I can turn on and off when in a network that requires a proxy (hostname:port)?


title: iptables: redirect local request with NAT

text: I'd like to redirect local requests to port which is translated with NAT. I have following rules:               iptables -t nat -A PREROUTING -p tcp --dport 9020 -j DNAT --to 10.0.3.11:80      however request coming from localhost are rejected:               wget http://127.0.0.1:9020     Connecting to 127.0.0.1:9020... failed: Connection refused.      When I'm connecting from any other computer it works. Is there a way how to do this without recompiling kernel with `CONFIG_IP_NF_NAT_LOCAL=y`? https://wiki.debian.org/Firewalls-local-port-redirection (which seems to be obsolete). Update: `iptables -L -v -n --line-numbers -t nat`:               Chain PREROUTING (policy ACCEPT 26 packets, 3230 bytes)     num   pkts bytes target     prot opt in     out     source            destination         4       0   0     DNAT      tcp  --  *       *      0.0.0.0/0         0.0.0.0/0   tcp dpt:9020 to:10.0.3.11:80          Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)     num   pkts bytes target     prot opt in     out     source                destination              1        0     0 MASQUERADE all  --  *       *      10.0.0.0/16           0.0.0.0/0


title: How to find out which package of libc6 I need?

text: I am running into following error:               version GLIBC_2.14 not found      version GLIBC_2.15 not found      when trying to install software I need. Therefore, I decided to upgrade libc6 on my debian `(Linux nn15.project.org 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux)`. I found the libc6 package in this page and I guess I probably need unstable version. My questions are following:   1. How do I install specific version? So far I only used `apt-get install package`,    2. without specifying which one.which version should I use?   3. What's the difference between libc6-amd64, libc6-dbg, libc6-dev and others? I am using: Distributor ID: Debian Description: Debian GNU/Linux 7.1 (wheezy) Release: 7.1 Codename: wheezy


title: Is it a good idea to supplement shell script with perl purely for use of regex?

text: I'm looking for a simple way to utilize regex in a UNIX shell script where not every system will have perl extensions built into grep. What is really helpful about perl regex here is back/forward references which I haven't found a way to use effectively in sed. I've quickly come up with the following 1 liner: `tail --bytes=+K something.log| perl -e 'while (my $line = <STDIN>){if ($line =~ /$ARGV[0]/){print $line};}' 'my regex'` Q1. Is this a safe way to do things for perl? Q2. Should I just resort to writing the entire script in perl instead?


title: execute command from txt file

text: I have file and in this file i have this lines:               ssh root@server1.com     ssh root@server2.com     etc....      And i have script that i like to go on every server and execute the ls command on each of this servers that are on that file. What i did for now is:               while read line;     do     $line     done < $1      and it work but for the first line, after that it return an > Pseudo-terminal will not be allocated because stdin is not a terminal. > error. So i know I'm missing something but I'm a little lost here.


title: Linux Wordpress can't write wp-config file

text: I installed the latest version of Apache2 / PHP / MYSQL on my pc In the directory `/src/www/htdocs` I created a directory wordpress with all wordpress files. Then, when I tried to create the `wp-config` file through the web interface I get this error:               Sorry, but I can't write the wp-config file.      I tried this command to change the group of `/src/www/htdocs/wordpress`               chown -R root:root /srv/www/htdocs/wordpress      But it was not working. After some research, I have seen lot of people saying change the group to `www-data` but I do not see `www-data` using this command:               cut -d: -f1 /etc/group      Anyone know what I am doing wrong?


title: Bandwidth usage monitoring

text: > **Possible Duplicate:**   >  Find out network traffic per IP I want to monitor my bandwidth usuage for wired as well wireless devices on my network. Is there any tool, preferably one that does not use a master or agent concept or requires `snmp` on every device I want to monitor? I was searching and found `ntop` but it is not good enough as it has many limitations.


title: /var on an Logical Volume on ISCSI

text: I have Physical Volume that is on an open-iscsi device. This device is mounted after Linux has already started writing to the log files. Can I mount a Logical Volume on that Physical Volume to `/var` to have Linux write to there without losing anything? The reason for this is that I want to 'spare' my SSD from too much writing and not eating up all my memory (8GB). The mounting is not my problem since I already have some other Logical Volumes mounted after booting (I want to use one of them for storing my postgresql databases). Does anybody have some experience on this subject? It is hard to find information since `/var` is almost always present.


title: How can I do NFSv4 UID mapping across systems with UID mismatches?

text: I am working in a lab with three Ubuntu systems, and I would like to cross- mount some filesystems via NFS. However, while the systems have some of the same usernames, the UIDs and GIDs don't match, because the three systems were set up separately. When I mount an NFS filesystem from one system to another, the ownership shows up wrong. For example, if UID 1000 is alice on server1 and the same UID, 1000, is bob on server2, then when server1 mounts server2's exported filesystem, bob's files appear to be owned by alice. So Is there any way to make NFS (v4) convert UID's between servers via their associated user names? Googling for this, I've seen lots of references to Kerberos, LDAP, or NIS, which seems like massive overkill for such a simple task, and might not be possible since these systems are not centrally-managed. This link seems to indicate that what I ask is impossible. Is it correct? Edit: I've tried every configuration for `/etc/idmapd.conf` that I can think of or find on the internet, and while the idmapd process is clearly running, so far I have not seen any evidence that NFS is making any attempt to use it at all, and it has never had any effect whatsoever on the user ID's reported on NFS mounts.


title: Send attachment to gmail id from shell script

text: I have a shell script that generates reports. Using crontab i run the scrip everyday at 1000 hrs. I want to mail that report to my gmail id as an attachment. I have tried using mutt but it doesnt work for me. Please could you guide me through it. After installing sendEmail, when i am attempting to send the mail i am getting the following information               Sep 14 15:15:37 debal sendEmail[3671]: DEBUG => Connecting to smtp.gmail.com:587     Sep 14 15:15:38 debal sendEmail[3671]: DEBUG => My IP address is: 192.168.2.103     Sep 14 15:15:38 debal sendEmail[3671]: SUCCESS => Received:     220 mx.google.com ESMTP uw6sm17314211pbc.8 - gsmtp     Sep 14 15:15:38 debal sendEmail[3671]: INFO => Sending:     EHLO debal     Sep 14 15:15:38 debal sendEmail[3671]: SUCCESS => Received:     250-mx.google.com at your service, [180.151.208.181], 250-SIZE 35882577, 250-8BITMIME, 250-STARTTLS, 250-ENHANCEDSTATUSCODES, 250 CHUNKING     Sep 14 15:15:38 debal sendEmail[3671]: INFO => Sending:     STARTTLS     Sep 14 15:15:38 debal sendEmail[3671]: SUCCESS => Received:     220 2.0.0 Ready to start TLS     *******************************************************************      Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client      is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER      together with SSL_ca_file|SSL_ca_path for verification.      If you really don't want to verify the certificate and keep the      connection open to Man-In-The-Middle attacks please set      SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.     *******************************************************************       at /usr/local/bin/sendEmail line 1906.     invalid SSL_version specified at /usr/share/perl5/vendor_perl/IO/Socket/SSL.pm line 414.      I did a yum install on perl-Net-SSLeay perl-Net-SMTP-SSL and this is the result.               [root@debal ~]# yum install perl-Net-SSLeay perl-Net-SMTP-SSL     Loaded plugins: langpacks, refresh-packagekit     Package perl-Net-SSLeay-1.54-1.fc19.x86_64 already installed and latest version     Package perl-Net-SMTP-SSL-1.01-13.fc19.noarch already installed and latest version     Nothing to do      The problem still persists and I am using Fedora 19


title: os-prober not detecting Arch install

text: I'm triple booting osx, win 7 and arch on an apple macbook pro 8,2 I've followed the guide specific for my macbook pro here: Macbook Pro 8,2 Arch Installation As well as the beginners install guide here: Arch Beginners Guide Everything has gone well and I can boot and login fine. However I've come to a problem whilst trying to configure grub2. I've run this and I've verified that its worked correctly               # modprobe dm-mod      # grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=arch_grub --boot-directory=/boot/efi/EFI --recheck --debug     # mkdir -p /boot/efi/EFI/grub/locale     # cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/efi/EFI/grub/locale/en.mo      However when I run,               # grub-mkconfig -o /boot/efi/EFI/grub/grub.cfg      Whilst the config generator is running it spits out text from os-prober. It lists my osx and Windows partition but nothing about Arch. The config file generated doesn't contain any information about Arch either and when I try boot into grub2, it lists 2 Mac OSX partitions, 32 and 64 bit (of which only 1 exists) and neither boot as well as a Windows 7 partition which doesn't boot either. I think a big part of the problem is that os-prober isn't detecting the installations correctly. Does anyone have any idea why this would be? Thanks, Alex