title: Solutions are telling me to update libc6, but it's already updated. How do I fix `GLIBC_2.15' not found?

text: I've been trying to run a Garry's Mod server through Open Game Panel all day. I've tried to fix almost all errors, but I can't fix this one.               Failed to open dedicated_srv.so (/lib/i386-linux-gnu/i686/cmov/libm.so.6: version `GLIBC_2.15' not found (required by bin/dedicated_srv.so))     Add "-debug" to the ./srcds_run command line to generate a debug.log to help with solving this problem     Wed Jul 30 17:47:09 EDT 2014: Server restart in 10 seconds      How do I fix this? Libc6 is installed.


title: Arch Linux on an UEFI-GPT system with Windows 8.1 dual booting

text: I'm going to install Arch Linux on an UEFI computer. I've also Windows 8.1 installed and I would like to keep this operating system in dual boot with Arch. I should ask many questions, because this is the first time I have an UEFI computer with GPT (I have only used the MBR until now.). My Windows 8.1 system uses these partitions:   * **OS** : normal NTFS partition, Where the OS is installed?   * **EFI** partition (100 MB): The EFI partition created by Windows.   * **Windows RE** (900 MB): I supposed that this is the recovery partition?   * **Windows RE** (20 GB): Why is there an another partition of recovery? Instead, I've done the partitioning for Arch, with classic `/boot`, `/root` and `/home` partitions. My questions are:   1. Suppose I have GRUB UEFI and os-prober: If I format the EFI partition during the Arch installation, will I be able to access it in Windows without any problems? I read that this partition has to be formatted.   2. I've also read that I should enlarge this partition to about 200 MB, because I could encounter some problems/mistakes with dual boot. Is this necessary?   3. Is there any method to enlarge the partition, without touching other partitions?   4. Is it necessary to keep TWO recovery partitions of Windows? If I remove one of these recovery partition, what could happen? I prefer to remove the recovery partition with 20 GB, in my opinion it's only a waste of space.


title: Creating a GnuPG keyring for apache

text: Here's the scenario, we're using GnuPG to encrypt data between 2 web servers. 1 is on RHEL. GnuPG will be accessed through cgi scripts to encrypt and decrypt. So I need a keyring that the apache user has access to. This has proven to be difficult for me on Red Hat, I was able to get this set up pretty easily on Ubuntu. Here's what I've tried to, maybe someone has a better/easier way to accomplish this. I became the apache user               su -s /bin/bash apache      when running               gpg --gen-key      it couldn't create the .gnupg directory at /var/www, so I created that and set the owner to apache.apache. now when generating keys, I get               can't connect to `/var/www/.gnupg/S.gpg-agent': No such file or directory     gpg-agent[26949]: command get_passphrase failed: Operation cancelled     gpg: cancelled by user     gpg: Key generation canceled.      so I created that file, after reading the man page a bit (and some googling)               mknod -m 700 S.gpg-agent p      now I get               can't connect to `/var/www/.gnupg/S.gpg-agent': Connection refused     gpg-agent[26949]: command get_passphrase failed: Operation cancelled     gpg: cancelled by user     gpg: Key generation canceled.      I haven't been able to get anywhere after this as I'm getting into areas I don't know much about. I'm assuming it has to do with that apache isn't really a user in the since of having a bash profile, etc. So where do I go from here?


title: Grep one liner to remove blocks of random text

text: Using a script to backup some Cisco routers and compare startup and running configs. My output is tarnished by some ssl certificates it returns - I wish to remove them. Given:               *********  ERROR running diff on: AVE-1941-LAN config files Code: 0 ***************      certificate self-signed 01                   |  certificate self-signed 01 nvram:IOS-Self-Sig#1.cer       30820253 308201BC A0030201 02020101 300D0609 2A864886 F70D0 <       31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E656 <       69666963 6174652D 33393336 35313332 3733301E 170D3131 31323 <       33355A17 0D323030 31303130 30303030 305A3031 312F302D 06035 <       4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652 <       31333237 3330819F 300D0609 2A864886 F70D0101 01050003 818D0 <       81008EE9 17E0DDA9 B9ACAEEE 788267CD 1A6E7B99 15A1797E C1AFE <       97F5E44A 7CA1E814 E329EEC3 1C6229CD 5C78C9FB F5107E23 FE386 <       E7FA1849 BBA4884C 6001925E 6B2D2987 415AB429 ECDFCF87 E708D <       C22F137C E5778EC0 E8F6A0FB 30A2EEF7 AB2E5E77 53F2D83B B7497 <       8A5F0203 010001A3 7B307930 0F060355 1D130101 FF040530 03010 <       551D1104 1F301D82 1B424553 2D313934 312D4176 652E796F 75726 <       2E636F6D 301F0603 551D2304 18301680 14895C79 C998FF5B 08E1A <       F3866724 C4301D06 03551D0E 04160414 895C79C9 98FF5B08 E1A23 <       866724C4 300D0609 2A864886 F70D0101 04050003 81810002 DE0D3 <       4708834D C2267F49 86A62B31 A505D0F9 79BBC295 1C8DB831 39467 <       4A1F9149 DDB2ACDE CEE3DCB4 9CDAD85F 457D00BF BFBA3058 52188 <       FD497E36 93C06D1D C35012B6 A61A35FC 88681759 C51F6C0A A79A9 <       DB5391E9 49575BD5 50B6319E 065C2C99 4D9AB450 9D22D8         <         quit              I would like to end up with;               *********  ERROR running diff on: AVE-1941-LAN config files Code: 0 ***************      certificate self-signed 01                   |  certificate self-signed 01 nvram:IOS-Self-Sig#1.cer             quit      Is this possible with a grep one liner with perhaps regex?


title: What are the key differences between "SSH tunnels" and "Squid reverse IPs" in regards to web page scraping and private browsing?

text: What are the key differences between _"SSH tunnels"_ and _"Squid reverse IPs"_ in regards to web page scraping and private browsing? Interested to know if there are any differences between using _"SSH tunnels"_ and _"Squid reverse IPs"_ and how they connect to a website. **For example:** do they leave the same HTTP headers and JavaScript system info in a targets' website logs and in JavaScript based analytics software?


title: Print line n-1 (and n) if line n fulfills condition

text: I have a fasta file looking something like this:               >19 dna:chromosome chromosome:NCBIM37:19:1:61342430:1 37330562 ID13406 U -     TACATGGGTGACAAGGAGGTCAGGTGTTA     >19 dna:chromosome chromosome:NCBIM37:19:1:61342430:1 37330584 ID57999 U -     TGTCAAAGGAAGCCTTACTATACATGG      The lines beginning with ">" are headers, the others data. I want to remove all non-header lines that are shorter than 26 or longer than 31. I also want to remove the header belonging to those lines (i.e. the previous line.) My code so far               awk '     {if (substr($0,1,1) == ">")          {header=$0}      else          {if ((length($0) > 25) && (length($0) < 32)) {print $header "\n" $0}}}' *      but this gives me the error message               awk '{if (substr($0,1,1) == ">") {header=$0} else {if ((length($0) > 25) && (length($0) < 32)) {print $header $0}}}' *     ), name "header"ld $(>19 dna:chromosome chromosome:NCBIM37:19:1:61342430:1 37330562 ID13406 U -      input record number 2, file Cluster_1.fas      source line number 1


title: How to disable keyboard?

text: Without unplugging my keyboard I'd like to disable it from the terminal; I was hoping that this could be done using `rmmod` but based on my currently loaded modules it doesn't look like it is possible. Does anyone have any ideas?


title: How can I completely reinstall mysql?

text: I had to reboot in the middle of a large data import. I only have one mysql database, which has now been corrupted. How can I completely remove mysql and reinstall it? I've tried `apt-get purge mysql-server`, then removing `/var/lib/mysql/*` and reinstalling, but `apt- get` does not prompt me for a root name and password nor does it recreate the `/var/lib/mysql` files. How can I reinstall?


title: FreeBSD: Stable branch back to release

text: I'm currently using FreeBSD 8-STABLE, and I'm just a little confused about what I will do when FreeBSD 9 is released. Will I need to change anything in my stable-supfile? How do I go about getting either 9-STABLE or 9-RELEASE? If I'm not mistaken, 8-STABLE will essentially become 9-RELEASE when it is indeed released, no? Sorry if this is somewhere in the Handbook, I wasn't able to find a decent explanation of my "predicament."


title: Emacs: mute messages ("echo area")

text: I do lots of automatizing in Emacs, by stacking commands that I know from using **manually**. That is a method I recommend, because it doesn't take much effort: you use Emacs as you ordinarily would, and now and then it pops to your head, "hey, I'm always using those commands in succession, why don't I just merge them?" All the more simple since you know the commands, by name or shortcut. One problem, though, is that when you stack commands, you get lots of messages flashing by in the "echo area" (same place as the minibuffer). Those messages don't make any sense, as everything going on below (the functions invoked) is (should be) transparent to the user. So, could you **mute** it, and then **unmute** it? Take a look below:               (defun invisible-pretty-mail ()       "Automatize `pretty-mail'."       (interactive)       ; (mute-echo-area)       (rmail-edit-current-message)       (pretty-mail) ; lots of replace-string, replace-regexp, etc. here                     ; that will flood messages       (rmail-cease-edit)       ; (unmute-echo-area)       )      **Edit** in response to sds' answer: I'm very much aware of those notes you refer to, as they are very common in the Emacs help system. While your advice is not incorrect in general, let us examine this particular situation in greater detail: 1) There is an Elisp function in `.emacs`. 2) It uses commands that the person who setup the function is very familiar with, so it is very readable and maintainable. 3) The function works exactly as intended, with 4) the _one_ drawback that it echos too many messages. Now, in this situation, would you really suggest a **complete rewrite** of that function (and many others), using altogether different commands, commands that may or may not exist, as a possible way of reducing messages, which we won't even know will happen? **Edit** : An example (that works), after the help I got from Drew.               (defun test-suppress-msgs ()       (interactive)       (let ((log-size message-log-max))         (setq message-log-max nil)         (message "This message is suppressed.")         (setq message-log-max log-size)         (message "This is echoed, and logged.") ))


title: How to make a path world-readable?

text: To make some item X world-readable, it is not enough for it to have the right permissions: each component of the absolute path leading to it must also have the right permissions. (My understanding, correct me if I'm wrong, is that X itself must have its world-readable (4) bit set, and every _directory_ component in its path must have its world-executable (1) bit set.) What's the simplest way to do this? FWIW, my best guess would be something like:               function _mkwr {         chmod o+x $1 || return 0         parent=$( dirname $1 )         if [[ $parent = $1 ]]; then return 0; fi         _mkwr $parent     }          function mkwr {         chmod o+Xr $1         _mkwr $( dirname $1 )     }


I want to run one sysvinit script before another and figured out how to do that. To make sure, this actually happens in the the order I like, I would like to see a list, in which order that happens. I found `sudo insserv --showall` already, but can't make head or tail of it, since it lists init scripts multiple times. How to find out in which order /etc/init.d scripts are load on Debian?


title: How to disable PAE feature of kernel, after installation?

text: I am using RHEL 5.3(x86) as a base platform for my development purpose.My machine's spec is as follows:               Intel, Core-i3 Processor @ 2.5GHz     4GB RAM      Problem is whenever I am attempting to install the kernel(2.6.18), it is being installed as PAE feature enabled kernel. This is restricting me from loading some pre-compiled kernel.Whenever I am issuing               insmod module_name      it is giving error, saying about the existence of incompatibility issues. I did a lot of browsing. They are saying that the PAE support is default feature, in RHEL 5.3(x86). But didnt find any clue how to disable it, to run the module successfully


title: Reset Load Averages?

text: I'm doing some load testing on a new dedicated web server, and after a certain amount of strain is put on the server I have to wait a minute for the one- minute load average to climb back down so that my testing remains fairly accurate. Is there any way to set the load averages back to 0, or whatever they are normally at, without rebooting?


title: How to zip a file and save it in another directory

text: How can I zip a file and save it in another directory using the command line? I have no space left in directory (100% full).


title: RAID-1 mirror has become a single hard disk

text: I have an HP N40L microserver, with 2 identical drives, I used the system to hardware-RAID them as a mirror. I then installed mint on the system about a year ago. This has been running perfectly, updating, etc. until I upgraded to Mint 17. I thought everything was fine, but I've noticed that mint is only using 1 of the drives to boot, then for some reason was showing the contents of the other drive. i.e. it boots `sdb1`, but `df` shows `sda1`. I'm _sure_ `df` used to show a `/dev/mapper/pdc_bejigbccdb1` drive which was the RAID array. Thus any updates to Grub go to `sda1`, but it boots `sdb1` then loads the fs `sda1`.               N40L marty # df     Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda1      233159608 113675036 107617644  52% /     none                   4         0         4   0% /sys/fs/cgroup     /dev             2943932        12   2943920   1% /media/sda1/dev     tmpfs             597588      1232    596356   1% /run     none                5120         0      5120   0% /run/lock     none             2987920         0   2987920   0% /run/shm     none              102400         4    102396   1% /run/user      From `cat /etc/fstab`               N40L marty # cat /etc/fstab     # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     /dev/mapper/pdc_bejigbccdb1 /               ext4    errors=remount-ro 0       1     /dev/mapper/pdc_bejigbccdb5 none            swap    sw              0       0      If I do `ls /dev/mapper/` I get               N40L marty # ls /dev/mapper     total 0     crw------- 1 root root 10, 236 Jul 24 17:03 control      How do I get my raid back and how do I get grub to boot to it? * * * Further update:               N40L grub # dmraid -r     /dev/sdb: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0     /dev/sda: pdc, "pdc_bejigbccdb", mirror, ok, 486328064 sectors, data@ 0          N40L grub # dmraid -s     *** Set     name   : pdc_bejigbccdb     size   : 486328064     stride : 128     type   : mirror     status : ok     subsets: 0     devs   : 2     spares : 0          N40L grub # dmraid -ay -vvv -d     WARN: locking /var/lock/dmraid/.lock     NOTICE: /dev/sdb: asr     discovering     NOTICE: /dev/sdb: ddf1    discovering     NOTICE: /dev/sdb: hpt37x  discovering     NOTICE: /dev/sdb: hpt45x  discovering     NOTICE: /dev/sdb: isw     discovering     DEBUG: not isw at 250059348992     DEBUG: isw trying hard coded -2115 offset.     DEBUG: not isw at 250058267136     NOTICE: /dev/sdb: jmicron discovering     NOTICE: /dev/sdb: lsi     discovering     NOTICE: /dev/sdb: nvidia  discovering     NOTICE: /dev/sdb: pdc     discovering     NOTICE: /dev/sdb: pdc metadata discovered     NOTICE: /dev/sdb: sil     discovering     NOTICE: /dev/sdb: via     discovering     NOTICE: /dev/sda: asr     discovering     NOTICE: /dev/sda: ddf1    discovering     NOTICE: /dev/sda: hpt37x  discovering     NOTICE: /dev/sda: hpt45x  discovering     NOTICE: /dev/sda: isw     discovering     DEBUG: not isw at 250059348992     DEBUG: isw trying hard coded -2115 offset.     DEBUG: not isw at 250058267136     NOTICE: /dev/sda: jmicron discovering     NOTICE: /dev/sda: lsi     discovering     NOTICE: /dev/sda: nvidia  discovering     NOTICE: /dev/sda: pdc     discovering     NOTICE: /dev/sda: pdc metadata discovered     NOTICE: /dev/sda: sil     discovering     NOTICE: /dev/sda: via     discovering     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: not found pdc_bejigbccdb     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: not found pdc_bejigbccdb     NOTICE: added /dev/sdb to RAID set "pdc_bejigbccdb"     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: found pdc_bejigbccdb     DEBUG: _find_set: searching pdc_bejigbccdb     DEBUG: _find_set: found pdc_bejigbccdb     NOTICE: added /dev/sda to RAID set "pdc_bejigbccdb"     DEBUG: checking pdc device "/dev/sda"     DEBUG: checking pdc device "/dev/sdb"     DEBUG: set status of set "pdc_bejigbccdb" to 16     DEBUG: checking pdc device "/dev/sda"     DEBUG: checking pdc device "/dev/sdb"     DEBUG: set status of set "pdc_bejigbccdb" to 16     RAID set "pdc_bejigbccdb" was not activated     WARN: unlocking /var/lock/dmraid/.lock     DEBUG: freeing devices of RAID set "pdc_bejigbccdb"     DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sda"     DEBUG: freeing device "pdc_bejigbccdb", path "/dev/sdb"      So my system sees the two drives and sees they should be part of an array, but will not activate the array and this not create `/dev/mapper/pdc_bejigbccdb` so I cannot load grub to it and boot from it. How do I get dmraid to activate and create the mapper entry?


title: why are there 3 debian DVD isos + 2 update DVD isos in my local debian mirror?

text: I want to try Debian for the 1st time and I wanted to download the full DVD so I went to my local Debian mirror and what I see are 3 DVDs and 2 update DVDs. what is each? Do I need more than just the 1st DVD?


title: Is PAM a user authentication method?

text: If someone asks that **PAM is a user authentication method**? Then can we say yes? Or no?


title: How to su to www on OpenBSD?

text: I have a PHP script that I wish to run under the www account. The account has nologin as shell and is used by Apache. When I run "su -l www -s /bin/ksh" as root, I get the following message: This account is currently not available. I use OpenBSD 5.2


title: What does the Chromium option `--no-sandbox` mean?

text: I'm running Chromium like so : `chromium --no-sandbox` I'm doing this because I'm running Debian Squeeze on an OpenVZ VM Container and it's the only way I can get it to work. Though I keep reading **this is terrible**. But I want to know why exactly. Can someone please explain it to me? Does someone need to hack into your computer to do damage? Or does the vulnerability come from a file on the web like a JavaScript file? What if I locked browsing down to only a handful of "trusted" sites? (Gmail, stackexchange (ofcourse), and facebook)


title: How to force lp from CUPS to print in grayscale?

text: I want to print an image from a command line:               lp -o scaling=//100// image.jpg      How can I force it to be printed in grayscale?


title: Cannot install Fedora 18

text: I have a Dell Inspiron laptop with 2.5GB RAM and 120GB HDD. I have windows 7 and Ubuntu installed side by side. I have another 30GB space where I want to install Fedora 18 but when I try to install it, I get the following error               /dev/root not found      Can anyone tell me how to overcome this. I get the error as soon as I click to install it.


title: eCryptFS automounting issue

text: I'm running Arch Linux and am trying to setup an encrypted folder with eCryptFS. I've followed the tutorial on Arch's Wiki for manual installation, it's actually working. The problem occurs when I try to automount this directory on boot time. I have this entry in my `/etc/fstab`:               /home/henrique/.secret /home/henrique/secret ecryptfs user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs  0 0      When booting, I obtain this in my journal:               Jun 08 01:45:15 henrique-pc kernel: Key type trusted registered     Jun 08 01:45:15 henrique-pc kernel: sha256_ssse3: Using AVX optimized SHA-256 implementation     Jun 08 01:45:15 henrique-pc kernel: Key type encrypted registered     Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] does not have a subgraph transition node; attempting to build a linear subgraph from its parameter list     Jun 08 01:45:15 henrique-pc mount.ecryptfs[595]: Key module [openssl] has empty parameter list     Jun 08 01:45:15 henrique-pc mount[594]: Select key type to use for newly created files:     Jun 08 01:45:15 henrique-pc mount[594]: 1) passphrase     Jun 08 01:45:15 henrique-pc mount[594]: 2) openssl     Jun 08 01:45:15 henrique-pc mount[594]: Selection: Error attempting to evaluate mount options: [-5] Input/output error     Jun 08 01:45:15 henrique-pc mount[594]: Check your system logs for details on why this happened.     Jun 08 01:45:15 henrique-pc mount[594]: Try updating your ecryptfs-utils package, and/or     Jun 08 01:45:15 henrique-pc mount[594]: submit a bug report on https://bugs.launchpad.net/ecryptfs     Jun 08 01:45:15 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251     Jun 08 01:45:15 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.     -- Subject: Unit home-henrique-secret.mount has failed     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel     --      -- Unit home-henrique-secret.mount has failed.     --      -- The result is failed.     Jun 08 01:45:15 henrique-pc systemd[1]: Dependency failed for Local File Systems.     -- Subject: Unit local-fs.target has failed     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel     --      -- Unit local-fs.target has failed.     --      -- The result is dependency.     Jun 08 01:45:15 henrique-pc systemd[1]: Triggering OnFailure= dependencies of local-fs.target.     Jun 08 01:45:15 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.     Jun 08 01:45:15 henrique-pc systemd[1]: Closed CUPS Printing Service Sockets.     -- Subject: Unit cups.socket has finished shutting down     -- Defined-By: systemd     -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel      I've configured my `/etc/security/pam_mount.conf.xml` just as the tutorial says so:               <luserconf name=".pam_mount.conf.xml" />     <mntoptions require="" />      <lclmount>mount -i %(VOLUME) "%(before=\"-o\" OPTIONS)"</lclmount>       Here is the `systemctl status` of this process. I think it's strange that the mount script doesn't use the `-i` option that I've declared in my `/etc/security/pam_mount.conf.xml`:               ● home-henrique-secret.mount - /home/henrique/secret        Loaded: loaded (/etc/fstab)        Active: failed (Result: exit-code) since Dom 2014-06-08 02:11:24 BRT; 1min 42s ago         Where: /home/henrique/secret          What: /home/henrique/.secret          Docs: man:fstab(5)                man:systemd-fstab-generator(8)       Process: 433 ExecMount=/bin/mount /home/henrique/.secret /home/henrique/secret -t ecryptfs -o user,rw,nosuid,nodev,relatime,ecryptfs_fnek_sig=5fe512dc3ad6af7e,ecryptfs_sig=e7a764a16f23b1e4,ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_unlink_sigs (code=exited, status=251)[/b]          [b]Jun 08 02:11:24 henrique-pc mount[433]: Select key type to use for newly created files:     Jun 08 02:11:24 henrique-pc mount[433]: 1) passphrase     Jun 08 02:11:24 henrique-pc mount[433]: 2) openssl     Jun 08 02:11:24 henrique-pc mount[433]: Selection: Error attempting to evaluate mount options: [-5] Input/output error     Jun 08 02:11:24 henrique-pc mount[433]: Check your system logs for details on why this happened.     Jun 08 02:11:24 henrique-pc mount[433]: Try updating your ecryptfs-utils package, and/or     Jun 08 02:11:24 henrique-pc mount[433]: submit a bug report on [url]https://bugs.launchpad.net/ecryptfs[/url]     Jun 08 02:11:24 henrique-pc systemd[1]: home-henrique-secret.mount mount process exited, code=exited status=251     Jun 08 02:11:24 henrique-pc systemd[1]: Failed to mount /home/henrique/secret.     Jun 08 02:11:24 henrique-pc systemd[1]: Unit home-henrique-secret.mount entered failed state.      The problem, I think, is that my keyring is empty, but I'm not prompted to enter a passphrase. Although, I really shouldn't be prompted and the passphrase should be loaded with this script:               #!/bin/sh     #     #    /usr/local/bin/doecryptfs          exit $(/usr/sbin/pmvarrun -u$PAM_USER -o0)      I've configured the files `system-auth`, `login` and `gdm` inside the `/etc/pam.d` directory with this:               auth    [success=ignore default=1]    pam_exec.so     quiet /usr/local/bin/doecryptfs      But it doesn't work. **Another important thing:** It seems like the `$PAM_USER` variable is never set, so this probably makes the script fail. In order to mount this folder, I need to login first (without the entry in `/etc/fstab`), add the passphrases to my keyring and only after that, I can't mount it using `mount.ecryptfs_private` command. The tutorial is kind of confusing. I'm not sure if I didn't screw it up at some point.


title: Where is the documentation for net.ipv4.conf.all.log_martians?

text: Where is the documentation for `net.ipv4.conf.all.log_martians` sysctl setting? There are man pages for various other TCP/IP/UDP (`man 7 tcp`, `man 7 upd`, `man 7 ip`) settings, but I cant find the `net.ipv4.conf.all.log_martians` docs. Note: I want official documentation from Linux; not random sites from google.


title: Java fails with “Could not find the main class”

text: I want to run a jar file in Linux (CentOS, 32-bit). But the following error occurs. What is the reason?               [root@server ~]# java -jar keygen.jar     Exception in thread "main" java.lang.UnsupportedClassVersionError: org/dgt/jl/App : Unsupported major.minor version 51.0             at java.lang.ClassLoader.defineClass1(Native Method)             at java.lang.ClassLoader.defineClass(ClassLoader.java:643)             at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)             at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)             at java.net.URLClassLoader.access$000(URLClassLoader.java:73)             at java.net.URLClassLoader$1.run(URLClassLoader.java:212)             at java.security.AccessController.doPrivileged(Native Method)             at java.net.URLClassLoader.findClass(URLClassLoader.java:205)             at java.lang.ClassLoader.loadClass(ClassLoader.java:323)             at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)             at java.lang.ClassLoader.loadClass(ClassLoader.java:268)     Could not find the main class: org.dgt.jl.App. Program will exi      My Java version:               java version "1.6.0_24"     OpenJDK Runtime Environment (IcedTea6 1.11.14) (rhel-1.42.1.11.14.el5_10-i386)     OpenJDK Client VM (build 20.0-b12, mixed mode)


title: Start and stop multiple executable for easy debugging

text: I'm debugging a networking project, which involves interacting of 3 programs, ie a server, two different clients. However I find it difficult to start and stop them for debugging. Some methods I have tried so far:   * Start 3 terminals. Run `./server`, `./client1`, `./client2`. The problem with this method is I need to switch back and forth between windows.   * Start 1 terminal. Put these in a script: `./server &;./client1 &;./client2 &`. Run the script. The problem with this method is killing the processes after debugging is hard. Need to look up PID and type `kill <PID>`. Is there a better way to do this? How do people usually debug in that situation?


title: Case-insensitive substring search in a shell script

text: I'm trying to create a script which runs a command and compares the output of that command to a certain string to see if it contains that substring, ignoring the case of the string needed to be compared. I hope what I'm asking is clear, though.


title: grep and brackets in text

text: I store downloaded files in a log like this:               [source] filename      To avoid downloading a file more than once I grep for `[source] filename` before:               if ! grep "$signature" downloaded.log > /dev/null; then         wget ...     fi      **but** starting my line with `[` grep does not work the way I need:               signature="[source] filename"     echo $signature | grep "$signature"     echo $signature | grep "\$signature" #trying to escape first bracket      both return nothing. Any smart workaround? It would be nice also having no need to change the code switching to parens `()`, braces `{}`, or whatever `<>`


title: Font rendering - Infinality patches on Ubuntu

text: There is a Ubuntu PPA https://launchpad.net/~no1wantdthisname/+archive/ppa?field.series_filter= with patches for Infinality оn Freetype and Cairo for 11.04 11.10 12.04 12.10 13.04 But the updates are done only for 12.10 and 13.04. For 12.10 and 13.04 the patches are only for Freetype. I want to update the packages. How to apply these patches? I want to apply a patch to Cairo against 12.10 and 13.04. There is a How to Enable Infinality Font Rendering but I can not get it to apply without error. How to acheive this?


title: how to install ast python package

text: I'm using django constance in my project. This app used a python package ast. When I try to install that package using command `pip-2.7 install ast`, it results as "`Could not find any downloads that satisfy the requirement ast`". Can some one help me how to install this package in CentOS? I tried searching in google, unfortunately I couldn't find any link.


title: conceal home folder completely - is ecryptfs the right choice?

text: On my Debian-Testing-System, I want to completely conceal the home folders. That means, I not only want the data to be encrypted, but I also want to preclude determining any (or most) information from the encrypted data. For instance, also file names should be encrypted. But not being an expert for data protection, maybe also other file/folder attributes need to be encrypted to grant privacy. I considered ecryptfs to achieve this (Package ecryptfs-utils) However, is this the right choice for my needs? I also would appreciate links to step-by-step instructions on the implementation of encrypted home-folders in Debian very much! [edit] I do a fresh install, therefore it's not necessary to migrate a previously unencrypted home folder.


title: Is it better to set -j REJECT or -j DROP in iptables?

text: There's an example of iptables rules on archlinux wiki:               # Generated by iptables-save v1.4.18 on Sun Mar 17 14:21:12 2013     *filter     :INPUT DROP [0:0]     :FORWARD DROP [0:0]     :OUTPUT ACCEPT [0:0]     :TCP - [0:0]     :UDP - [0:0]     -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m conntrack --ctstate INVALID -j DROP     -A INPUT -p icmp -m icmp --icmp-type 8 -m conntrack --ctstate NEW -j ACCEPT     -A INPUT -p udp -m conntrack --ctstate NEW -j UDP     -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP     -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable     -A INPUT -p tcp -j REJECT --reject-with tcp-reset     -A INPUT -j REJECT --reject-with icmp-proto-unreachable     COMMIT     # Completed on Sun Mar 17 14:21:12 2013      A few days ago my friend asked me why is there `REJECT` in the last three rules. He told me that there should be `DROP` instead, and he mentioned something about better security in case of `DROP`. So, I have two questions:   1. What do the three rules do?   2. Does it make any difference when I put there `DROP` in place `REJECT --reject-with` ? If yes, what is the difference?


title: tcpdump of SCCP or GSM MAP messages

text: Right now I'm using `tcpdump -i <interface_name> -p <port> -s0 -w /tmp/file.cap` and then filter the capture in wireshark. How can I take packet capture with tcpdump only on SCCP or GSM_MAP protocols and drop the sctp heartbeat messages? Any other solution will also be good :) OS: RedHat


title: Mutt index disappearing on IMAP reconnect

text: `Mutt` IMAP is working just fine ... until IMAP server drops the connection. Then `mutt` automatically reconnects to the server - also just fine, according to the messages in the status line - but! **it clears the list of messages in its index screen** upon reconnect and requires manual reentry into the mailbox to regenerate the message list, which is virtually equal to a `mutt` restart! Happens with all IMAP servers I tried: Gmail, Dovecot, CyrusIMAP. This is a major annoyance especially when you have done a big selection of messages for a group operation and suddenly you have start all over. Or am I perhaps missing something? May it be that `mutt` doesn't reconnect really, gives misleading status messages and I need a `mutt next generation`?


title: GUI for find which can show video thumbnails

text: Is there a GUI for `find` (or just a graphical search tool which supports regex searches on filenames starting from a specific directory) which is able to show thumbnails found video and image files? I don't want something which uses an index like `recoll`, `tracker` or something like that in this case.


title: What is causing my UMTS modem to hang up?

text: I am trying to established PPP communication to my mobile ISP with `wvdial`, but I always get **modem hang up** message. In my `syslog` I can see some activity:               Oct 29 07:48:47 linuxbox kernel: [31222.852253] PPP generic driver version 2.4.2     Oct 29 07:48:47 linuxbox pppd[24590]: pppd 2.4.5 started by root, uid 0     Oct 29 07:48:47 linuxbox pppd[24590]: Using interface ppp0     Oct 29 07:48:47 linuxbox pppd[24590]: Connect: ppp0 <--> /dev/ttyUSB2     Oct 29 07:48:47 linuxbox pppd[24590]: CHAP authentication succeeded     Oct 29 07:48:47 linuxbox pppd[24590]: CHAP authentication succeeded     Oct 29 07:48:47 linuxbox kernel: [31223.014123] PPP BSD Compression module registered     Oct 29 07:48:47 linuxbox kernel: [31223.061839] PPP Deflate Compression module registered     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: ifplugd 0.28 initializing.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Using interface ppp0/00:00:00:00:00:00     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Using detection mode: IFF_RUNNING     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Initialization complete, link beat detected.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Executing '/etc/ifplugd/ifplugd.action ppp0 up'.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: client: Ignoring unknown interface ppp0=ppp0.     Oct 29 07:48:47 linuxbox ifplugd(ppp0)[24612]: Program executed successfully.     Oct 29 07:49:08 linuxbox pppd[24590]: Modem hangup     Oct 29 07:49:08 linuxbox pppd[24590]: Connection terminated.     Oct 29 07:49:08 linuxbox avahi-daemon[1946]: Withdrawing workstation service for ppp0.     Oct 29 07:49:08 linuxbox pppd[24590]: Exit.     Oct 29 07:49:08 linuxbox ifplugd(ppp0)[24612]: Link beat lost.     Oct 29 07:49:08 linuxbox ifplugd(ppp0)[24612]: Exiting.     Oct 29 07:49:13 linuxbox pppd[24697]: pppd 2.4.5 started by root, uid 0     Oct 29 07:49:13 linuxbox pppd[24697]: Using interface ppp0     Oct 29 07:49:13 linuxbox pppd[24697]: Connect: ppp0 <--> /dev/ttyUSB2     Oct 29 07:49:14 linuxbox pppd[24697]: CHAP authentication succeeded     Oct 29 07:49:14 linuxbox pppd[24697]: CHAP authentication succeeded     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: ifplugd 0.28 initializing.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Using interface ppp0/00:00:00:00:00:00     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Using detection mode: IFF_RUNNING     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Initialization complete, link beat detected.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Executing '/etc/ifplugd/ifplugd.action ppp0 up'.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: client: Ignoring unknown interface ppp0=ppp0.     Oct 29 07:49:14 linuxbox ifplugd(ppp0)[24711]: Program executed successfully.     Oct 29 07:49:35 linuxbox pppd[24697]: Modem hangup     Oct 29 07:49:35 linuxbox pppd[24697]: Connection terminated.     Oct 29 07:49:35 linuxbox avahi-daemon[1946]: Withdrawing workstation service for ppp0.     Oct 29 07:49:35 linuxbox pppd[24697]: Exit.     Oct 29 07:49:35 linuxbox ifplugd(ppp0)[24711]: Link beat lost.     Oct 29 07:49:36 linuxbox ifplugd(ppp0)[24711]: Exiting.      What is causing this problem?


title: Flash samsung wave (alternative for Multiloader)

text: There is a suitable software for flashing Samsung Wave named "Multiloader". But its a Microsoft windows software. Is there any suitable program, an alternative for Multiloader in Linux?


title: dav2fs caching problem on Debian Squeeze

text: I have `apache`/`mod_dav` and `davfs2` all on the same host. `davfs2` is used to mount what Apache is serving to the local filesystem - a sort of loopback. The purpose is that the content of the files served is dynamic and comes from a postgres database via php. In this case the file is an email footer/disclaimer that changes periodically and is read by the mail program. This mostly works well, but when I try to `cp` a file from the dav directory to another part of the filesystem, it `cp` does not seem to trigger the 'has the file changed' check in davfs2 - it just gets the cached copy. Note the php file has not changed, only the dynamic content because something has been updated in the database. On the other hand, if I `cp` again 5 seconds later, the correct file contents is copied. I've ended up with a script like this:               #!/bin/bash     cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html     sleep 5     cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html      Caching related headers in php are set as follows:               header("Cache-Control: no-store, no-cache, must-revalidate");     header("Cache-Control: post-check=0, pre-check=0", false);     header("Pragma: no-cache");      I've set `file_refresh 0` in `davfs2.conf`. My question is: Is there some other setting I am missing to correct this behaviour?


title: RDP only Operating System

text: I am looking for an operating system where the login screen asks for a username and password for an rdp login prompt. I want an administrator to also be able to login to change the i.p. address for the server that hosts the accounts. Any suggestions?


title: Samba: Sharing some folders without duplicate?

text: I keep all my `Photos` on my Share: `//COMPUTERNAME/Photos` In the `Photos` share, it contains all the years folders follow by album name, example:               //COMPUTERNAME/Photos/2012/New York/     //COMPUTERNAME/Photos/2011/France/     //COMPUTERNAME/Photos/2011/Party Night/      Only I have access to `Photos` share with username and password, it is not accessible by anyone. However, I want to share a few photos albums for my family but I don't want them to have access to the `Photos` share. I can create a share called `//COMPUTERNAME/PhotosShare/` but I don't want to copy a few photos albums from `Photos` share. In the `//COMPUTERNAME/PhotosShare/` share I want something like this: `//COMPUTERNAME/PhotosShare/2012 New York` link with `//COMPUTERNAME/Photos/2012/New York/` Is it possible to use `ln` command? I don't think that going to work due to user permission access on Samba. What is the solution?


title: How can I convert this bash function to the fish shell

text: I'm trying out the fish shell 2.0 to replace bash. I'm trying to convert the following bash function to a fish function, but its giving me hell. I have a several similar functions so if someone could point me in the right direction with an example I would be very grateful               connect() {         if [ "$2" != "" ]         then                 ssh -ti ~/.ssh/work/id_rsa user@host$1.domain.com "sudo ssh $2"         fi         if [ "$2" == "" ]         then                 ssh -ti ~/.ssh/work/id_rsa user@host$1.domain.com "sudo -i"         fi     }      Tried just replacing $1 and $2 with $argv[1] and $argv[2] but it complains about not being able to locate the end of block. I know its because the scripting synxtax is quite different in fish. I tried starting from a simpler function and had troubles with figuring out how to get it to do one thing if 1 variable is passed, and another thing if 2 variables are passed:               function testvarz         switch "$argv[2]";                 case ""                         echo "no second variable passed"                 case != ""                         echo "second variable passed"         end          end      but that doesn't work, if you pass 2 variable it does nothing, if you pass 1 it complains about


title: Safe way to pass password for >1 programs in bash

text: I'm writing a `bash` script, and need to ask user for his password and pass it to `openssl`. Whilst `openssl` can read the password itself, I need for two runs of the program and don't want to ask the user twice. Here is the script:               cp file{,.old}     read -sp 'Enter password. ' PASS; echo     export PASS          # decode | edit | encode     openssl enc -d -aes-256-cbc -k "$PASS" -in file.old | \       sed ... | openssl enc -e -aes-256-cbc -k "$PASS" -out file          unset PASS      This is not safe as the password is easily available by looking at the command line; somebody can read it using `ps`, for example. `openssl` can read a password from an environment variable, so I can replace `-k "$PASS"` with `-pass env:PASS`, but it's still not safe; the environment variables of any process can be read freely (again, `ps` can do it). So, how can I safely pass the password to the two `openssl` instances?


title: Backed an ipod up with dd, how to retrieve all tracks in one go with gnupod?

text: I have had gnupod for a while. Still haven't figured out how to use it though. I usually just go for gtkpod. So this question, in case anyone had any doubts after reading everything below, _is purely about gnupod syntax_. Recently I decided to get my ipod replaced under this replacement scheme. (I don't like proprietary hardware, etc., but if someone is going to give me a brand new piece of hardware... for something that was originally a gift... hmm...) Anyway, long story short, I backed up my old ipod using dd:               dd if=/dev/sdb2 of=ipodbk      and just tried running gtkpod (with ipodbk mounted as `-t vfat -o loop`) to see if it would pick it up, like it does when an ipod is attached, which it does. But this question is not about that. I don't want to waste time with gtkpod's bugginess when it comes to exporting an entire ipod's files (tried it before. ended up with a lot of 0 byte files... no thanks). I just want to be able to export all the tracks from the disk image in one go. The command probably looks something like               gnupod_something (some switches) -m /home/user/ipodbkmount/ (some stuff?)      and the output probably looks something like               (window flooded with 1000 lines of text)      but I've never really been able to get `gnupod` to work. I'm sure it's a great program, and I have to usually invoke it as `gnupod_check -m ipod --fixit` once in a while when `gtkpod` loses track of what it's doing and makes errors when it writes files to the device. As for `gnupod`, I'm just not intelligent enough to figure out its syntax on the more routine ipod manipulations, I think. So, yeah, what's that command?


title: Did all of the Requests for Comments directly affect the design of Unix networks?

text: _I want to know more about Linux_ must be one of my most enduring sentiments. But I often find that I learn the most, or perhaps just feel the most satisfied with what I have learned, when I simply crack open the history books. What's hiding in `/etc` and `/dev` that I don't know about? Well, files. Everything is a file. But what put those files there? History put them where they are, and history dictated how they were written, yadda yadda yadda. According to `man hosts`                  Historical Notes            RFC 952 gave the original format for the host table, though it has since changed.                 Before the advent of DNS, the host table was the only way of resolving hostnames on the fledgling Internet.  Indeed, this file could            be created from the official host data base maintained at the Network Information Control Center (NIC), though  local  changes  were            often  required to bring it up to date regarding unofficial aliases and/or unknown hosts.  The NIC no longer maintains the hosts.txt            files, though looking around at the time of writing (circa 2000), there are historical hosts.txt files on the  WWW.   I  just  found            three, from 92, 94, and 95.      Great. So that gives me something to chew on. I wanna know how Linux works, and in particular I wanna know why Linux networking looks the way it does, so I'll just go read RFC 952. But, oh, wait... It's _really short_. And there are hundreds of RFC documents. Hmm... Before trying to tackle these, I gotta know, did _all_ of the Request for Comments (RFC) documents directly impact the design of Unix and Linux? Should I be trying to get my head around all of them, or just a subset?


title: iptables, how to redirect port from loopback?

text: The main rules are:               OUTIF=eth0      /sbin/iptables --policy INPUT DROP      /sbin/iptables --policy FORWARD DROP      /sbin/iptables --policy OUTPUT ACCEPT      /sbin/iptables -A INPUT -i lo -j ACCEPT      /sbin/iptables -A INPUT -i $OUTIF -m state --state RELATED,ESTABLISHED -j ACCEPT      I want mysql to listen on `lo` at port 3306 port. And I also want it to listen at port 33060 on the WAN interface (`eth0`) as I want to keep it away from bots. I've tried several redirections with no success. For example:               /sbin/iptables -A INPUT -p tcp -i $OUTIF --dport 34306 -j ACCEPT     /sbin/iptables -A PREROUTING -t nat -p tcp -s 0/0 --dport 34306 \                    -j DNAT --to 127.0.0.1:3306      How can I do this? EDITED: I'm going to use redir however I still want to know how to do this with iptables.


title: How to download .pdf files from pubmed

text: I can't download `.pdf` files from http://www.ncbi.nlm.nih.gov/pmc/articles, I already have some document IDs such as PMC3404089. I tried to issue the following command:               curl -o file.pdf http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3404089       The command downloaded a file, `file.pdf`, but it is an empty file.


title: How to remove character and space from a string

text: Hello I have one file with output               Name        : ABC     Name        : CDE     Name        : ZYS      I want to get the result               ABC     CDE     ZYS      How can i get it through SED command. I have tried. `sed s/'Name'` but it returns me the output like`: ABC` I want to trim the space and also `:` from the string.


title: OpenSSL buffering problem

text: I have a stream that I would like to encrypt in real time, but the problem is that `openssl` encrypt only when it could read from stdin enough bytes, otherwise it waits. Look at those examples:               $ (echo Hello world; sleep 3) | cat -     Hello world     $ (echo Hello world; sleep 3) | openssl base64 | openssl base64 -d     Hello world      In the first case you see the output immediately, in the second one you have to wait three seconds. How could I could avoid this behavior? I tried `unbuffer -p` and `stdbuf -i0`, but they don't work in this case. In order to be more clear, I show you how I'm trying to use it (those are commands in order to send an audio stream over the network):               ### Not encrypted: works well     # Server     nc -ul 1234 | gst-launch fdsrc ! opusparse ! opusdec ! fdsink | pacat --latency-msec=20     # Client     parec --latency-msec=20 | gst-launch fdsrc ! audioparse rate=48000 channels=2 ! opusenc ! fdsink | nc -u localhost 1234          ### Encrypted: doesn't work     # Server     nc -l -u 1234 | openssl aes-256-cbc -pass pass:test -salt -d | gst-launch fdsrc ! opusparse ! opusdec ! fdsink | pacat --latency-msec=20     # Client     parec --latency-msec=20 | gst-launch fdsrc ! audioparse rate=48000 channels=2 ! opusenc ! fdsink | openssl aes-256-cbc -pass pass:test -salt | nc -u localhost 1234


title: Uniquely identifying java processes with same name

text: I have two java processes which run using the same file name, `MyApp.jar` (for example).               /usr/java/latest/bin/java -jar MyApp.jar      These jars exist in different places and use different configurations. I want to be able to kill one process, but don't know how to distinguish between the two. I execute:                ps aux | grep [M]yApp.jar      And get:               admin    21509  0.8  0.1 1199908 20484 ?       Sl   08:21   0:00 /usr/java/latest/bin/java -jar MyApp.jar     admin    21585  6.7  0.1 1199764 20084 ?       Sl   08:21   0:00       I've thought of creating the process with some dummy parameter to be able to distinguish them:               /usr/java/latest/bin/java -jar MyApp.jar MyAppTheFirst      and               /usr/java/latest/bin/java -jar MyApp.jar MyAppTheSecond      But this seems a bit wrong to me. Is there a better way?


title: How do you create and execute a bash script which calls an executable from higher folder?

text: I'm attempting to write a very simple script which calls an executable from a higher level folder. If I were just typing the command into the console, I would type               ../filenamehere {options} {parameters}      When I try to do the same thing in a .sh file in order to run multiple processes at the same time, I attempt to write the following:               ../filename {options} {parameters} &     ../filename {options2} {parameters} &     ../filename {options3} {parameters} &     ../filename {options4} {parameters} &      Then, to run the file, I entered               chmod a+x script_file.sh     ./script_file.sh      After which point I was given a "command not found" error 3 times. I assume this means that 1 of my 4 commands executed, but the other 3 didn't. If I type directly into the console exactly the same commands as I put in the .sh file, nothing goes wrong. What do I need to do to make this file run?


title: Determining the particular processor on which a process is running

text: I have access to an 8-core node of a Linux cluster. When logged in to the node, I can see a list of processors using this command:               more /proc/cpuinfo      In my 8-core node, the processors are numbered from 0 to 7. Each processor is an Intel Xeon CPU (E5430 @ 2.66GHz). Now suppose I call the program `foo` with some arguments `args`:               foo args      The program `foo` takes a long time to execute (hours or days, for example). Having called `foo`, is it possible to determine the _particular_ processor (i.e., 0 to 7) on which `foo` is running? The `top` program shows me the process ID and similar information, but I don't see the processor _number_. Is such information available?


title: Safer way for granting permissions for self user?

text: I know sometimes we can do `chmod 777` so we have a directory at our complete reach for accessing, reading and writing. But usually I prefer to do a `sudo chown {myusername} {directory}`. Obviously, the `chmod 777` leaves a directory completely open to anyone, but, does my practice of using `sudo chown ...` actually offer protection to my directories vs. the `chmod 777`?


title: Can I safely delete the Ubuntu 12.04 partition and use the unallocated space for my Elementary OS?

text: I have this setup: ![image](http://i.stack.imgur.com/9zfOg.png) I've decided to switch to Elementary OS Luna (fork of Ubuntu 12.04) as my main Linux distro. Now I need to delete my Ubuntu partition so I could add capacity to my eOS which only has 10Gb. Currently my eOS is in `/dev/sda9`, and Ubuntu in `/dev/sda8/`. I forgot where my bootloader is installed, so I ran bootinfoscript, which returned this: `============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks in partition 94 for . sda1: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:       Boot files:        /bootmgr /Boot/BCD      sda2: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:  Windows 7     Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe      sda3: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  No errors found in the Boot Parameter Block.     Operating System:       Boot files:        /bootmgr /boot/bcd      sda4: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       Extended Partition     Boot sector type:  -     Boot sector info:       sda5: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ntfs     Boot sector type:  Windows Vista/7: NTFS     Boot sector info:  According to the info in the boot sector, sda5 starts                         at sector 2048.     Operating System:       Boot files:              sda6: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       swap     Boot sector type:  -     Boot sector info:       sda7: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  Grub2 (v1.99)     Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda7                         and looks at sector 851823520 of the same hard drive                         for core.img, but core.img can not be found at this                         location.     Operating System:       Boot files:        /grub/grub.cfg /extlinux/extlinux.conf      sda8: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  Grub2 (v1.99)     Boot sector info:  Grub2 (v1.99) is installed in the boot sector of sda8                         and looks at sector 860224256 of the same hard drive                         for core.img. core.img is at this location and looks                         for (,msdos9)/boot/grub on this drive.     Operating System:  Ubuntu 13.04     Boot files:        /etc/fstab      sda9: **___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __ ___ __**               File system:       ext4     Boot sector type:  -     Boot sector info:      Operating System:  elementary OS Luna     Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img`      I need advice as to how to proceed. I mean, does removing the Ubuntu and the /dev/sda7/ partition NOT mess up my GRUB? Please help, thank you.


title: How to config my.cfg file for mysql which was installed from sources?

text: I installed MySQL 5.6 from sources on debian. MySQL folder is /usr/local/mysql. Here is several question: 1) I would like to config my.cfg. But I couldn't find several parameters:                  socket          = /var/run/mysqld/mysqld.sock (file is missing)        pid-file        = /var/run/mysqld/mysqld.pid (file is missing)        !includedir    /etc/mysql/conf.d/ (folder is missing)      Where are they? 2) I would like to make autostart on reboot system. But earlier I've installed from apt-get install source and had _/etc/init.d/mysqld start_ and it would run automatically. Now I should run manually _/etc/init.d/mysql.server start_. So, how to run it automatically?


title: Read files owned by another user as non-root

text: I'm backing up servers on a backup server. Each server which is backed up has it's own account on the backup server, and the files are rsynced. It is important that the permissions remain intact (using rsync -p) to simplify restores. I'm trying to create a script which can read the files and create some statistics. I don't like that script to be running under the root user, and it it also impossible to run it for every backup user, as the script should be able to read all files from all users. However, this creates a problem when a file is for example chmodded 600. I don't want to touch permissions, but another user except for root and the owner can't read it. A specific - non root - user should be able to read all files in a directory or partition, regardless the permission levels (and the owner of the files should have no way to prevent it). Is there a way to achieve this? I'm running FreeBSD with a ZFS volume.


title: How do I allow rwx access to a specific group with ACLs?

text: How do I grant read, write and execute to specific group? What I did:               adduser test     addgroup developer     setfacl -m g:developer:rwx /opt/spago41/      When I login as test I can't run:               startup.sh in /opt/spago41/      Is the `setfacl` command not working?


title: Computer wont boot with any media after installing wine on Ubuntu 13.10

text: Yup. I can boot into anything (meaning the os part), like a cd/dvd, a live usb, or the os on the HDD. i can boot into the first screen, which i think is called the grub selection screen and whatever else there are. but when i select something to boot. i just get a screen with a blinking line. i tried booting into a live usb of knoppix, is stops reading from the usb after saying "Booting into kernel". the other os's dont say anything. they all have the same result. im pretty sure i cant boot into a kernel at all. i can boot into the Ultimate Boot CD and do CPU burn in, i was hoping it would get the cpu going or something. UPDATE: on the Knoppix cd, there is a debug64. i chose that and got passed the "booting into kernel" message, then the boot stopped at "[2.444305]registered taskstats version 1". Link to my G+ post on this matter. https://plus.google.com/107988923652678124819/posts/TbbzrrpycNQ


title: How to give permissions to user (regarding an NFS share)

text: There are two machines: "A" and "B". OS is SLES 9.4. "A" is the NFS server, "B" is the NFS client. "A" has exported an FS to "B". "B" mounted the NFS share. On both machines I have root permission. There is an "XY" user on the NFS client: "B". The mounted NFS looks like this on "B":               SERVER:/foo # ls -la /foo/     total 28     drwxr-xr-x   4 bar  admin  4096 Dec 18 07:35 .     drwxr-xr-x  34 root root   4096 Dec 17 10:20 ..     drwxrwxr-x   7 bar  admin  4096 Dec 15 03:03 zzz     drwx------   2 root root  16384 Dec  2  2013 lost+found     SERVER:/foo #       The "bar" user isn't "XY" user and I can't add it to the "admin" group. **My question** : How can I give the "XY" user full write permission to the /foo/ on the NFS client, "B"? with ACL's? How? UPDATE: I just found out ACL's doesn't work via NFS :D      UPDATE#2: no, modifying the permissions on the /foo isn't good, because the /foo is used on "A".


title: Get list of unread emails from Unix server

text: We are trying to get a list of unread emails from our Unix server using `mailx -L`. However, the email subject gets truncated if its length is greater than 25 characters. How can this be resolved?


title: Keyboard backlight is very dim

text: I have a Samsung Series 9 running Fedora. It has a backlit keyboard but even at the maximum setting, keys are not readable. The functions keys controlling the level are working, the OSD indicator pops up and looks fine, but all my online searches lead to tutorials on fixing the function keys. The exact machine looks like a Christmas tree under Windows XP/7/8. How can I fix this thing?


title: How to remove an empty directory (btrfs filesystem)?

text: I'm using the experimental `btrfs` filesystem. My directory looks like this:                ls -la empytfolder      total 4      drwxr-xr-x 1 root root   0 19. Mär 14:00 .      drwxr-xr-x 1 root root 298 19. Mär 13:59 ..      I try to removed it with `rm -rf emptyfolder` but it gives the error `rm: cannot remove directory: directory not empty?` How can I remove/delete my emptyfolder? Why do I have 4 files in this folder? I'm trying to delete it as a root user. My filesystem is btrfs. `stat emptyfolder` gives me:                Datei: „emptyfolder“      Größe: 0           Blöcke: 0          EA Block: 4096   Verzeichnis      Gerät: 21h/33d Inode: 256         Verknüpfungen: 1      Zugriff: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)      Zugriff    : 2012-03-19 14:00:28.205205566 +0100      Modifiziert: 2012-03-19 14:00:23.925025572 +0100      Geändert   : 2012-03-19 14:00:23.925025572 +0100      Geburt    : -      I've some problems with my system clock. Sometimes it's showing the wrong time.               $ lsof +D emptyfolder     lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user     /.gvfs Output information may be incomplete.      What is this gvfs-fuse-daemon? How can I delete it? I've tried fuser -uv /dev/disk to no avail. There isn't any process accessing the folder. I've moved the folder to tmp.


title: How to print keypresses in .inputrc format?

text: Which application can I use to figure out what to put in .inputrc for _any_ custom keyboard shortcut? I've tried a few, and none of them seem to be usable: `showkey`, `showkey -a` and `read` just print `'` if you press `Ctrl`-`'`. `xev` prints them separately, and doesn't print anything that seems usable for .inputrc.


title: Is it a good idea to run freenas 8 (inside virtualbox) on a lamp server?

text: I am redesigning my home network setup (specifically my nas and server), and recently asked a question about running a lamp server and freenas 8 on two separate machines. However, in the spirit of conserving money and electricity, i am thinking of combining the two machines using virtualbox. This way, i could run freenas 8 in a virtualbox on my lamp server (on a single machine). To prevent any conflicts between the two OS's I thought i could install both the lamp server and freenas 8 on a single usb-drive (connected to an internal usb header), and have a couple of hd's that only freenas accesses for storage (so there won't be any competition between linux and freenas for the hd's). Is this potentially a setup that could work and remain stable? And is it sensible to run an OS from flash memory for long periods of time (because it only has a limited number of read/writes), or is it an accident waiting to happen? Any possible suggestions or foreseen issues?


title: How to change mixing of channels by pulse audio / alsa

text: I have a recent problem with my sound configuration. Basically, it's way too loud until I set the volume below 10%. And then it's very quickly too silent. Using the alsa mixer, I can set the headphone volume and PCM volume to about 50% and then obtain a reasonable range on the master. But any application using pulse will reset all the non-master channels to max and kill my ears instantly. Is there a way to force pulse to NOT change the other channels? I tried to look for information, and it seems that I need to change the channels from "mixin" to "ignore" in the configuration file, but there are so many configuration files, and I haven't found which ones are actually used by my system. So in the end, I am not even sure that what I think is correct. Can someone tell me: how to find the exact configuration files I need to change, or how to override the global configuration with some local one? and what I need to actually change? Thanks.


title: What is using this network socket?

text: I'm trying to use NTP to update the time on my machine. However, it gives me an error:               host # ntpdate ntp1.example.org     10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting      What does the error "socket is in use" mean? How can I see what is using this socket? This happens on my CentOS 4.x system, but I also see it on FreeBSD 7.x, Ubuntu 10.04 and Solaris 10.


title: full access to remote computer without remote static IP

text: How can I access to remote computer that the remote computer is in a local network? I worked with reverse ssh : `http://www.vdomck.org/2005/11/reversing- ssh-connection.html` I don't want just SSH but I want other port's of remote computer too I want to connect to remote computer by http,ssh ,mysql,ppp,... ports How can I do that?


title: Can Linux "run out of RAM"?

text: I saw several posts around the web of people apparently complaining about a hosted VPS unexpectedly killing processes because they used too much RAM. How is this possible? I thought all modern OS' provide "infinite RAM" by just using disk swap for whatever goes over the physical RAM. Is this correct? What might be happening if a process is "killed due to low RAM"?


title: "Overlay" a shell prompt on top of a terminal session?

text: I have several CLI application ideas that would be nice to run as an "overlay" on top of my terminal session. In other words I would like to superimpose a box containing a real live shell prompt on top of whatever is currently displaying in my terminal. Nothing more than that. It could work exactly like `tmux` except instead of windows and panes, it would just be a one-line-high terminal on top of whatever is existing, but I don't really need a "real" one-line-high terminal; it could just be a prompt by some other means, if that's possible. Any ideas of where to start solving this?


title: How to create an alias for opening a directory on Mac

text: Trying to create an alias `hello`. After typing `hello` in `Terminal`, then `vi` opens `hello_folder`. Now, this code returns:               $ hello      -bash: hello: command not found                  1 #!/bin/bash       2 cd ~/Documents/       3        4 # create directory if it does not exists..       5 mkdir -p hello_folder       6        7 # in this dir create a dummy hello_file and write something into it.       8 cd hello_folder       9 touch hello_file.md && echo 'hello' > hello_file.md.      10       11 # go to ~/.bash_profile and create alias.      12 # instructions:      13 # if you type hello in terminal, then it opens hello_folder in vim editor      14 echo "alias hello='vi /Users/fill_your_username/Documents/hello_folder/'" > ~/.bash_profile      What is missing in the code ? - `alias` is not recognised.


title: How to bury an invisible mark into lines of text?

text: How can I bury an **invisible** mark into random lines of text? Such a mark has to be there, though it will be invisible to someone reading that text printed out on the console. I want to identify those lines by means of an invisible mark in order to, for instance, grep them in or out later. I tried `0x00` without success. I expected `grep` to print lines matching `0x00` somewhere. But this didn't work:               $ echo -e "a\0b" | hexdump -C     00000000  61 00 62 0a                                       |a.b.|     00000004     $ echo -e "a\0b" | grep "a\0b"


title: How to tell rsyslog to create log file if not there?

text: Default behaviour by rsyslog is to append traces to an _existing_ log file. Now, I've seen (CentOs, Scientific Linux) that when rsyslog is already running, you delete the log file (e.g. the one dedicated to log traces from your application), you then run your application, rsyslog **will not** create a log file and no trace will be recorded. Is there a config option somehow that can tell rsyslog to create a log file if not there before appending traces to it? **Note** : doing a `service rsyslog restart` will force creation of an empty log file. **rsyslog.conf** (nothing added to it)               # rsyslog v5 configuration file          # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html     # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html          #### MODULES ####          $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)     $ModLoad imklog   # provides kernel logging support (previously done by rklogd)     #$ModLoad immark  # provides --MARK-- message capability          $SystemLogRateLimitInterval 1     $SystemLogRateLimitBurst 50000          # Provides UDP syslog reception     #$ModLoad imudp     #$UDPServerRun 514          # Provides TCP syslog reception     #$ModLoad imtcp     #$InputTCPServerRun 514               #### GLOBAL DIRECTIVES ####          # Use default timestamp format     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat          # File syncing capability is disabled by default. This feature is usually not required,     # not useful and an extreme performance hit     #$ActionFileEnableSync on          # Include all config files in /etc/rsyslog.d/     $IncludeConfig /etc/rsyslog.d/*.conf               #### RULES ####          # Log all kernel messages to the console.     # Logging much else clutters up the screen.     #kern.*                                                 /dev/console          # Log anything (except mail) of level info or higher.     # Don't log private authentication messages!     *.info;mail.none;authpriv.none;cron.none;local1.none    /var/log/messages          # The authpriv file has restricted access.     authpriv.*                                              /var/log/secure          # Log all the mail messages in one place.     mail.*                                                  -/var/log/maillog               # Log cron stuff     cron.*                                                  /var/log/cron          # Everybody gets emergency messages     *.emerg                                                 *          # Save news errors of level crit and higher in a special file.     uucp,news.crit                                          /var/log/spooler          # Save boot messages also to boot.log     local7.*                                                /var/log/boot.log          # ### begin forwarding rule ###     # The statement between the begin ... end define a SINGLE forwarding     # rule. They belong together, do NOT split them. If you create multiple     # forwarding rules, duplicate the whole block!     # Remote Logging (we use TCP for reliable delivery)     #     # An on-disk queue is created for this action. If the remote host is     # down, messages are spooled to disk and sent when it is up again.     #$WorkDirectory /var/lib/rsyslog # where to place spool files     #$ActionQueueFileName fwdRule1 # unique name prefix for spool files     #$ActionQueueMaxDiskSpace 1g   # 1gb space limit (use as much as possible)     #$ActionQueueSaveOnShutdown on # save messages to disk on shutdown     #$ActionQueueType LinkedList   # run asynchronously     #$ActionResumeRetryCount -1    # infinite retries if host is down     # remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional     #*.* @@remote-host:514     # ### end of the forwarding rule ###


title: Nginx loadbalancing between PHP-FPM and Apache

text: Do the upstream PHP servers have to run the same server software? If I have the following Nginx configuration                upstream myapp1 {             server srv1.example.com;             server srv2.example.com;         }      Assuming we have shared back-end database and identical web sites, could I use Apache on srv1 and PHP-FPM on srv2 to compare the two under identical real- world load?


title: Hard drives goes missing until reboot - what can be the cause?

text: I am struggling here. My end goal is assembling a RAID-6 array on my PC, but time and again, the assemble doesn't complete (and `cat /proc/mdstat` shows that one drive dropped away). This now happened with two separate drives. The issue is - I did various tests (rebooting Ubuntu, even going into Windows and formatting (not quick format) the drives/partitions there, and no issues were picked up with the drives). I suspect it's an issue on my Ubuntu installation but dont know where to start looking in log files etc. Some output below (11 drives -boot + 10 x 1TB drives)               erwin@erwin-ubuntu:~$ sudo smartctl -i --scan     /dev/sda -d scsi # /dev/sda, SCSI device     /dev/sdb -d scsi # /dev/sdb, SCSI device     /dev/sdc -d scsi # /dev/sdc, SCSI device     /dev/sdd -d scsi # /dev/sdd, SCSI device     /dev/sde -d scsi # /dev/sde, SCSI device     /dev/sdf -d scsi # /dev/sdf, SCSI device     /dev/sdg -d scsi # /dev/sdg, SCSI device     /dev/sdh -d scsi # /dev/sdh, SCSI device     /dev/sdi -d scsi # /dev/sdi, SCSI device     /dev/sdj -d scsi # /dev/sdj, SCSI device     /dev/sdk -d scsi # /dev/sdk, SCSI device     /dev/sdl -d scsi # /dev/sdl, SCSI device      The issue is `sdd` and `sdk` (although they were available on boot), once I tried assembling on MDADM, after a few hours, a drive just drops out, and is no longer reported as available by either `gparted` or `fdisk`, etc.               erwin@erwin-ubuntu:~$ sudo fdisk /dev/sdd     fdisk: unable to read /dev/sdd: Input/output error      Capture of a working drive               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdb     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Model Family:     Seagate Barracuda 7200.11     Device Model:     ST31000340AS     Serial Number:    9QJ0MD9F     LU WWN Device Id: 5 000c50 00cca6f07     Firmware Version: SD15     User Capacity:    1,000,203,804,160 bytes [1.00 TB]     Sector Size:      512 bytes logical/physical     Device is:        In smartctl database [for details use: -P show]     ATA Version is:   8     ATA Standard is:  ATA-8-ACS revision 4     Local Time is:    Sat Dec 17 10:59:13 2011 SAST      Capture of the two problematic drives:               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdd     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /6:0:0:0     Product:                   User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     scsiModePageOffset: response length too short, resp_len=47 offset=50 bd_len=46     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.               erwin@erwin-ubuntu:~$ sudo smartctl -i /dev/sdh     smartctl 5.41 2011-06-09 r3365 [i686-linux-3.0.0-14-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /11:0:0:     Product:              0     User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     scsiModePageOffset: response length too short, resp_len=47 offset=50 bd_len=46     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.      A command recommended on another forum, `lsscsi`:               erwin@erwin-ubuntu:~$ lsscsi     [0:0:0:0]    disk    ATA      ST3500630AS      3.AA  /dev/sda     [2:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdb     [3:0:0:0]    disk    ATA      ST31000528AS     CC38  /dev/sdc     [6:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdd     [7:0:0:0]    disk    ATA      ST31000528AS     CC36  /dev/sde     [8:0:0:0]    disk    ATA      ST31000340AS     SD15  /dev/sdf     [10:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdg     [11:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdh     [12:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdi     [13:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdj     [14:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdk     [15:0:0:0]   disk    ATA      ST31000340AS     SD15  /dev/sdl      Will post/edit details after reboot shortly..


title: How to add TileStream in autoload CentOS

text: I'm new with CentOS. I have a installed tilestream. Now want to tilestream start automaticaly after system restart. Do like this tutorial. /etc/init/tilestream.conf               #!upstart     #description "node.js chatapp server"     #author      "subicura"          start on startup     stop on shutdown          script        export HOME="/home/myuser"#             echo $$ > /var/run/tilestream.pid        exec /usr/bin/node /usr/bin/tilestream >> /var/log/tilestream.log 2>&1     end script          pre-start script        # Date format same as (new Date()).toISOString() for consistency        echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Starting" >> /var/log/tilestream.log     end script          pre-stop script        rm /var/run/tilestream.pid        echo "[`date -u +%Y-%m-%dT%T.%3NZ`] (sys) Stopping" >> /var/log/tilestream.log     end script      In cterminal do:               /sbin/start tilestream      Output:               tilestream start/running, process 2428      In log:               [2014-06-27T08:32:55.316Z] (sys) Starting     Creating tiles dir /home/myuser#/Documents/MapBox/tiles     Started [Server Tile].     Started [Server Core:8888].      But TileStream not work. If i start it with script /etc/init.d/tilestream               #!/bin/sh     ### BEGIN INIT INFO     # Provides:          tilestream     # Required-Start:    $local_fs $remote_fs $network $syslog $named     # Required-Stop:     $local_fs $remote_fs $network $syslog $named     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # X-Interactive:     true     # Short-Description: Start TileStream server     ### END INIT INFO          TILESTREAM="/usr/bin/tilestream"     MAPPATH="/data"     HOST="host"     #HOST="localhost"     #UIPORT="9001"     UIPORT="8888"     #TILEPORT="9000"     TILEPORT="8888"     SUBDOMAINS="a,b,c,d"          case $1 in         start)             echo "Starting TileStream"            #$TILESTREAM --tiles=$MAPPATH --host=$HOST&            #$TILESTREAM --tiles=$MAPPATH --host=$HOST --uiPort=$UIPORT --tilePort=$TILEPORT --subdomains=$SUBDOMAINS&            $TILESTREAM --tiles=$MAPPATH --host=$HOST --uiPort=$UIPORT --tilePort=$TILEPORT&             ;;         stop)             echo "Stopping TileStream"             #PID=`ps aux | grep $TILESTREAM | grep -v grep | awk '{print $2}'`         PID=`ps aux | grep "tilestream" | grep -v grep | awk '{print $2}'`             kill -9 $PID             ;;         restart)             echo "Restarting TileStream"            $0 stop            sleep 1            $0 start            ;;         *)             echo "Usage: $0 {start|stop|restart}" >&2             exit 1             ;;         esac      In this case all work fine.   Any advices?


title: How to change my script to replace and add new variable in a configuration?

text: Well this is my script. It is to configure my systems sysctl.conf.               infile = open('sysctl.conf')     outfile = open('sysctl.conf.new', 'w')          replacements = {'Net.ipv4.icmp_echo_ignore_all' :'1',                 'Net.ipv4.icmp_echo_ignore_broadcasts' :'1',                 'Net.ipv4.ip_forward' : '0',                 'Net.ipv4.tcp_syncookies':'1',                 'Net.ipv4.conf.all.rp_filter': '1',                 'Net.ipv4.conf.all.Log.martiansd':'1',                 'Net.ipv4.conf.all.Secure_redirects' : '1',                 'Net.ipv4.conf.all.Send_redirects' : '0',                 'Net.ipv4.conf.all.Accept_Source_Route':  '0',                 'Net.ipv4.conf.all.Accept_redirects':'0',                 'Net.ipv4.tcp_max_syn_backlog': '4096',                 }          for line in infile:         if '#' in line:             pass         elif '=' in line:             w = line.split('=')             for var, value in replacements.iteritems():                 if var in w[0]:                     line=line.replace(w[1],value)         outfile.write(line)     infile.close()     outfile.close()      This script works fine but there is one problem. If any of the parameters in replacement is not present in sysctl.conf then it is not going to add it in the new configuration file.It only modifies the parameters present with my values. I want to add all parameters in the configuration or change if they are already present. How to do it? I know it should be easy but I am stuck here.


title: I want to create a script so that I don't have to type su and password every time

text: I want to create a script so that I don't have to type `su` and the password for logging into root every time.


title: Why doesn't my supervisor daemon start on reboot?

text: I have added a crontab entry via `crontab -e` for the current user:               @reboot supervisord -c /etc/supervisord.conf      Yet after the reboot, supervisord demon is not running. I need to run the command again in bash. Only a second try yields in an error I expected right away after setting up the cronjob.               $ supervisord -c /etc/supervisord.conf     $ supervisord -c /etc/supervisord.conf     Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.      Why doesn't my cronjob work and how do I start supervisor daemon on boot?