title: two instances of privoxy not working

text: SOLVED Always check for those pesky capital letters! In the privoxytor config file I had typed that the location of the config file as privoxyTor with a capital 'T' -why privoxy needs this I have know idea as it's accessing the file already. * * * After following the instructions here: https://trac.torproject.org/projects/tor/wiki/doc/RunTwoPrivoxys And, excepting one difference - I used the name privoxytor instead of privoxy2, I can't seem to get the second instance of privoxy running and can't find any more error messages. The original still starts up fine with "service privoxy start", but the new one, while not giving any error messages does not. running "service privoxytor status" gives: "privoxytor is not running ... failed!" here is my init.d file # ! /bin/sh               ### BEGIN INIT INFO     # Provides:          privoxytor     # Required-Start:    $local_fs $remote_fs $named $network $time     # Required-Stop:     $local_fs $remote_fs $named $network $time     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Privacy enhancing HTTP Proxy     # Description:       Privoxy is a web proxy with advanced filtering     #                    capabilities for protecting privacy, filtering     #                    web page content, managing cookies, controlling     #                    access, and removing ads, banners, pop-ups and     #                    other obnoxious Internet junk.     ### END INIT INFO          # Author: Roland Rosenfeld <roland@debian.org>          # Do NOT "set -e"          # PATH should only include /usr/* if it runs after the mountnfs.sh script     PATH=/sbin:/usr/sbin:/bin:/usr/bin     DESC="filtering parent proxy server for Tor"     NAM=privoxy     NAME=${NAM}tor     echo $NAME     DAEMON=/usr/sbin/${NAME}     echo $DAEMON     PIDFILE=/var/run/${NAME}.pid     echo $PIDFILE     OWNER=${NAME}     echo $OWNER     CONFIGFILE=/etc/${NAME}/config     echo $CONFIGFILE     DAEMON_ARGS="--pidfile $PIDFILE --user $OWNER $CONFIGFILE"     SCRIPTNAME=/etc/init.d/${NAME}     LOGDIR=/var/log/${NAME}     DEFAULTSFILE=/etc/default/${NAM}          # Exit if the package is not installed     [ -x "$DAEMON" ] || exit 0          # Read configuration variable file if it is present     [ -r $DEFAULTSFILE ] && . $DEFAULTSFILE          # Create log directory if it does not exist     if [ ! -d "$LOGDIR" ]; then         mkdir -m 750 $LOGDIR         chown $OWNER:adm $LOGDIR     fi          # Load the VERBOSE setting and other rcS variables     . /lib/init/vars.sh          # Define LSB log_* functions.     # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.     . /lib/lsb/init-functions          #     # Function that starts the daemon/service     #     do_start()     {             # Return             #   0 if daemon has been started             #   1 if daemon was already running             #   2 if daemon could not be started             start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \                 || return 1             start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \                 $DAEMON_ARGS \                 || return 2             # Add code here, if necessary, that waits for the process to be ready             # to handle requests from services started subsequently which depend             # on this one.  As a last resort, sleep for some time.     }          #     # Function that stops the daemon/service     #     do_stop()     {             # Return             #   0 if daemon has been stopped             #   1 if daemon was already stopped             #   2 if daemon could not be stopped             #   other if a failure occurred             start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME             RETVAL="$?"             [ "$RETVAL" = 2 ] && return 2             # Wait for children to finish too if this is a daemon that forks             # and if the daemon is only ever run from this initscript.             # If the above conditions are not satisfied then add some other code             # that waits for the process to drop all resources that could be             # needed by services started subsequently.  A last resort is to             # sleep for some time.             start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON             [ "$?" = 2 ] && return 2             # Many daemons don't delete their pidfiles when they exit.             rm -f $PIDFILE             return "$RETVAL"     }          #     # Function that sends a SIGHUP to the daemon/service     #     do_reload() {             #             # If the daemon can reload its configuration without             # restarting (for example, when it is sent a SIGHUP),             # then implement that here.             #             start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME             return 0     }               case "$1" in       start)             if [ "$RUN_DAEMON" = "no" ]; then                 [ "$VERBOSE" != no ] && log_warning_msg "Not starting $DESC (disabled in $DEFAULTSFILE)."                 exit 0             fi                  [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"             do_start             case "$?" in                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;             esac             ;;       stop)             [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"             do_stop             case "$?" in                 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;                 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;             esac             ;;       #reload|force-reload)             #             # If do_reload() is not implemented then leave this commented out             # and leave 'force-reload' as an alias for 'restart'.             #             #log_daemon_msg "Reloading $DESC" "$NAME"             #do_reload             #log_end_msg $?             #;;       restart|force-reload)             #             # If the "reload" option is implemented then remove the             # 'force-reload' alias             #             if [ "$RUN_DAEMON" = "no" ]; then                 [ "$VERBOSE" != no ] && log_warning_msg "Not restarting $DESC (disabled in $DEFAULTSFILE)."                 exit 0             fi                  log_daemon_msg "Restarting $DESC" "$NAME"             do_stop             case "$?" in               0|1)                 do_start                 case "$?" in                     0) log_end_msg 0 ;;                     1) log_end_msg 1 ;; # Old process is still running                     *) log_end_msg 1 ;; # Failed to start                 esac                 ;;               *)                 # Failed to stop                 log_end_msg 1                 ;;             esac             ;;       status)             status_of_proc "$DAEMON" "$NAME"             exit $?             ;;            *)             #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2             echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2             exit 3             ;;     esac          :      And here is the result of "strace /etc/init.d/privoxytor start"               execve("/etc/init.d/privoxytor", ["/etc/init.d/privoxytor", "start"], [/* 22 vars */]) = 0     brk(0)                                  = 0x161c000     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95c7000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY)      = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=98415, ...}) = 0     mmap(NULL, 98415, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4df95ae000     close(3)                                = 0     access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)     open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY) = 3     read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\357\1\0\0\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=1595408, ...}) = 0     mmap(NULL, 3709016, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f4df9020000     mprotect(0x7f4df91a0000, 2097152, PROT_NONE) = 0     mmap(0x7f4df93a0000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x180000) = 0x7f4df93a0000     mmap(0x7f4df93a5000, 18520, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4df93a5000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ad000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ac000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4df95ab000     arch_prctl(ARCH_SET_FS, 0x7f4df95ac700) = 0     mprotect(0x7f4df93a0000, 16384, PROT_READ) = 0     mprotect(0x7f4df95c9000, 4096, PROT_READ) = 0     munmap(0x7f4df95ae000, 98415)           = 0     getpid()                                = 2698     rt_sigaction(SIGCHLD, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     geteuid()                               = 0     brk(0)                                  = 0x161c000     brk(0x163d000)                          = 0x163d000     getppid()                               = 2697     stat("/etc/privoxytor", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0     open("/etc/init.d/privoxytor", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 10     close(3)                                = 0     fcntl(10, F_SETFD, FD_CLOEXEC)          = 0     rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGINT, {0x40f270, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     rt_sigaction(SIGQUIT, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGQUIT, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGTERM, {SIG_DFL, ~[RTMIN RT_1], SA_RESTORER, 0x7f4df90524f0}, NULL, 8) = 0     read(10, "#! /bin/sh\n### BEGIN INIT INFO\n#"..., 8192) = 5094     write(1, "privoxytor\n", 11privoxytor     )            = 11     write(1, "/usr/sbin/privoxytor\n", 21/usr/sbin/privoxytor     )  = 21     write(1, "/var/run/privoxytor.pid\n", 24/var/run/privoxytor.pid     ) = 24     write(1, "privoxytor\n", 11privoxytor     )            = 11     write(1, "/etc/privoxytor/config\n", 23/etc/privoxytor/config     ) = 23     geteuid()                               = 0     stat("/usr/sbin/privoxytor", {st_mode=S_IFREG|0755, st_size=273616, ...}) = 0     faccessat(AT_FDCWD, "/usr/sbin/privoxytor", X_OK) = 0     faccessat(AT_FDCWD, "/etc/default/privoxy", R_OK) = -1 ENOENT (No such file or directory)     stat("/var/log/privoxytor", {st_mode=S_IFDIR|0750, st_size=6, ...}) = 0     open("/lib/init/vars.sh", O_RDONLY)     = 3     fcntl(3, F_DUPFD, 10)                   = 11     close(3)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     read(11, "#\n# Set rcS vars\n#\n\n# Because /e"..., 8192) = 1228     stat("/etc/default/rcS", {st_mode=S_IFREG|0644, st_size=620, ...}) = 0     open("/etc/default/rcS", O_RDONLY)      = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "#\n# /etc/default/rcS\n#\n# Default"..., 8192) = 620     read(12, "", 8192)                      = 0     close(12)                               = 0     faccessat(AT_FDCWD, "/proc/cmdline", R_OK) = 0     pipe([3, 4])                            = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2703     close(4)                                = 0     read(3, "BOOT_IMAGE=/boot/vmlinuz-3.2.0-4"..., 128) = 95     read(3, "", 128)                        = 0     close(3)                                = 0     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2703     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2703     read(11, "", 8192)                      = 0     close(11)                               = 0     open("/lib/lsb/init-functions", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 11     close(3)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     read(11, "# /lib/lsb/init-functions for De"..., 8192) = 8192     read(11, " \" * Starting remote filesystem "..., 8192) = 3253     pipe([3, 4])                            = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2704     close(4)                                = 0     read(3, "/lib/lsb/init-functions.d/20-lef"..., 128) = 46     read(3, "", 128)                        = 0     close(3)                                = 0     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2704     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2704     faccessat(AT_FDCWD, "/lib/lsb/init-functions.d/20-left-info-blocks", R_OK) = 0     open("/lib/lsb/init-functions.d/20-left-info-blocks", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "# Default info blocks put to the"..., 8192) = 1093     read(12, "", 8192)                      = 0     close(12)                               = 0     stat("/etc/lsb-base-logging.sh", {st_mode=S_IFREG|0755, st_size=11, ...}) = 0     open("/etc/lsb-base-logging.sh", O_RDONLY) = 3     fcntl(3, F_DUPFD, 10)                   = 12     close(3)                                = 0     fcntl(12, F_SETFD, FD_CLOEXEC)          = 0     read(12, "FANCYTTY=0\n", 8192)          = 11     read(12, "", 8192)                      = 0     close(12)                               = 0     read(11, "", 8192)                      = 0     close(11)                               = 0     open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3     fcntl(1, F_DUPFD, 10)                   = 11     close(1)                                = 0     fcntl(11, F_SETFD, FD_CLOEXEC)          = 0     dup2(3, 1)                              = 1     close(3)                                = 0     stat("/sbin/start-stop-daemon", {st_mode=S_IFREG|0755, st_size=28152, ...}) = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2707     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 2707     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2707     dup2(11, 1)                             = 1     close(11)                               = 0     clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f4df95ac9d0) = 2708     wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2708     --- SIGCHLD (Child exited) @ 0 (0) ---     rt_sigreturn(0x11)                      = 2708     read(10, "", 8192)                      = 0     exit_group(0)


title: How to strip directory structure with command line (or script)

text: I have a large collection of files packed into a two-level directory structure with many, many, many folders. In other words, I have a folder with a great many subfolders in it. There are no subfolders in these subfolders, however, there are hundreds of files in them. What I would like to do is move all the files out of these subfolders into the directory that holds the subfolders. This is a limited resource system, so a way to do it without two copies of all these files having to exist at once would be amazing......


title: VSFTPD Virtual User Group

text: Currently I have a Running vsftpd server in a Cent OS Machine with virtual users. Users are authenticated using MySQL. The users has all the permissions in their home directory and they are jailed into their home directories. The current home directory is /home/vsftpd/username where username is the unique username for each user. It is working file. Now I want to create some new virtual or real users which will have another kind of home directories i.e. /var/www/html/username. I want to keep both types of users in the same server. I mean I need both the old users with the old home directories and new ones with the different home directories in the same vsftpd server. I have gone through many tutorial but found nothing. So please let me know if is it possible,if yes how?


title: How can I exit from read-only mode in Vim?

text: I opened a file in readonly mode; is there a way to get out of readonly mode?


title: Chrubuntu 12.04 Bluetooth not detecting devices

text: I have Chrubuntu running on an Acer c710. It seems like most people had Bluetooth working right away. I Am having a problem with it. The Bluetooth manager allows me to turn the adapter on and off, but I can't connect to anything. If I search from my phone I can't find the computer. If I search from the manager I can't find my phone, my headphones or my home stereo. I have tried the default manager, `blueman` and `bluedevil` extension to KDE. Nothing works. I know people have had this problem with the Realink card and have fixed it by going into Windows and turning it on there but there is no option to turn it on in Chrome OS. Besides, it's not a Realink card. I opened it up and the card says Atheros model #: ar5b22. It's a combo wifi Bluetooth card. Any help would be greatly appreciated.


title: Incremental system backup and restore w/ rsync or rdiff-backup issues

text: I've been reading about using rsync and rdiff-backup to make incremental backups of my entire Linux system. I am planning to practise that by setting up a Linux system, making some changes to it, erasing everything and restoring the system (all with the convenience of doing it in a virtual machine). But I want to clarify a few things before taking the plunge:   1. How do I get fine control about what gets included in and excluded from the backup? i.e. by default would everything (including invisible "." files, trash, etc.) be backed up? If so, how can I exclude some of them?   2. The rdiff-backup tutorial tells you how to retrieve a file from an arbitrary time in the past (as long as you still have the backup). What if I want to restore the complete system on a new computer? How do I do that?   3. Suppose I make backups of my system on machine A. A few years later I buy a new computer B, and want to restore my system from the backup of machine A. Since the hardware might be totally different, will my new system work when I try to start it up after the restore? How can I ensure a smooth restore onto a new machine? Thanks for your answers.


title: Adobe Flash App based Linux Distro

text: What would be the best way to create a small Linux image that just runs a single Flash SWF on startup (full screen)? Are there distros catered to something like this, or is my best bet manually slimming down an image and then adding something into one of the startup scripts? Also, what's the best way to run an SWF outside of a browser? gnash? swfdec? other?


title: Can other users view the arguments passed to a command?

text: If I invoke a command with arguments like so:               bob@bob-pc:~$ command -arg1 -arg2      ...can other users view the arguments passed to the command?


title: How to find speed of wlan interface?

text: I'm trying to find speed of network interface using file-descriptor. It's easy to do it for `ethX`, just calling `cat /sys/class/net/eth0/speed`. Unfortunately this method doesn't work with wireless interface. When I call `/sys/class/net/wlan0/speed` I get error: invalid argument. So, do you know any `/sys/class/net/eth0/speed` like analog for wlan interface?


title: Detecting Physical Network Addresses Reliably

text: I'm trying to find a way to list physical (aka MAC) addresses for all network cards/interfaces attached to a certain host. The problem is, I want this functionality on my Debian live (squeeze) USB image which is plugged into many different boxes with widely diverse hardware. So the wireless driver (for example) isn't always available on my USB stick, and thus I can't obtain the physical address from `ifconfig`. I was under the impression that I could achieve this by querying `/sys/class/net/*/address` where `*` is the interface name in question. But this is not the case. I think there should be a way of querying the hardware for the physical address even if the device driver is not installed. So my questions are:   1. Is it actually possible to query the physical address of a network device even if its device driver isn't installed?   2. If it's possible, how?


title: What methods are used to encrypt passwords in /etc/passwd and /etc/shadow?

text: A careful examination of the `/etc/passwd` and `/etc/shadow` files reveal that the passwords stored are hashed using some form of hashing function. A quick Google search reveals that by default, the passwords are encrypted using DES. If an entry begins with `$`, then it indicates that some other hashing function was used. For example, some entries on my Ubuntu machine begin with `$6$`... What do the various numbers represent?


title: Who's consuming my inotify resources?

text: After a recent upgrade to Fedora 15, I'm finding that a number of tools are failing with errors along the lines of:               tail: inotify resources exhausted     tail: inotify cannot be used, reverting to polling      It's not just `tail` that's reporting problems with inotify, either. Is there any way to interrogate the kernel to find out what process or processes are consuming the inotify resources? The current inotify-related `sysctl` settings look like this:               fs.inotify.max_user_instances = 128     fs.inotify.max_user_watches = 8192     fs.inotify.max_queued_events = 16384


title: ssh to a new user in ubuntu

text: I created an user in ubuntu and now I want to do ssh with that user. I'm able to do ssh but I'm not getting in the shell:               myUserName@myMachineName:path$      I just get:               $      And I don't see the path where I'm standing or been able to get last commands. I'm not sure how is this called or how to look for it on the internet. That's why I prefer to ask here. ![enter image description here](http://i.stack.imgur.com/xDOoP.png)


title: Run Ubuntu 10.04 LTS with Apache2 SSL with passphrase

text: I am setting up a Virtual Machine with Ubuntu 10.04 Lucid Lynx Server. I have been reading the section on setting up Apache with an SSL certificate within the book : "Beginning Ubuntu LTS Server Administration - 2nd Edition" Contrary to the official documentation, the book advises to always use a 'pass phrase' when setting up Apache with SSL (to protect your reputation if the private SSL key is compromised). If you set-up a 'pass phrased SSL key' then you are required to type a pass phrase each time you start Apache. This is a slight problem if Apache starts up automatically when Ubuntu boots up. On page 338 it then offers a tip to prevent Apache from starting up at boot time. > ...To ensure that it doesn't start automatically, enter the line > `NO_START=0` in `/etc/default/apache2` I have modified that `/etc/default/apache2` file accordingly, rebooted and Apache2 is still trying to start-up upon boot. The `NO_START=0` line seems to have no effect. As I look through forums on the web, it seems that most people have issues and then end up skirting the problem by simply using a certificate without a pass phrase. Does anyone know the the best practice method of preventing Apache from starting up at boot time for a passphrased secure _SSL'd Apache_?


title: Uncopyable 5GB file, BTRFS

text: I have a 5.3GB tar file, located on a BTRFS partitioned eSATA drive. When trying to copy the file to another disk, or expand the tar the process seems to freeze. No errors are generated, and waiting doesn't seem to bear any fruit. When booted from this eSATA (64bit OS) I manage to copy no more than 12MB of the file, and when booted from another drive(32bit OS) I copy 361.4MB ( before freezing).


title: What happens the most, context switches or mode switches?

text: Which happens the most, context switches or mode switches? I have two answers myself, but I do not know which one is correct:   1. Context switches happen in user mode, but this does not mean that a system call is needed; therefore, mode changes do not happen when a context switch occurs.   2. Context switches mean a dispatch is needed. I think this is privileged, so a mode change from user to kernel mode is needed to do a context switch. Which means a context switch goes along with a mode switch. Anyone have a definite answer to this?


title: Stream grep from subprogram, not tail file

text: Does a simple one liner exist for grepping continuous output from a program rather than just a file? Now just as an example, I would like to skip lines containing `PHPUnit` in them. For obvious reasons the following gist does not do that:               phpunit tests/cases | grep -v --line-buffered "PHPUnit"      Can it be done as a universally usable oneliner, without user defined functions and so?


title: Does bash support forking similar to C's fork()?

text: I have a script that I would like to fork at one point so two copies of the same script are running. For example, I would like the following bash script to exist:               echo $$     do_fork()     echo $$      If this bash script truly existed, the expected output would be:               <ProcessA PID>     <ProcessB PID>     <ProcessA PID>      or               <ProcessA PID>     <ProcessA PID>     <ProcessB PID>      Is there something that I can put in place of "do_fork()" to get this kind of output, or to cause the bash script to do a C-like fork?


title: Why does Linux scale so well to different hardware platforms?

text: Why does Linux run well on so many different types of machines - desktops, laptops, servers, embedded devices, mobile phones, etc? Is it mainly because the system is open, so any part of it can be modified to work in different environments? Or are there other properties of the Linux kernel and/or system that make it easier for this OS to work on such a wide range of platforms?


title: Why do some regex commands have opposite intepretations of '\' with various characters?

text: Take, for example, this command:               find . -regex ".*\.\(cpp\|h\)"      This will find all the .h and .cpp files in your directory. The period character '.' in regular expressions usually means "any character". To get it to match only an actual period, you must escape it using the backslash character '\'. In this case, given a character with a special meaning, you must escape it to get the actual character it represents. Now, take the parenthesis and the "or" bar, being characters '(', ')', and '|', respectively. These also have special meanings, used for grouping regular expressions. However, to get the special meaning, the characters must be escaped using the backslash! Without the backslash, the characters have the meaning of the actual character it represents. Why is the '.' treated differently from '(', ')', and '|'?


title: If I change permissions on a tar file, will that apply to the files inside it?

text: I have a script that runs regularly via `cron`, that creates a `tar.gz` file for the purpose of backing up a directory. For reasons beyond my control, the only user who can execute the script via `cron` is a root user. So the resulting `tar` file can not be moved or deleted by any other user. So, as part of the script, I want to execute a `chown` and `chmod` on the `tar` file so that other users can manipulate it. But is it good enough to just change permissions on the `tar` file, or will the root user permissions also be saved to the files inside the `tar`? When a user unpacks the `tar` file, will they be able to act on those files as if they created the files themselves?


title: Why is this scp command creating a directory one level up?

text: I am trying to copy a file from one machine to another machine via ssh. Both machines are Ubuntu servers. Both machines have exchaged keys so that they can log into each other without passwords. The command I have looks like this (details changed for privacy, of course):               scp -i /var/www/place/.ssh/id_rsa file.tar.gz otherserver@000.000.000.000:directoryName/file.tar.gz      However, every time I run it, I get this error:               Could not create directory '/var/www/.ssh'.     Host key verification failed.     lost connection      It seems like the `scp` command is trying to create a directory called `.ssh` one level up from `place`. What's going on here? Does scp need to create some kind of temporary directory in order to execute? The user account that is running the command has read/write permissions within /var/www/place, but not /var/www, so how do I get this scp command to run? _(Please be aware I am not very experienced with Linux command line stuff, so please make answers verbose and simple. Thanks for your understanding.)_


title: Spawn 6 windows in 2 rows in the i3 window manager

text: How can I bind a key that spawns (via the `exec` command) six terminal windows? I managed to figure out how to do this, but all windows were on one row. What I would like to have is that 3 on top and 3 on bottom. Like this,                _ _ _ _ _ _ _ _ _ _ _ _ _ _ _     |         |         |         |     |    T1   |   T2    |    T3   |     | _ _ _ _ | _ _ _ _ | _ _ _ _ |     |         |         |         |     |    T4   |   T5    |    T6   |     | _ _ _ _ | _ _ _ _ | _ _ _ _ |           This is for the i3 window manager.


title: How to display server's TLS certicicate details in terminal?

text: Having TLS certificate in local file, I can display its details using syntax like: `openssl x509 -text -noout -in cert_filename` Is there any way to display remote SMTP/POP3/HTTP server's TLS certificate in this same format in bash terminal?


title: AIX 6.1 starting xhost + from inittab at the boot time

text: Everytime after restarting the servers, I have to run `xhost +` from console prompt. Does anyone have any idea about enabling `xhost +` from `inittab` file?


title: How can I get the output and test the dig command?

text: when we type " dig +short www.example.com " command we get something like that:               www.example.com.     192.168.1.1     192.168.1.2     192.168.1.3      I want to get the first address and test it if it is what I want to (192.168.1.1) How can I get the output of this command, especially the second line by using shell script ?


title: Ubuntu: How to configure DNS servers in /etc/network/interfaces correctly for resolvconf?

text: All examples I have seen of configurations (`/etc/network/interfaces`) showed that you configure an interface and then underneath that gave the `dns-*` lines such as:               auto eth0     iface eth0 inet static             ...             dns-nameservers 127.0.0.2             dns-search example.com my.example.com      Now I am aware that the DNS protocol is independent of the transport mechanism. Therefore it shouldn't be per-se wrong to add an IPv6 address on the `dns-nameservers` line. However, since I am also configuring the interface for IPv6 anyway, it made sense to add the `dns-nameservers` line there:               iface eth0 inet6 static             ...             dns-nameservers ::2             dns-search example.com my.example.com      ... or did it? Because when `resolvconf` creates `/etc/resolv.conf` it simply ignores all the IPv6 DNS servers. It also seems to ignore `dns-search` and `dns-domain`. The only line it seems to honor is the `dns-nameservers` line from the IPv4 configuration for `eth0`. What is the correct method of configuring DNS servers? * * * Further circumstantial evidence as to why it should be part of each respective `iface` stanza. Quote from `man 8 resolvconf`: > The `ifup(8)` program can be used to configure network interfaces according > to settings in `/etc/network/interfaces(5)`. To make `ifup` push nameserver > information to `resolvconf` when it configures an interface, add `dns-` > lines to the relevant `iface` stanza in `/etc/network/interfaces`. To add > nameserver addresses add a line beginning with `dns-nameservers`.


title: Is there a system command, in Linux, that reports the endianness?

text: Does anyone know of a command that reports whether a system is Big Endian or Little Endian, or is the best option a technique like this using Perl or a string of commands? _Perl_               # little     $ perl -MConfig -e 'print "$Config{byteorder}\n";'     12345678          # big     $ perl -MConfig -e 'print "$Config{byteorder}\n";'     87654321      _od | awk_               # little     $ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'     1          # big     $ echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}'     0      ### References   * Perl Config documentation - byteorder


title: Vim alerts after a few seconds when no event occurred

text: I use Vim in a tmux session, and recently I've noticed that Vim is raising an alert after a few seconds when I switch to another tmux window. Nothing has happened in Vim after I move windows - usually I do some edits and write the file with `:w` and then move in tmux. A few seconds later Vim alerts and tmux flashes that Vim needs attention. Why is Vim being so needy? How can I prevent this? ### Update #1 Output from `:au FocusLost` as requested:               :au FocusLost     --- Auto-Commands ---     Press ENTER or type command to continue      Links to `.vimrc` and `.tmux.conf`:   * .vimrc   * .tmux.conf ### Update #2 Using versions Vim 7.3 and tmux 1.6. This whole thing is happening when in an SSH session where tmux is running. I switch away from the Vim window using tmux keys `Ctrl+A` `Ctrl+N` as per the tmux conf.


title: Why can't a regular user delete a btrfs subvolume

text: Using a loop-mounted user created btrfs filesystem, with the permissions set correcly, a user is able to freely create btrfs subvolumes:               user@machine:~/btrfs/fs/snapshots$ /sbin/btrfs sub create newsubvol     Create subvolume './newsubvol'      However, trying to delete the newly created subvolume results in an error:               user@machine:~/btrfs/fs/snapshots$ /sbin/btrfs sub del newsubvol     Delete subvolume '/home/user/btrfs/fs/snapshots/newsubvol'     ERROR: cannot delete '/home/user/btrfs/fs/snapshots/newsubvol'      The root user, of course, is able to delete it:               root@machine:/home/user/btrfs/fs/snapshots# /sbin/btrfs sub del newsubvol     Delete subvolume '/home/user/btrfs/fs/snapshots/newsubvol'      This difference in behavior between the create and delete operations seems a bit strange. Can anyone shed some light on this? Here is the exact sequence of commands:               user@machine:~$ dd if=/dev/zero of=btrfs_disk bs=1M count=100     100+0 records in     100+0 records out     104857600 bytes (105 MB) copied, 1.2345 s, 84.9 MB/s     user@machine:~$ mkdir mountpoint     user@machine:~$ /sbin/mkfs.btrfs btrfs_disk          WARNING! - Btrfs Btrfs v0.19 IS EXPERIMENTAL     WARNING! - see http://btrfs.wiki.kernel.org before using          SMALL VOLUME: forcing mixed metadata/data groups     Created a data/metadata chunk of size 8388608     fs created label (null) on btrfs_disk         nodesize 4096 leafsize 4096 sectorsize 4096 size 100.00MB     Btrfs Btrfs v0.19     user@machine:~$ sudo mount btrfs_disk mountpoint/     user@machine:~$ cd mountpoint/     user@machine:~/mountpoint$ /sbin/btrfs sub create test     Create subvolume './test'     user@machine:~/mountpoint$ /sbin/btrfs sub delete test     Delete subvolume '/home/user/mountpoint/test'     ERROR: cannot delete '/home/user/mountpoint/test' - Operation not permitted      Here are the permissions:               user@machine:~/mountpoint$ ls -la     total 4     drwxr-xr-x 1 user user    8 Set  4 09:30 .     drwx------ 1 user user 4486 Set  4 09:29 ..     drwx------ 1 user user    0 Set  4 09:38 test      And the relevant line on `df -T`:               Filesystem              Type     1K-blocks      Used Available Use% Mounted on     /dev/loop0              btrfs       102400        32     98284   1% /home/user/mountpoint      The distro is a Debian Wheezy, `3.2.0-4-686-pae` kernel, `v0.19` btrfs-tools. The situation still occurs on Ubuntu Saucy, `3.11.0-4-generic` kernel, `v0.20-rc1` btrfs-tools.


title: du (disk usage) and format specifier for file/directory sizes strings?

text: I am really fond of `du`, and I often like to use it like this:               $ du -hsc /var/mail/ /var/log/ 2>/dev/null      4,0K    /var/mail/     5,7M    /var/log/     5,7M    total      However, I'd like to be able to print out sizes in format "[bytes] [kbytes]K [mbytes]M"; and as far as I can see, I cannot do that:               $ du -hscb /var/mail/ /var/log/ 2>/dev/null     4096    /var/mail/     14734462    /var/log/     14738558    total          $ du -hsck /var/mail/ /var/log/ 2>/dev/null     4   /var/mail/     5764    /var/log/     5768    total          $ du -hscm /var/mail/ /var/log/ 2>/dev/null     1   /var/mail/     6   /var/log/     6   total          $ # all (b,k,m) here:      $ du -hscbkm /var/mail/ /var/log/ 2>/dev/null     1   /var/mail/     15  /var/log/     15  total      The k,b,m switches simply choose a block size, and then a prefix (K, M) is not even printed (and when you run them all together, you get some weird sizes reported). Any ideas if there is something like a size format specifier string for `du`? Many thanks in advance for any answers,   Cheers!


title: Partitioning scheme for a virtual machine host

text: I am planning to use an Ubuntu Server 12.04 with KVM to create 2 virtual machines. Reading some docs on the net, I have found that a good approach is to use LVM based VM, so my idea is to have:   * 1 ext2 partition for boot   * 1 LVG with 3 logical volumes: 1 for host, 1 for vm1 and 1 for vm2 Is this a good partitioning scheme? What factors do I need to consider?


title: How does iperf calculate throughput and jitter?

text: I've read that `iperf` basically tries to send as much information down a connection as quickly as possible reporting on the throughput achieved. This tool is especially useful in determining the volume of data that links between two machines can supply. Is it possible to gather the same results by sending regular data, as in not testing data? What I'm trying to do is this; sending data in the foreground while in the back ground gather statistics (throughput and jitter). So can anyone tell me how `iperf` calculates these two values ?


title: (L)ubuntu 12.04 syslog to custom file (not /var/log/syslog but /var/log/mylog) - ubuntu 12.04

text: I successfully tested the following syslog "hello world" example on ubuntu 12.04:               // gcc giuspexample.c -o giuspexample          #include <syslog.h>          int  main(int argc, char *argv[])     {         setlogmask(LOG_UPTO (LOG_NOTICE));              openlog("atm", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL0);              syslog(LOG_NOTICE, "Program started by User %d", getuid ());         syslog(LOG_INFO, "A tree falls in a forest");              closelog();         return 0;     }      and I can read the entry in /var/log/syslog. I followed the instructions on http://www.codealias.info/technotes/syslog_simple_example on how to change the destination filepath               echo "local0.*  /var/log/mylog" >> /etc/syslog.conf      but trying to run               sudo /etc/init.d/syslog restart      doesn't work (command not found) and rebooting the pc anyway doesn't start to write on /var/log/mylog but still on /var/log/syslog. Does anybody know what's wrong? Thanks.


title: View temporary files which exist for milliseconds

text: I'm trying to debug a program which is not logging the information I need. Fortunately, it does write temporary files which should contain the information. These files are written to a directory like: `program/temp/{someGUID}` on one of ten machines. Neither `{someGUID}` nor which machine will contain the temp files is known in advance of the run. After the run is complete, the temporary files are deleted. The time from beginning to end is too fast for manual intervention. I kick off the runs through a client program, but it is the server which writes the files. I am unable to manipulate the server program and once a run is kicked off I am unable to stop it. I do have root access to the all the machines on which the temp files could be written. I'm running CentOS 6. Is there a way to allow the server user to write files to the temp directory but not remove them? It would probably crash the run, but it would give me the information I need. Is there a way to copy the contents of the temp folder right after they are written/before they are deleted? Must I install a program for recovery of deleted files?


title: Specify the sort order with LC_COLLATE so lowercase is before uppercase

text: Given the file:               $ cat file     1     a     C     B     2     c     3     A     b      By default `sort` will:               $ sort file     1     2     3     a     A     b     B     c     C      With `LC_COLLATE=C` so will sort in uppercase letter before lowercase:               $ LC_COLLATE=C sort file     1     2     3     A     B     C     a     b     c      Is it possible to get sort to reverse the case ordering, that is digits, lowercase then uppercase?


title: Configure UML to generate core file

text: The User Mode Linux (UML) I run on Ubuntu crashes occasionally, but does not generate any core file. I'd like to know the necessary configuration to be applied on UML so it generates a core when it crashes. Also, additional configuration which will ease the process of analyzing the core would be appreciated.


title: Checking existence of file with underscore in file name in zsh

text: I am writing a very simple script which will link shared configuration files. For some reason it does not behave as i expected for file with underscore in name. Does _ (underscore) means something special in zsh? The mentioned script as it is now:               #!/bin/zsh     STATIC_CONFIG_PATH="/opt/apps/config"     STATIC_CONFIG_FILES=("couchdb.yml" "database.yml" "elasticsearch.yml" "slurm_api.yml")               cd $1/config     ELEMENTS=${#STATIC_CONFIG_FILES[@]}     for (( i=0;i<$ELEMENTS;i++)); do       if [ ! -L ${STATIC_CONFIG_FILES[${i}]} ]; then         echo 'Linking '$STATIC_CONFIG_PATH'/'${STATIC_CONFIG_FILES[${i}]}         ln -s $STATIC_CONFIG_PATH'/'${STATIC_CONFIG_FILES[${i}]}       fi     done


title: Change view in emacs dired mode

text: What options are there to change the view of a directory in `emacs dired mode`? How to apply it? How can I change it on the fly? In particular I want to know:   * How to make it show the file sizes in human readable format (MB, GB, ...)?   * How to omit the permissions, owner and group in the list view?   * How to change appearance of symbolic links? (I want it to be displayed like regular files i.e. **_without_** the target, but in another color to indicate that they are links).


title: How to install a specific video driver on Fedora?

text: I need to install a compatible video driver on a Fedora machine. The resolution proportion isn't very well and I can't change the brightness and contrast (xbacklight and xgamma) either. Please answer me with a complete solution or a final successfully tutorial. Some information about the system is:               $ lspci | grep VGA     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     $ cat /etc/issue     Fedora release 17 (Beefy Miracle)     Kernel \r on an \m (\l)


title: How can I create a variable for just the Size, Used, and Available of df?

text: Say I want to create variables, one for each the size, used, and available when using df. How can I create variables for each? Is there an option that returns just one of these things?               directorySize=          directoryUsed=          directoryAvailable=      Say I want to create those variables based on the home directory. How would I do this?


title: Add item to inittab on OpenSuse 12.1

text: I am currently working on a project which needs to be added to `inittab` so that the program loads during startup. The program that I am trying to start is a c# mono application. I have created a start script and if the start script is run manually the program launches fine. However, when I put it into `inittab` the program doesn't launch. I've checked in `/var/log/messages` but it doesn't say anything is wrong, it just says that it is reloading. Below is what I have added to my `inittab` script               bes:2345:respawn:/home/bits/MyProgram/start.myprogram      Thanks for any help you can provide **UPDATE** Below is the code in the start script which is located in /home/bits/MyProgram.               #!/bin/sh          cd /home/bits/MyProgram          /usr/bin/mono EmailServer.exe "$@"      I have also tried adding > mylog.txt onto the end of the line beginning with /usr/bin/mono e.g. > /usr/bin/mono EmailServer.exe "$@" > mylog.txt If I run the start script manually, even if I am not in the directory where the start script is located it works fine, its just when I add it to inittab and run telinit q it never starts and the log isn't written to but the log does get written to if I start the program manually. Thanks for any help you can provide.


title: Setting up ad-hoc in Debian with DHCP?

text: I made a quick search and found a doc that showed me a way to setup ad-hoc. Only problem is that I need this to work with my phone (WP7) and I'm not able to set a static IP on the phone so I need the debian machine to dish out IPs when clients connect to it :-) How can I set up a ad-hoc network that also gives out IPs? Pref in some range too :)


title: Losing (realtime) permission when sudoing from root to myself

text: After an upgrade to debian wheezy (I did not upgrade the kernel - it is still 3.8.2) I can no longer start jackd in the way I used to do it. I get `you are not allowed to use realtime scheduling`. My investigation show, that this is related to a `sudo` command in my script, where I sudo from root to martin. The sudo is required, because I start jackd when my firewire mixing console gets switched on, using an udev rule. I can reproduce the problem by typing sudo from the commandline. In short, this is what I observe   * start jackd as martin -> works   * start jackd as root -> works   * login as root and `su - martin`, then start jackd -> works   * as root `sudo -u martin /usr/bin/jackd ...` -> does not work   * as above but `sudo -E -u martin ...` -> does not work My /etc/security/limits.conf contains these lines               @audio - rtprio 40     @audio - nice -20     @audio - memlock 1554963      `sudo -u martin id` shows that I am in the audio group, however root is not. After sudoing from root to martin, martin has no realtime permissions               sudo -u martin sh -c "ulimit -e -r"     scheduling priority             (-e) 0     real-time priority              (-r) 0      Adding root to the audo group made no difference. Root still has no realtime permissions and after `sudo -u martin` martin still looks as above


title: Why is /etc/passwd open to public for reading?

text: Is there any reason that /etc/passwd should be world-wide readable ? It's not like password hashes that shouldn't be exposed, I just want to know why.


title: Wireshark packet dissection codes?

text: Hi all we have a system which could capture packets accordingly. The only problem now we need some codes on how to interpret the packet just like how wireshark does it so well. Anyplace we can get hold of how wireshark does it?


title: Chinese input in Linux Mint 13

text: I started to use Linux Mint 13 MATE a few days ago. What frustrates me most is that I can't found anywhere to change my input language. In Windows, it is easy, just `Ctrl`+`Shift`. How can I configure the input and switch between them? Specifically I need a Chinese Traditional Input - Quick.


title: How to get wireless access point information from MacOS terminal

text: I'm trying to gather information about surrounding access points but can't find the right tools to do that. For Linux there are tools like iwconfig and iwlist, but it looks like they are not available for MacOS.


title: Import single rows from SQLite to MySQL?

text: I need to do some kind of incremental import again and again from a SQLite 3 database to a MySQL database. Column names are the same in both databases. Is there a good way to do this by a script (therefore is there a good way to get the column values of one row as some kind of array/list, so I can really work with them?) or am I better off with a small C program? Update: OK, there is the -line option, giving one column value per line, result rows are then separated by an empty line. Still need to find a really simple way to parse this ;-)


title: Parsing SQLite output

text: Using -line Option I get this output from SQLite:               row1_column1 = valueA     row1_column2 = valueB          row2_column1 = valueC     row2_column2 = valueD      So one line for each column value and result rows are separated by a blank line. I need to get this output in a array or list containing               valueA,valueB     valueC,valueD      Additionally non-numeric (!) values shall be enclosed by ' and '. Any simple way to do this? Thanks for any hint!


title: Add info under specific line

text: I want to know how could I add files contain information under specific line in file. For example, I have `file1.txt` with the following lines:               line 1     line 2     line 3      and `file2.txt` has the information I want to add in `file1.txt` under specific in `line 2`. How could this to be done?


title: Compiling Android Image error: rebase-apply still exists but mbox given

text: I am building an android image on fedora, and I am running into some problems. I have done this before and had no issues. Does anyone know how to fix this problem?               error: bootable/bootloader/lk/: prior sync failed; rebase still in progress     !!!Error Downloading code!!!     Applying patches ...        applying patches on ./bootable/bootloader/lk ...      previous rebase directory /home/Max/workdir/APQ8074_M8974AAAAANLYA31050108_JB_V10/bootable/bootloader/lk/.git/rebase-apply still exists but mbox given.           FAIL: Current working dir:/home/Max/workdir/APQ8074_M8974AAAAANLYA31050108_JB_V10/bootable/bootloader/lk


title: Something very strange happen to my server today

text: If I type `cd ~username` it will say               Can't find /home2/username      Actually `~username` exists, in `/home3`, and it used to work. Nothing strange has happened. Somehow Linux thinks that all of my `/home2` files are in `/home3` and all my `/home3` files are in `/home2`. Yesterday it worked fine. Then I saw:                   root     pts/6        139.193.156.125  Thu Aug 29 05:48   still logged in         root     pts/5        ng1.cptxoffice.n Thu Aug 29 05:43   still logged in         root     pts/4        139.193.156.125  Thu Aug 29 05:35   still logged in         root     pts/3        139.193.156.125  Thu Aug 29 05:31   still logged in         root     pts/2        139.193.156.125  Thu Aug 29 05:12   still logged in         root     pts/1        139.193.156.125  Thu Aug 29 02:20   still logged in         root     pts/0        139.193.156.125  Thu Aug 29 01:34   still logged in         reboot   system boot  2.6.32-279.22.1. Wed Aug 28 17:00 - 05:48  (12:48)         reboot   system boot  2.6.32-279.22.1. Wed Aug 28 11:33 - 16:46  (05:13)         root     pts/0        139.193.156.125  Mon Aug 26 05:12 - 01:23  (20:11)         root     pts/0        139.193.156.125  Wed Aug 21 20:51 - 22:07  (01:15)         root     pts/1        139.193.156.125  Wed Aug 21 06:50 - 22:01  (15:11)      I do not know of the host `ng1.cptxoffice.net`. How do I tell linux that `~freemark` belong to `/home2` or `/home3`? I can temporarily fix the problem by putting a soft link from `/home2` to `/home3` and vice versa. But why this happened in the first place is beyond understanding.


title: Wrong PAM settings: successful login logged as failure

text: SERVER:/etc/pam.d # head -1 /etc/issue               SUSE LINUX Enterprise Server 9.4      SERVER:/etc/pam.d # cat login               #%PAM-1.0     auth requisite  pam_unix2.so    nullok     #set_secrpc     auth required   pam_securetty.so     auth required   pam_nologin.so     #auth    required   pam_homecheck.so     auth required   pam_env.so     auth required   pam_mail.so     #account required pam_tally.so deny=5 reset no_magic_root     account required    pam_unix2.so     password required   pam_pwcheck.so  nullok md5     password required   pam_unix2.so    nullok use_first_pass use_authtok md5     session required    pam_unix2.so    none     # debug or trace     session required    pam_limits.so      SERVER:/etc/pam.d # cat sshd               #%PAM-1.0     auth     required   pam_tally.so no_magic_root     auth     required       /lib/security/pam_unix.so   # set_secrpc     auth     required       /lib/security/pam_nologin.so     auth     required       /lib/security/pam_env.so     #account required pam_tally.so deny=5 reset no_magic_root     account  required       /lib/security/pam_unix.so     password required       /lib/security/pam_pwcheck.so     password required       /lib/security/pam_unix.so       use_first_pass use_authtok md5     session  required       /lib/security/pam_unix.so   none # trace or debug     session  required       /lib/security/pam_limits.so     SERVER:/etc/pam.d #      SERVER:/etc/pam.d #       SERVER:/etc/pam.d # faillog -u pamtest               Username   Failures  Maximum  Latest     pamtest           0        5  Thu Aug 29 13:35:15 +0200 2013 on localhost      SERVER:/etc/pam.d # ssh pamtest@localhost               pamtest@localhost's password:      Last login: Thu Aug 29 13:35:15 2013 from localhost     pamtest@SERVER:~> exit     logout     Connection to localhost closed.     SERVER:/etc/pam.d # faillog -u pamtest     Username   Failures  Maximum  Latest     pamtest           1        5  Thu Aug 29 13:39:40 +0200 2013 on localhost     SERVER:/etc/pam.d #       **Q:** Why does the system logs the successful login as failed login? "UsePAM yes" is in the sshd_config. (Does the order of the lines in the ex.: sshd file counts?)


title: Installed fonts not showing up, Linux Mint 15 64bit

text: I'm trying to install these bitmap fonts: http://font.gohu.org/ I downloaded the compressed PCF files and extracted them to /usr/share/fonts, Then ran `sudo fc-cache -fv`. The fonts weren't showing up in any program's font options. I tried the same but with true type fonts, same result. I tried using `~/.fonts` as my font directory, still no change I tried using Mint's inbuilt font installer (by double clicking on the font file), and it says Install Failed when I click on the Install button. I've tried renaming the `.pcf.gz` files to .pcf but with the same results. I tried doing all of the above and then rebooting my system and I still cant see the fonts in any programs. Any help would be appreciated.


title: Why does apt-get remove only a few kB?

text: I installed nginx (`sudo apt-get install nginx`) and then removed it with `sudo apt-get remove nginx`. I to need ensure that the application is uninstalled and cannot run. (I'm still able to run `service nginx start` without error in `nginx\error.log`). I wonder why only 90kB was removed when I downloaded several megabytes? What am I doing wrong?


title: how to know the type of symmetric encryption used by ssh?

text: I want to know the type of symmetric encryption (after authentication) used by ssh in a connection client-server. I'm not sure who determines the encryption. Client or Server?. I have looked in `/etc/ssh/ssh_config` (on client) and `/etc/ssh/sshd_config` (on server) and nothing.


title: Swedish unicode characters in xdm / xlogin

text: I decided to localize my XDM login screen but I'm stuck with corrupted Swedish characters. ![enter image description here](http://i.stack.imgur.com/1EWIW.jpg) I'm using Debian Wheezy with the following `/etc/X11/xdm/Xresources`               Xcursor.theme: whiteglass          xlogin*login.translations: #override \             CtrlR: abort-display()\n\             F1: set-session-argument(failsafe) finish-field()\n\             Delete: delete-character()\n\             Left: move-backward-character()\n\             Right: move-forward-character()\n\             Home: move-to-begining()\n\             End: move-to-end()\n\             CtrlKP_Enter: set-session-argument(failsafe) finish-field()\n\             KP_Enter: set-session-argument() finish-field()\n\             CtrlReturn: set-session-argument(failsafe) finish-field()\n\             Return: set-session-argument() finish-field()          !xlogin*greeting: V\303\244lkommen till CLIENTHOST     xlogin*greeting: Välkommen till CLIENTHOST     xlogin*namePrompt: Användare:     !xlogin*fail: Fel l\303\266senord!     xlogin*fail: Fel lösenord!          !xlogin*greetFace:       Inconsolata:size=16     !xlogin*face:            Inconsolata:size=14     !xlogin*promptFace:      Inconsolata:size=14     !xlogin*failFace:        Inconsolata:size=20     xlogin*greetFace -*-fixed-medium-r-*--*-200-*-*-*-*-iso8859-15     xlogin*failFace -*-fixed-medium-r-*--*-200-*-*-*-*-iso8859-15     xlogin*promptFace -*-fixed-medium-r-*--*-200-*-*-*-*-iso8859-15     xlogin*face -*-fixed-medium-r-*--*-200-*-*-*-*-iso8859-15          xlogin*borderWidth: 0     xlogin*frameWidth: 0     xlogin*innerFramesWidth: 0     xlogin*shdColor: grey30     xlogin*hiColor: grey90     xlogin*background: grey     !xlogin*foreground: darkgreen     xlogin*greetColor: black     xlogin*failColor: red     *Foreground: black     *Background: #fffff0          xlogin*logoFileName: /home/stemid/heart.xpm     xlogin*useShape: true     xlogin*logoPadding: 10          XConsole.text.geometry: 480x130     XConsole.verbose:       true     XConsole*iconic:        true     XConsole*font:          fixed          Chooser*geometry:               700x500+300+200     Chooser*allowShellResize:       false     Chooser*viewport.forceBars:     true     Chooser*label.font:             *-new century schoolbook-bold-i-normal-*-240-*     Chooser*label.label:            XDMCP Host Menu from CLIENTHOST     Chooser*list.font:              -*-*-medium-r-normal-*-*-230-*-*-c-*-iso8859-1     Chooser*Command.font:           *-new century schoolbook-bold-r-normal-*-180-* `/etc/X11/xdm/Xsetup`               #!/bin/sh     #     # This script is run as root before showing login widget.     export LANGUAGE=sv_SE     export LANG=sv_SE     export LC_ALL=sv_SE          xsetroot -solid "#002b36"          sleep 10 && import -w root /home/stemid/.login_screen.jpg &     chown stemid:stemid /home/stemid.login_screen.jpg & Originally I was trying with sv_SE.UTF-8 in environment but both of those locales are activated in the Debian locale-gen. `~/.xsession`               export LANGUAGE=sv_SE     export LANG=sv_SE     export LC_ALL=sv_SE          test -f ~/.Xresources && xrdb ~/.Xresources          xsetroot -solid "#002b36"          xscreensaver -no-splash &     exec ratpoison I've also tried setting the locale in .profile. Debian generally requires no xorg.conf but I've created two files in `/etc/X11/xorg.conf.d`, one for the synaptics touchpad and one for font paths.               Section "Files"     ModulePath "/usr/lib/xorg/modules/"     FontPath "/usr/share/fonts/X11/misc/"     FontPath "/usr/share/fonts/X11/TTF/"     FontPath "/usr/share/fonts/X11/OTF"     FontPath "/usr/share/fonts/X11/Type1/"     FontPath "/usr/share/fonts/X11/100dpi/"     FontPath "/usr/share/fonts/X11/75dpi/"     FontPath "/usr/share/fonts/X11/misc/artwiz-aleczapka-se-1.3/"     EndSection I've also tried installing a font that specifically supported Swedish but I can't use it in Xresources using the line from xfontsel. xlsfonts lists all the fonts I expect to be there, including the new artwiz ones. It doesn't seem like a font issue to me, more like encoding. Additionally I have tried `dpkg-reconfigure locales` and restarted X with all three settings. That is the only three locales I have enabled, and tested each as the default.   * sv_SE   * sv_SE.ISO-8859-1   * sv_SE.ISO-8859-15   * sv_SE.UTF-8


title: Show only part of the line found by grep (but not the part that matches the pattern)

text: In `ifcfg-eth0`, I managed to grep "DEVICE=eth0" by using               grep "DEVICE=" ifcfg-eth0      But how can I grep pattern to show only "eth0"?


title: Making a bootable pendrive for custom kernel

text: I read the tutorials to make a mimalistic custom kernel from here and am able to boot it up as explained in the tutorial over a virtual machine using GRUB as the boot loader. I think it would be more fun if I could do the same over bare hardware using a bootable pendrive. That is use GRUB, pendrive and my Kernel executable to form a bootable pendrive and then boot into the kernel from this pendrive. **Q1.** I thought of using the normal procedure of how I make a bootable linux pendrive, but my kernel isn't really an iso image, its an elf format executable. Will the normal method work if I somehow convert my executable to iso format ? **Q2.** Any other ideas / link to some resource how I should proceed ? **P.S. :** Its NOT Linux kernel per-se, Its absolutely minimal kernel, no file system nothing. Just boots up, prints something on console and can handle keyboard events, thats it.


title: How do I recursively set the date created attribute to the date modified attribute on NTFS-3G?

text: In my first question, I asked how to get the "Date created" field in NTFS-3G. Now, that I know I can get the "Date created", I have started adding files onto my NTFS-3G partition and would like to set the "Date created" of each file to its "Date modified" value. Since this needs to be done on a whole repository of files, I would like to recursively apply it to a single directory on down. If I know how to do this for a single file, I could probably do the recursion myself, but if you want to add that in I would be more than happy.


title: Hidden ext4 partition?

text: Is there a way to hide an `ext4` partition from e.g `Thunar`? And the `open file/save` dialog , I think they come from the same source.


title: How can you trim mp3 files using `ffmpeg`?

text: Here is a Linux audio MP3 puzzle that has been bugging me for awhile: How to trim the beginning few seconds off an MP3 audio file? (I can't get `ffmpeg -ss` to work with either 00:01 or 1.000 format) So far, to do what I want, I resort doing it in a GUI manner which is maybe slower for a single file, and definitely slower for a batch of files.


title: No yum repos on Red Hat Enterprise Linux Server release 5.2 (Tikanga)

text: I have a Red Hat Enterprise Linux Server release 5.2 (Tikanga) system and there is only one repository named rhel-debuginfo.repo and it doesn't seem to work either. Could you point me out some default yum repositories needed for maintaining a development system (which includes svn, mvn, httpd, tomcat etc.) Thanks in advanced.


title: Bash script error: integer expression expected

text: I'm having a rather weird issue, I'm running a script (Bash) on multiple servers and it stopped working on one of the servers (works perfectly fine on all other servers). Here is the problem part of the script: (I did not write it myself, all credits go to "Rich") (http://www.notrainers.org/monitoring-memory-usage-on- linux-with-nagios-and-nrpe/)                   if [ "$result" -lt "$warn_level" ]; then     #Line 56         echo "Memory OK. $result% used."         exit 0;     elif [ "$result" -ge "$warn_level" ] && [ "$result" -le "$critical_level" ]; then  #Line 59         echo "Memory WARNING. $result% used."         exit 1;     elif [ "$result" -gt "$critical_level" ]; then   #Line 62         echo "Memory CRITICAL. $result% used."         exit 2;     fi      Complete error message:               ./check_memory.sh: Line 56: [: 7.: integer expression expected          ./check_memory.sh: Line 59: [: 7.: integer expression expected          ./check_memory.sh: Line 62: [: 7.: integer expression expected      If you need more info, let me know and I will try to supply it as fast as possible. Appreciate all inputs :)


title: Different UID/GID when using an ext4 formatted USB drive with another computer

text: The problem of using a filesystem like `ext4` on a USB stick or memory card is that when it's mounted into another system the disk's UID/GID might not be present. Can this be fixed with a mount option?


title: Configuring a VPN in my CentOS server

text: My server runs `CentOS 6.2`. It has two network cards (`eth0` and `eth1`). In my server I have installed `CoovaChilli` access controller software, that manages the LAN under it. This management is done through a tunnel that is created by `CoovaChilli`, and all clients from LAN connect to that tunnel. Now the problem is that I would like to create a VPN between that server and another remote client (or server). I need some help on doing this, taking in account that I'm new to the topic. I tried to follow VPN HOWTO tutorial, but it is old and some things I think are deprecated. Searching on Internet, I found that there are many ways to create a VPN - I mention just a few: `IPSec`, `OpenVPN`, `CIPE` - and this confused me a little bit. My VPN will be created between my server that runs `CentOS` and another remote server that runs Linux also. **What I need:** some guidelines on how to achieve that working VPN. N.B. Any links on this topic are welcome!


title: MySQL server won't install to a new os (Debian, Ubuntu)

text: Today I wanted to install (on a new VPS with new OS) a MySQL server. I used this command:               apt-get install mysql-server mysql-common mysql-client-5.5      I tried with Debian 7 (x64 and x86) and Ubuntu 13.04 (x64 and x86). Every time I got this error message:               140223  9:37:33 [Warning] Using unique option prefix key_buffer instead of key_b     uffer_size is deprecated and will be removed in a future release. Please use the      full name instead.     140223  9:37:33 [Warning] Using unique option prefix myisam-recover instead of m     yisam-recover-options is deprecated and will be removed in a future release. Ple     ase use the full name instead.     140223  9:37:33 [Note] Plugin 'FEDERATED' is disabled.     140223  9:37:33 InnoDB: The InnoDB memory heap is disabled     140223  9:37:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins     140223  9:37:33 InnoDB: Compressed tables use zlib 1.2.7     140223  9:37:33 InnoDB: Using Linux native AIO     140223  9:37:33  InnoDB: Warning: io_setup() failed with EAGAIN. Will make 5 att     empts before giving up.     InnoDB: Warning: io_setup() attempt 1 failed.     InnoDB: Warning: io_setup() attempt 2 failed.     InnoDB: Warning: io_setup() attempt 3 failed.     InnoDB: Warning: io_setup() attempt 4 failed.      A video in which I'm trying to install Ubuntu: http://youtu.be/nULSfa0xZdU


title: sendmail error dsn=5.0.0, stat=Service unavailable

text: i have configured an sendmail configuration in ubuntu 12.04 64 bit machine when i'm send th email through a perl script it gives the below error                dsn=5.0.0, stat=Service unavailable      and mail is not been sent. i check on with other machine wherein its sending email and functioning as designed `dsn=2.0.0, stat=sent`.. can i know how to make it work or change setting for proper functionality.. the logs are :               Sep  2 17:38:12 mail sendmail[5522]: r82C8CpE005522: from=root, size=148, class=0, nrcpts=1, msgid=<201309021208.r82C8CpE005522@mail.server.local>, relay=root@localhost     Sep  2 17:38:13 mail sm-mta[5523]: r82C8CtA005523: from=<root@mail.server.local>, size=373, class=0, nrcpts=1, msgid=<201309021208.r82C8CpE005522@mail.server.local>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]     Sep  2 17:38:13 mail sendmail[5522]: r82C8CpE005522: to=suhaskekuda@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30148, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r82C8CtA005523 Message accepted for delivery)     Sep  2 17:38:16 mail sm-mta[5525]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=DES-CBC3-SHA, bits=168/168     Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: to=<suhaskekuda@gmail.com>, ctladdr=<root@mail.server.local> (0/0), delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=120373, relay=gmail-smtp-in.l.google.com. [173.194.79.27], dsn=5.0.0, stat=Service unavailable     Sep  2 17:38:19 mail sm-mta[5525]: r82C8CtA005523: r82C8JtA005525: DSN: Service unavailable     Sep  2 17:38:19 mail sm-mta[5525]: r82C8JtA005525: to=<root@mail.server.local>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent      etc/mail/access is               Connect:localhost       RELAY     GreetPause:localhost    0     ClientRate:localhost    0     ClientConn:localhost    0          Connect:127             RELAY     GreetPause:127          0     ClientRate:127          0     ClientConn:127          0     Connect:IPv6:::1        RELAY     GreetPause:IPv6:::1     0     ClientRate:IPv6:::1     0     ClientConn:IPv6:::1     0          # Defaults     GreetPause:             5000     ClientRate:             10     ClientConn:             10          Spam:postmaster@    FRIEND     Spam:abuse@     FRIEND     Spam:spam@      FRIEND          #Connect:0      REJECT whilst invalid, this also blocks sendmail -bs -Am     Connect:169.254 REJECT     Connect:192.0.2 REJECT     Connect:224     REJECT     Connect:255     REJECT


title: manipulate a Drush "internal" variable

text: I want to modify a variable (preferably in a Bash Script format) because my PHP environment requires a port number. To show a URL in Drush containing a token that logs you in as user 1 (without a password), you need to execute drush uli               $ drush uli      In a script:               bash-3.2$ VAR='drush uli'; echo ${VAR}; ${VAR}      outputs:               drush uli     http://website-7-26-2-17-res124725.local/user/reset/1/1393147909/zMiquSr_ikA7xdp7kA3g4CvTGd82mWsVdqEiMCs/login      I need to manipulate the variable VAR to add port 8088               http://website-7-26-2-17-res124725.local:8088/user/reset/1/1393147909/zMiquSr_ikA7xdp7kA3g4CvTGd82mWsVdqEiMCs/login      ..and then avoid Drush to open the URL but open the new URL with a browser instead:               VAR='drush uli';     read ${VAR}     # replace ".local" with ".local:8088"     ObjURL=${VAR//.local/.local:8088}     # open URL in browser      open ${ObjURL}      with the proper escaping. Can I modify that URL before Drush opens the browser and manipulate the URL when invoked from a Bash script?


title: Should tmpfs be unmounted at system shutdown?

text: Assume I have a linux system with the following partitions mounted (beside root):   * proc on **/proc**   * devtmpfs on **/dev**   * devpts on **/dev/pts**   * tmpfs on **/dev/shm**   * sysfs on **/sys**   * tmpfs on **/var/run**   * tmpfs on **/tmp**  What should I do before halt (very last script executed, just before issuing the halt command)? Should I umount all these filesystems, leaving only /dev and /proc mounted? May leaving these filesystems mounted cause any problem? Is there a best practice about this? UPDATE: I'm currently using sysvinit (latest) with own-written scripts.


title: How to mark "not fully installed" apt-get package as "successfully installed"

text: I have installed Debian 7.4 on my Iomega ix2-200 NAS, following this blog. The ix2-200 is running an ARM Marvel CPU and has a 128 MB NAND flash memory. The flash contains an initramfs image (uInitrd) and a kernel image (uImage) to boot the system. Sometimes, a new package (like `cryptsetup`) requieres to update the kernel and fails (`Unsupported platform`). I manually need to flash the new initramfs `initrd.img-3.2.0-4-kirkwood` and kernel `vmlinuz` via `mkimage`, which works fine. The (anoying) issue: everytime I run `apt-get upgrade` the system is showing up those unfinished packages. **How can I tell my system that everything is fine?** I have tried Google and StackExchange, but most of the posts are dealing with how to remove those unfinished/incomplete packages. I want to keep it! Please see attached code snapshot:               #> apt-get install cryptsetup     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following extra packages will be installed:       console-setup console-setup-linux cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data     Suggested packages:       dosfstools     The following NEW packages will be installed:       console-setup console-setup-linux cryptsetup cryptsetup-bin kbd keyboard-configuration libcryptsetup4 xkb-data     0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.     Need to get 3,179 kB of archives.     After this operation, 11.8 MB of additional disk space will be used.     Do you want to continue [Y/n]? y          ...          Processing triggers for initramfs-tools ...     update-initramfs: Generating /boot/initrd.img-3.2.0-4-kirkwood     Unsupported platform.     run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1     dpkg: error processing initramfs-tools (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      initramfs-tools     E: Sub-process /usr/bin/dpkg returned an error code (1)          #> apt-get upgrade     Reading package lists... Done     Building dependency tree     Reading state information... Done     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     1 not fully installed or removed.     After this operation, 0 B of additional disk space will be used.     Do you want to continue [Y/n]?


title: I Can't login as root with su command, but I can with SSH

text: How is it possible that I cannot log in as root by `su root` or `su` (I get incorrect password error), _but_ I can log in by `ssh root@localhost` or `ssh root@my_local_IP` with the same password? I'm using CentOS 6.4. * * * ### _Update1_ :               cat /etc/pam.d/su      gives:               #%PAM-1.0     auth        sufficient  pam_rootok.so     # Uncomment the following line to implicitly trust users in the "wheel" group.     #auth       sufficient  pam_wheel.so trust use_uid     # Uncomment the following line to require a user to be in the "wheel" group.     #auth       required    pam_wheel.so use_uid     auth        include     system-auth     account     sufficient  pam_succeed_if.so uid = 0 use_uid quiet     account     include     system-auth     password    include     system-auth     session     include     system-auth     session     optional    pam_xauth.so      ### _Update2_ :               $ sudo grep su /var/log/secure | grep -v sudo      gives :               Feb 23 13:12:17 fallah su: pam_unix(su:auth): authentication failure;     logname=fallah uid=501 euid=501 tty=pts/0 ruser=fallah rhost=  user=root      repeated about 20 times.


title: Linux re install order of events to include ffmpeg

text: Before I go ahead and wipe my whole system and start from scratch, is there a way I can avoid what just happened on trying to install ffmpeg? I still don't actually know the correct way to install it so it includes most functions which it DOES NOT on Centos 6.4 with STATIC version. My /etc/lb folder is a mess after the command ldconfig -v which created symlinks and they conflict all over the place. The /etc/yum.repos.d folder is also a mess and the script I followed in a linux blog makes no sense to me and started errors in first place. I'd like to avoid that altogether next time around...is there a way I can do that? In other words not play around with writing repo scripts or touching that folder..that is when all the trouble began! Better yet is there a safe method to employ that can be reversed? Starting to think Centos is a headache in as far as ffmpeg goes. Everyone else doing basic commands with it just downloads static version.


title: Taking output of /dev/tty into a variable

text: I created a two backup scripts - one for files (filebackup.sh) and another for database (dbbackup.sh). `filebackup.sh` calls `dbbackup.sh` and stores the output in a variable. The output returned by `dbbackup.sh` is the tar filename in which the script has stored all the backed up databases. The script `dbbackup.sh` contains the following at the end:               echo $TARFILE > /dev/tty      The script `filebackup.sh` calls dbbackup.sh like this:               DBBACKUP="`/scripts/dbbackup.sh &>/dev/null`"      This dumps all extra output from the script to /dev/null and ensures only the filename is returned. Everything works except when I call filebackup.sh, the filename is printed to screen. The variable `$DBBACKUP` remains empty. What am I doing wrong here?


title: How to configure hard drive

text: I have a hard drive that is not configured, it shows this in `fdisk -l`:               Disk /dev/dm-2: 107.4 GB, 107369988096 bytes      255 heads, 63 sectors/track, 13053 cylinders      Units = cylinders of 16065 * 512 = 8225280 bytes      Sector size (logical/physical): 512 bytes / 512 bytes      I/O size (minimum/optimal): 512 bytes / 512 bytes      Disk identifier: 0x00000000      How would I configure this, and mount it to `/var/t3`? Also how would I make it stay configured in case of a reboot? `dmsetup info /dev/dm-2` output:               Name:              tier3-tier3     State:             ACTIVE     Read Ahead:        256     Tables present:    LIVE     Open count:        0     Event number:      0     Major, minor:      254, 2     Number of targets: 1     UUID: LVM-9CdeuLeSVEJHBbjAJfFYRxxTfYYA0U5khb86NlUcyBAJC1JxP7FIhERCIoInYHLl


title: How to remove multiple newlines at EOF?

text: I have files that end in one or more newlines and should end in only one newline. How can I do that with Bash/Unix/GNU tools? Example bad file:               1\n     \n     2\n     \n     \n     3\n     \n     \n     \n      Example corrected file:               1\n     \n     2\n     \n     \n     3\n      In other words: There should be exactly one newline between the EOF and the last non-newline character of the file. ## Reference Implementation Read file contents, chop off a single newline till there no further two newlines at the end, write it back:               #! /bin/python          import sys          with open(sys.argv[1]) as infile:         lines = infile.read()          while lines.endswith("\n\n"):         lines = lines[:-1]          with open(sys.argv[2], 'w') as outfile:         for line in lines:             outfile.write(line)      Clarification: Of course, piping is allowed, if that is more elegant.


title: mysql different users access

text: I have six different sites set up with their respective databases on my server all linking to one localhost ip. Three of those users I set up from root have access only to the one database associated but the other three when show databases command reveal all databases. Not sure how that happened. How do I make it so each user has only access to respective database? Must have set them up differently but cannot remember how. It's a drupal multi-site and ultimately I'd like to have just one user and password to access all databases which I do have with root but for drupal settings each database has a necessary set user and pass and before I created individual ones I was making changes to one database which was effecting all else. So until I learn how to prefix them I am trying to keep all separate. Does it matter, what is the best practice - I don't know.


title: lz4 Kernel Module in CentOS without recompiling

text: I just installed CentOS 7 on a vServer to play around with. Usually I use Debian. Since I had good results, I want to use zswap. I enabled it by putting `zswap.enabled=1 zswap.compressor=lz4` in the `GRUB_CMDLINE_LINUX` in /etc/default/grub But it falls back to using lzo, because the CentOS 7 Kernel doesn't have the lz4 module, it seems. Is there any way to add this module without recompiling the whole Kernel? How would this work? Great would be some way to automate it on kernel updates, but that's not that important. (I only install updates manually and without the lz4 and lz4_compress modules nothing breaks, zswap just falls back to lzo) I want to stay as close as possible to using the package manager. A `yum upgrade`should still patch all fixed bugs.


title: What sudoer spec allows users to mount cifs shares?

text: I'm trying create a line in /etc/sudoers that allows members of group "users" to mount cifs shares anywhere inside their own home directory. In my first attempt I tried:               %users ALL=/bin/mount -t cifs /home, /bin/umount /home      ...which admittedly doesn't restrict them to their own home directory. As a user when I try the command:               sudo mount -t cifs ~/mount //hostname/sharename -o username=myuserid,domain=mydomain      ...I get prompted for the password then receive error:               Sorry, user myuserid is not allowed to execute '...command...' as root on servername.      Is there any way to coerce sudoers to specify what I want?


title: DPMS does not work: the monitor is not switched off

text: I have a monitor which was properly switched off by my Debian PC when unused. I attached it to another machine and, this times, it is never switched off. In `/etc/X11/xorg.conf`, I have:               Section "Monitor"             Identifier      "Generic Monitor"             Option          "DPMS"      It is recognized when X11 starts:               (II) Loading extension DPMS     ...     (II) VESA(0): DPMS capabilities: StandBy Suspend Off; RGB/Color Display     ...     (**) Option "dpms"     (**) VESA(0): DPMS enabled      The operating system is Debian 5 (Lenny). The graphics card is:               00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrate     d Graphics Controller (rev 02) (prog-if 00 [VGA controller])             Subsystem: Hewlett-Packard Company Device 2a6f             Flags: bus master, fast devsel, latency 0, IRQ 5             Memory at fe900000 (32-bit, non-prefetchable) [size=512K]             I/O ports at b080 [size=8]             Memory at d0000000 (32-bit, prefetchable) [size=256M]             Memory at fe800000 (32-bit, non-prefetchable) [size=1M]             Capabilities: [90] Message Signalled Interrupts: Mask- 64bit- Queue=0/0  Enable-Capabilities: [d0] Power Management version 2      X11 is:               X.Org X Server 1.4.2     Release Date: 11 June 2008     X Protocol Version 11, Revision 0     Build Operating System: Linux Debian (xorg-server 2:1.4.2-10.lenny2)     Current Operating System: Linux ludwigVII 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:3     8 UTC 2009 i686     Build Date: 08 June 2009  09:12:57AM


title: Atime value changing only once after file creation

text: I've mounted disk with explicit given value - atime:               mount -o mount -o atime /dev/disk1 /myDisk      then I've created a file by               touch file_A      after this operation stat output looks like that:               Access: 2013-08-30 11:38:48.141970758 +0200     Modify: 2013-08-30 11:38:48.141970758 +0200     Change: 2013-08-30 11:38:48.141970758 +0200      after `cat /myDisk/file_A` stat output changes but only once:                   Access: 2013-08-30 11:39:11.141970758 +0200         Modify: 2013-08-30 11:38:48.141970758 +0200         Change: 2013-08-30 11:38:48.141970758 +0200      and then doing cat multiple times doesn't change Access time value at all. What's wrong with that? Where this behavior coming from? I would expect that access time will change after every single cat operation on this file. Why it shows only the first access? (Mounting disk with noatime option causes another behavior, any of cat's changes access time in stat. Still remains equal to modify and change)


title: What are some decent alt-tab replacements for Gnome?

text: I think these problems bother me with the native alt-tab app:   * It feels a bit sluggish - it takes about 0.3 seconds for the alt-tab window to appear.   * I'd like to configure Alt-Shift-Tab to go one window backwards (not sure who to do this with the native one).   * I don't like how the **only** visible window is the window I'm switching too - I'd like a behavior similar to Windows' alt-tab.


title: how to run more than one program in a single script?

text: I have about 6 programs I want to run one after the other. They all are in different directories with their respective data. I would like help with a script that I can use to run each program in a specific order. This is because the output of the previous run is the input of the next run.


title: Is there any env variable to turn --color (and the like) on for all commands?

text: I do use aliases to turn on color for some commands by default. But I'm wondering if there's an easier way at telling my system, color is supported, don't make me use `\--color` for `grep`, `ls`, etc.


title: mod_rewrite returns a 301 OK, not Moved Permanently?

text: I recently set up monitoring for my mod_rewrite server with help in the question Bash - pattern matching across multiple lines. Every once in a while - I'm not sure what triggers it - I get a `HTTP/1.1 301 OK` instead of a `HTTP/1.1 301 Moved Permanently`. Why? This is currently causing my scripts to create a false positive. The rewrites are of the following form.               RewriteRule ^ http://www.mydomain.org%{REQUEST_URI} [R=301,L]      The rewrite rule is still working and I still eventually get a 200 code back from www.mydomain.org. I can update the regular expressions to match on a 301 OK but I'd really like to know why it would change. I'm running the latest release of CentOS 5 on the server if it matters.


title: Installing from mounted iso located on USB-HDD

text: I formatted my ~200GB HDD with RMPrepUSB to FAT32 and with syslinux bootloader. Used XBoot to "Create USB" with debian-6.0.6-amd64-netinst.iso inside. In linux.cfg it shows up as:               ### MENU START     LABEL -     MENU LABEL Debian 6 netinst x64 (debian-6.0.6-amd64-netinst)     LINUX /boot/syslinux/grub.exe     APPEND --config-file="ls /images/debian6x64netinst.iso || find --set-root /images/debian6x64netinst.iso;map --heads=0 --sectors-per-track=0 /images/debian6x64netinst.iso (0xff) || map --heads=0 --sectors-per-track=0 --mem /images/debian6x64netinst.iso (0xff);map --hook;chainloader (0xff)"     TEXT HELP     debian-6.0.6-amd64-netinst     ENDTEXT     ### MENU END      The problem is, when booting from it and trying to install, it refuses to continue install, as it "can't find CDROM". Could you explain me why is it happening and what should be done, to solve? PS: I want to create my universal USB-HDD, with many distros' inside, want to be able to boot from that and choose, which .iso to boot from, and XBoot looks just the piece of software, to achieve my needs.


title: When wouldn't one want `cp` to be recursive?

text: Under what conditions might one wish to use the `cp` command on a directory yet have it _not_ be recursive? Consider:               $ tree     .     └── old         └── inner             └── a.txt          2 directories, 1 file          $ cp old/inner/ .     cp: omitting directory `old/inner/'          $ tree     .     └── old         └── inner             └── a.txt          2 directories, 1 file      What did that do at all? So why would one ever not use the `-r` flag, and therefore why isn't it implied without specifying it? Note that the `-r` flag has no ill effect on regular files:               $ cp -r old/inner/a.txt .     $ ls     a.txt  old      I do realize that I could alias `cp` to `cp -r` but my goal is to understand what is the reason, not fix anything.


title: Samba test setup with only one physical box

text: I have CentOS 6.4 i386/686 installed on its own. I'd like to test out Samba 4 running as an AD DC. If I don't have another spare box to use in the lab, is it possible / does it make sense to install XP Pro on a VM within CentOS so I can test whether XP Pro clients will be able to make use of Samba's services OK? If so, is there anything special to consider with this setup, or would I just install KVM and follow something like this guide? (Or Xen?)


title: Boot partiotionless disk with syslinux

text: A file system can be configured to span a complete disk, omitting any partition table. Notice intentionally the command to do so does not use `/dev/sda1` but the raw, unpartitioned device instead.               mkfs.btrfs /dev/sda      The Idea is mentioned in the Arch Linux Wiki article about btrfs. I tried this in a virtual machine using a btrfs file system as only storage. It can even be booted from using grub, following the instruction in the wiki. ext3, ext4 and jfs also work that way. I only tested these, but most filesystem place the first block with an offset and thus leave enough space for a boot record. Now I would like to use syslinux instead of grub. The aforementioned wiki already indicates that this makes a dedicated placement of the `ldlinux.sys` neccessary, but does not include instructions to solve this. I highly suspect that the usual `mbr.bin` file would also not be appropriate, because it is normally responsible to read the partition table and find an active bootable partition. Now, there is not partition to be found. Does someone have any experience with using syslinux with a partitionless disk? Can a partitionless disk be booted using syslinux?


title: "Network unreachable" outside of LAN

text: I have a Linux server which runs several services (namely Minecraft :)). Recently, I've been having trouble getting it to connect to the Internet. For example:               root@fcwtech:~# ping google.com     ping: unknown host google.com      and               root@fcwtech:~# ping 8.8.8.8     connect: Network is unreachable      however,               root@fcwtech:~# ping 192.168.1.1     PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.     64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=10.8 ms      In case it helps, resolv.conf:               root@fcwtech:~# cat /etc/resolv.conf     # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)     #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN     nameserver 8.8.8.8     nameserver 8.8.8.4     nameserver 75.75.75.75     nameserver 75.75.76.76     search hsd1.va.comcast.net      and ifconfig:               eth0      Link encap:Ethernet  HWaddr 00:11:11:3e:05:b9                 inet addr:192.168.1.108  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::211:11ff:fe3e:5b9/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:2195 errors:0 dropped:0 overruns:0 frame:0               TX packets:657 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:172376 (168.3 KiB)  TX bytes:84343 (82.3 KiB)               Interrupt:16       My setup has been working perfectly previously. I made no configuration changes, and I'm really not sure what I should do at this point.


title: using grep to show entries that match a pattern and are present at least X times

text: I have a file that have entries like this among other lines               Feb 16 17:30:18 ns1 dovecot: pop3-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<accountin@myserver.com>, method=PLAIN, rip=200.250.9.210, lip=10.10.10.10, session=<Sed519rVnADI+gnS>      Every time one line like this is found, I want to extract the IPs associated on the rip part but I want to extract IPs that shows at least 3 times. I am trying to use grep to do this. This is the grep I have               more /var/log/maillog-20130217 | grep "auth failed" | grep -o '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4     ][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'       this grep shows all IPs that are in the matching lines How do I limit this grep to just show IPs if I have at least 3 matching lines with that IP and just unique IPs? I mean this. Suppose my log has this               Feb 16 17:30:18 ns1 dovecot: pop3-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<accountin@myserver.com>, method=PLAIN, rip=200.250.9.210, lip=10.10.10.10, session=<Sed519rVnADI+gnS>     Feb 16 17:30:18 ns1 dovecot: pop3-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<accountin@myserver.com>, method=PLAIN, rip=200.250.9.210, lip=10.10.10.10, session=<Sed519rVnADI+gnS>     Feb 16 17:30:18 ns1 dovecot: pop3-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<accountin@myserver.com>, method=PLAIN, rip=20.20.20.20, lip=10.10.10.10, session=<Sed519rVnADI+gnS>     Feb 16 17:30:18 ns1 dovecot: pop3-login: Disconnected (auth failed, 1 attempts in 17 secs): user=<accountin@myserver.com>, method=PLAIN, rip=200.250.9.210, lip=10.10.10.10, session=<Sed519rVnADI+gnS>      I would like to use grep and obtain 200.250.9.210 because I have 3 lines there with this IP, but not 20.20.20.20 that appears just one time. What I have when I run my grep I have is this               200.250.9.210     200.250.9.210     20.20.20.20     200.250.9.210      or in other words, it is listing all IPs that are in matching lines. thanks.


title: Accessing a SMB share without a password

text: When accessing SMB shared that are password-protected, `smbclient` works just fine. But when I'm trying to access shared that have no password protection (public shares), `smbclient` prints:               tree connect failed: NT_STATUS_ACCESS_DENIED      How can I access those shares? I'm trying to access Windows 7 from my Ubuntu 12.10


title: pkg: fail to extract pkg-static, New to UNIX

text: I am very new to UNIX, running FreeBSD 10 on an ASUS M50VM series laptop. I was following along with the handbook to the point at which it gets into using pkg to find software. Every time I run pkg, with or without options or arguments, I get the following output:               $ pkg     The package management tool is not yet installed on your system.     Do you want to fetch and install it now [y/N]: y     Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...     Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done     pkg: fail to extract pkg-static     $      My FreeBSD laptop is connected with an Ethernet cable to my router, which I know is providing Internet access, as the Windows desktop I am currently using to post this question is also connected with a similar cable to the same router. I tried searching for the error message on Google, but most of what I found appeared to be dealing with different problems from mine. What am I missing? What are possible causes of this issue? What should I check? Thank you!


title: Chromecast / Cubetek Ezcast with Linux computer?

text: I was pondering getting a Google Chromecast or Cubetek Ezcast the other day, mostly for its novelty and maybe using it as a media player or device to conduct presentations. The way they set up, with the whole DIAL technology seems a little weird to me, but that may or may not be due to the reason I've never seen it in action. I know however, that there are issues with some routers. This is a concern, as I have OpenWrt routers, only. I know the control app runs on Android, but what about my Linux laptop and/or desktop/workstation? I know Chrome uses a Chrome app, but is it gonna work if the client doesn't have a WLAN radio, but is otherwise connected to a wireless network access point (bridging both networks, mind you)? And what about OpenWrt, is it gonna work out of the box? * * * Now, there are at least two ways how I'd like to use the stick:   * As media player - pretty much in stand-alone mode, either playing streams off the internet   * As presentation dongle - so I can "take control" of any TV or projector featuring an HDMI port and use that for conducting a presentation or show a video, etc. Are my use cases even covered by that? The idea is not to attach it permanently to my home TV, but instead have it with me on the go. The form factor almost implies mobility, even though attaching power to it seems a bit weird. Both use cases should be covered by using my (Android) tablet, and Linux laptop. * * * In case I'm investigating the totally wrong cave, please suggest alternatives.


title: If a start-up script in `init.d` has standard output, where is that logged if anywhere?

text: We have a startup script that is symbolicly linked to `/etc/rc0.d/K01ourapp`. Apparently, it is not working as expected during shutdown. The script actually does a few `echo` calls that may help in troubleshooting. Where does that output get logged (if anywhere)? I am using RHEL5.


title: How to check which SSH keys are currently 'active'?

text: How might one check which .rsa, .pem, and other files are 'loaded' or 'active' by `ssh-add`? I just had this scare:               $ scp -i /home/dotancohen/.ssh/dotancohen.pem someUser@1.2.3.4:~/files.tgz .     Warning: Identity file /home/dotancohen/.ssh/dotancohen.pem not accessible: No such file or directory.     files.tgz                                                                100%   89MB   1.5MB/s   00:59     $ scp someUser@1.2.3.4:~/all_git.tgz .      files.tgz                                                                100%   89MB   1.7MB/s   00:54      After verifying that the server does in fact require the .pem key, I would now like to know which other keys are loaded without me knowing about it! Thanks.