title: How do I create a simple tmux conf that splits a window?

text: I'd like to create a simple tmux conf that does the follow.   1. Splits the window/pane/whatever_stupid_terminology horizontally (hsplit)   2. Opens in the top pane `tail -f foo`   3. Opens in the bottom pane `tail -f bar` How can I do this with tmux. This is what I've got,               #!/bin/sh     tmux new-session -s asdf -n myWindow     tmux select-window -t myWindow     tmux split-window "tail -f /var/log/apache2/samperror.log"      tmux attach-session -t asdf      I can't get anything thought to work. So I know it's all wrong. One of the most unintuitive conf files ever


title: Replacing shell variable names in another variable

text: I've been wrestling with `bash` variable substitution for a while now and can't figure this out... I have a variable with a command template:               CMD_TMPL='sudo -u ${USER_NAME} ${USER_HOME}/script.sh'      The variables `USER_NAME` and `USER_HOME` are figured out later in the script, not yet known at the time `CMD_TMPL` is defined. Therefore the command is in single-quotes and the are not yet substituted. Then the script figures out `USER_NAME=test` and `USER_HOME=/home/test` and I want to do something that will lead to `${CMD}` containing:               sudo -u test /home/test/script.sh      Further down in the script I will use that command in a pipe like:               ${CMD} | output-processing.sh      How do I achieve the expansion from variable names in `${CMD_TMPL}` to variable values in `${CMD}`? I tried all sorts of `echo`'s and `eval`'s but can't figure it out. Thanks!


title: Conditional crontab command in bash script

text: How do I invoke a crontab command so that I can schedule to run a script with a 20 minute delay based on some condition? Edit: What if I wanted a command that schedules a script to be executed only as many times as the condition evaluated to true in the system? What are my options?


title: How to run a command with a hidden password

text: I need to run a curl command that accesses a website that another person has the password to. e.g. `curl --basic --user myfriendsname:friendspassword http://www.updateinfo.com` I need a way where I can launch this script without being able to see my friend's password.


title: How does sh -e interact with &?

text: I'm using `sh` (`dash`) on Ubuntu (lucid) and the manpage has this to say about `-e`:                          -e errexit       If not interactive, exit immediately if any untested command fails.                                 The exit status of a command is considered to be explicitly tested                                 if the command is used to control an if, elif, while, or until; or                                 if the command is the left hand operand of an “&&” or “||” opera‐                                 tor.      What happens when a background command fails? And does `bash` behave differently in this respect?


title: Alternatives to XDialog

text: Are there any alternatives to XDialog? Ideally something that would support both X server and terminal interface.


title: Carriage return vs newline in vim

text: In vim, when I opened a file, I wanted to add two empty lines at the end of each current line. I used the following switch:               %s/$/\n\n/      Apparently, this does not work, but what does work is:               %s/$/\r\r/      I thought \r is a Windows feature? Would anyone be able to explain a bit more.


title: Ubuntu Trusty Preseed Error

text: I have a preseed file that installs Trusty but the install is giving me this error:               Jul 22 17:52:42 in-target: Setting up sysv-rc (2.88dsf-41+deb7u1) ...     Jul 22 17:52:42 in-target: info: Reordering boot system, log to             /var/lib/insserv/run-20140722T1052.log     Jul 22 17:52:42 in-target: error: Something failed while migrating.     Jul 22 17:52:42 in-target:      Jul 22 17:52:42 in-target: error: Unable to migrate to dependency based boot          sequencing.     Jul 22 17:52:42 in-target:      Jul 22 17:52:42 in-target: See       http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for     Jul 22 17:52:42 in-target: more information about dependency based boot       sequencing. To     Jul 22 17:52:42 in-target: reattempt the migration process run 'dpkg --     configure sysv-rc'.     Jul 22 17:52:42 in-target:      Jul 22 17:52:42 in-target: dpkg: error processing package sysv-rc (--      configure):     Jul 22 17:52:42 in-target:  subprocess installed post-installation script       returned error exit status 1     Jul 22 17:52:42 in-target: Errors were encountered while processing:     Jul 22 17:52:42 in-target:  sysv-rc     Jul 22 17:52:42 in-target: E     Jul 22 17:52:42 in-target: :      Jul 22 17:52:42 in-target: Sub-process /usr/bin/dpkg returned an error code      (1)     Jul 22 17:52:42 in-target:      Jul 22 17:52:42 in-target: Setting up sysv-rc (2.88dsf-41+deb7u1) ...     Jul 22 17:52:42 main-menu[219]: WARNING **: Configuring 'pkgsel' failed with       error code 100     Jul 22 17:52:42 main-menu[219]: WARNING **: Menu item 'pkgsel' failed.     Jul 22 17:52:56 main-menu[219]: INFO: Modifying debconf priority limit from         'high' to 'medium'     Jul 22 17:52:56 debconf: Setting debconf/priority to medium     Jul 22 17:52:59 main-menu[219]: INFO: Menu item 'save-logs' selected      Seems to me that 'something failed' is very vague. Does anyone have any idea what could have happened? I tried going into a shell and doing the `dpkg --configure sysv-rc` but dpkg isn't installed at that point I guess. Any help would be much appreciated!


title: seq - invalid floating point argument error

text: I have a file with many numbers, with each number on one line. My goal is to find the numbers that are missing. I'm trying to generate the sequence of all the numbers with `seq`               start=$(head -1 numbers.txt)     finish=$(tail -1 numbers.txt)     seq $start $finish > all_numbers.txt      I get the following error message               seq: invalid floating point argument: 4106     Try 'seq --help' for more information.      I'm baffled as 4106 is clearly not a floating point number. After this I plan to use diff to find the missing numbers. Can someone tell me why seq is behaving this way?


title: How do I run TinyWM inside Xephyr?

text: I'm trying to get into Window Manager hacking, so I found TinyWM and tried running it inside a Xephyr window. I tried:               Xephyr -screen 1024x768 :1 &     DISPLAY=:1 ./tinywm &     DISPLAY=:1 scite &      However, TinyWM disregards my setting of $DISPLAY and (I believe) just picks the default root window on display 0. How can I convince TinyWM to pick a different display and run nicely inside Xephyr so I can hack on it without dropping to terminal mode?


title: WD Advanced Format confusion

text: One of my _Hitachi DeskStar 7K160_ hard disks died today and the other one is not safe (has bad sectors) so I've ordered a new 1 TB WD Blue WD10EZEX. Apparently nowadays new hard disks come with this _Advanced Format_ technology. I don't know much about hard disk partitioning, cylinders, blocks, aligning &c. but as I read, wrong type of configuration can cause problems such as slower R/W speeds, loss of capacity &c. This is how I would like to partition the new drive: **win7(NTFS) | storage1 (NTFS) | swap | debian jessie (EXT4) | storage2 (EXT4)** * Should I just use Debian's partition manager (on _netinstall_ , I guess it's `gparted` based?) -as I always do- then install win7 **(64-bit)** and then install Debian and I should not encounter any problems? If not, should I worry about:   * What partition manager should I employ?    * This wiki suggest that I use GPT instead of MBR. But I have an old motherboard with BIOS, no UEFI. Can I use GPT at all?   * Is having windows on the same hard disk with Debian gonna screw things up?    * _**Just what is the correct procedure to partition this new hard disk?!_** *: The order of the partitions can be different if this order is gonna cause problems.


title: Making Netflix-desktop more stable

text: I've installed netflix-desktop as per the iheartubuntu Netflix Desktop app guide. It works for about 2 hours and then crashes, taking down my KDE window manager with it. How can I make Netflix stable? `uname -arv` gives `3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux` I have 8 GB of RAM and 4 GB of swap.


title: What speed should zsh connect to tmux at?

text: I think this is a tmux question, though it may be a zsh question, or a question relating to both. I SSH to a server from a Windows box using PuTTY. In the PuTTY configuration window, in the Data panel, I have terminal speeds set to "230400, 230400". At the server end, in my .zprofile, I have "stty speed 230400". When I enter "stty -a" at my zsh prompt, it shows **_"speed 230400 baud;"_** (among several other stty settings). When I log in to the server, I see (below a welcome banner) "230400" on a line by itself just above my shell prompt. I assume (somewhat uncertainly) from this that I am connecting at or close to that speed. So why is it that when I open tmux from my zsh prompt, just before the child zsh prompt appears (inside tmux), I see, on a line just above the child zsh prompt, "9600"? Do I need to -export- the **_"stty speed 230400"_** command that's in my .zprofile? I'm not sure I can do that (or I don't know how to do that), since **_"stty speed 230400"_** is not an environment variable setting. Or, can I / do I need to set from within tmux the speed at which the shell opens tmux? Or am I better off not trying to set these speeds at all? (The PuTTY manual says, for example, about its "terminal speeds" setting: _"This parameter does not affect the actual speed of the connection, which is always ‘as fast as possible’; it is just a hint that is sometimes used by server software to modify its behaviour. For instance, if a slow speed is indicated, the server may switch to a less bandwidth-hungry display mode._ _"The value is usually meaningless in a network environment, but PuTTY lets you configure it, in case you find the server is reacting badly to the default value._ *"The format is a pair of numbers separated by a comma, for instance, 38400,38400. The first number represents the output speed (from the server) in bits per second, and the second is the input speed (to the server)." _*_ * In any event, I find the "9600" odd. I also am not really sure if these supposed connection speeds have any real meaning or bear accurately on my real connection speeds. So, what is the source of the appearance of the "9600" speed indicator, and why that speed when all settings are at the higher number, and appear to be working at that higher number?


title: Is there a need for repeating rule parameters in iptables?

text: Let's say we need some ssh rules in iptables. But we also want to specify another chain for all the rules. We could use something like this:               iptables -t filter -N ssh     iptables -t filter -N tcp     iptables -t filter -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j tcp     iptables -t filter -A tcp -p tcp --dport 22 -m conntrack --ctstate NEW -j ssh     iptables -t filter -A ssh -p tcp --dport 22 -m conntrack --ctstate NEW -s 10.10.10.10/32 -m mac --mac-source 10:10:10:10:10:10 -j ACCEPT     iptables -t filter -A ssh -p tcp --dport 22 -m conntrack --ctstate NEW -s 11.11.11.11/32 -m mac --mac-source 11:11:11:11:11:11 -j ACCEPT      Do we have to specify all the options in each rule, or can this be omitted in lower chains? For instance, the final ssh rules could look like this:               iptables -t filter -A ssh -s 10.10.10.10/32 -m mac --mac-source 10:10:10:10:10:10 -j ACCEPT     iptables -t filter -A ssh -s 11.11.11.11/32 -m mac --mac-source 11:11:11:11:11:11 -j ACCEPT


title: how to nsupdate remotely?

text: I have BIND as a DNS server, what I want is to let this server to allow me to add or remove records to a zone without manually editing the zone file and I want to do this remotely. Is this updating need a key or something like that or can I do it using ssh connection like this:               ssh user@remote "nsupdate ..... " ;


title: Arch installation and swap partition

text: to install Arch on a PC I have to make partition of the HDD   * boot   * swap   * / The swap is used by virtual memory, right? What's up if I make a too small or a too big swap partition? Could I have as result some kernel panic?


title: I've tried twice to write a debian ISO to a cd-r but there are write errors. Are the disks ruined?

text: I know that in Windows I was able to format blank cd-r to work as USB so I'm wondering if I can still do that even though they have corrupted iso images burned onto them. (Right now I'm in Ubuntu) I'm using k3b to burn the images and both times I tried, the installation wouldn't complete because of problems with the disk. So now I have two useless debian installation disks lying around and I don't know how many more tries this is going to take. I'd like to be able to do at least something with them so I'm not just stacking up ruined cd-rs one after the other.


title: Method to perform DNS lookup step very quickly during wget

text: When I download any document from internet using **wget**. It shows maximum amount of time consumed in **getaddrinfo()**. I know **getaddrinfo()** used for DNS lookup. Tell me any method, so that this time is reduced to negligible, just like making any table for host name and their corresponding IP address, so that wget can get coresponding IP address very quickly. **Question** Tell me also, how can I implement this. Thanks in advance. Looking for your kind response. **Command, I use**               ltrace -c -o log_ltrace_wget_new1.txt wget http://www.ada.gov/briefs/kovacsbr.doc      **Output**               % time     seconds  usecs/call     calls      function     ------ ----------- ----------- --------- --------------------      67.11    7.070607      336695        21    select      19.67    2.071956        5739       361    strlen      10.59    1.115199     1115199         1    getaddrinfo       0.32    0.033705         298       113    fgets       0.27    0.028261         197       143    malloc       .....       .....       .....


title: Usb-ethernet device

text: I have CP210x Composite Device. This device is USB-to-RS232 converter. When I plug it into Ubuntu-11.10, module named `cp210x` get inserted but I don't know why it did not create "usb0" network device ( which is the desired result ). Does anyone knows, what is the process to make it work ? > lsusb > > Bus 004 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x > Composite Device


title: How can I turn off "middle mouse button paste" functionality in all programs?

text: I don't like having the middle mouse button paste, because I often end up with uncompilable code in Eclipse. How can I turn this off (in all programs)? I'm running Fedora.


title: Checking if an input number is an integer

text: I'm trying to check if an input is an integer and I've gone over it a hundred times but don't see the error in this. Alas it does not work, it triggers the if statement for all inputs (numbers/letters)               read scale     if ! [[ "$scale" =~ "^[0-9]+$" ]]             then                 echo "Sorry integers only"     fi      I've played around with the quotes but either missed it or it did nothing. What do I do wrong? Is there an easier way to test if an input is just an INTEGER?


title: Access a variable by name in udev?

text: I'm trying to get access to the partition type (the one-byte field in the master boot record) in udev, so that I can set ownership and permissions based on partition type. The challenge is of course that while I want to set the owner, etc. of `sda1`, the partition table is actually part of its parent, `sda`. (Of course, there are actually lots of disks, not just sda) I've managed to get the partition type of all the primary partitions imported into udev database entry each disk. This adds four ENV entries to each disk, one per possible primary partition. They look like this, as shown by `udevadmin info --query=all`:               E: LOCAL_PARTTYPE_P1=fd     E: LOCAL_PARTTYPE_P2=da     E: LOCAL_PARTTYPE_P3=00     E: LOCAL_PARTTYPE_P4=00      I can then get access to those in the partition device (sda1) by using an `IMPORT{parent}`. The partition number (1–4) can be found in `ATTR{partition}`. The problem is getting the type of _this_ partition. It seems like `ENV{LOCAL_PARTTYPE}="$env{LOCAL_PARTTYPE_P$attr{partition}}"` should do this, but it doesn't work. If you take off the leading $, the generated name is correct, udev just won't do the indirect lookup. The only way I've found to do it is this awkward line: `IMPORT{program}="/bin/sh -c 'echo LOCAL_PARTTYPE=$$LOCAL_PARTTYPE_P$attr{partition}'"` which works because ENV entries are passed as environment variables to programs udev runs, and thus the shell can do the expansion and echo it right back. I could also duplicate everything for each possible partition number (doable, since I'm only using primary partitions), but that strikes me as even worse:               $ATTR{partition}=="1", $ENV{LOCAL_PARTTYPE_P1}=="da", OWNER="grid", ...     $ATTR{partition}=="2", $ENV{LOCAL_PARTTYPE_P2}=="da", OWNER="grid", ...     ⋮      Is there a good way to do this?


title: Piping STDERR vs. STDOUT

text: According to "Linux: The Complete Reference 6th Edition" (pg. 44), you can pipe _only_ STDERR using the `|&` redirection symbols. I've written a pretty simple script to test this:               #!/bin/bash     echo "Normal Text."     echo "Error Text." >&2      I run this script like this:               ./script.sh |& sed 's:^:\t:'      Presumably, only the lines printed to STDERR will be indented. However, it doesn't actually work like this, as I see:                   Normal Text.         Error Text.       What am I doing wrong here?


title: Using OR patterns in shell wildcards

text: Contents of my dir are               $ ls -lrt     total 0     -rw-r--r-- 1 user1 admin 19 Oct  8 12:31 night.txt     -rw-r--r-- 1 user1 admin 19 Oct  8 12:31 noon.txt     -rw-r--r-- 1 user1 admin 38 Oct  8 12:31 day.txt      I would like to list out details of files that have a word in the filename as specified. ### Example :               $ ls -lrt *day|night*     ls: *day: No such file or directory     bash: night.txt: command not found      ### Expected output               -rw-r--r-- 1 user1 admin 19 Oct  8 12:31 night.txt     -rw-r--r-- 1 user1 admin 38 Oct  8 12:31 day.txt      How to list out different files matching 2 different partterns, or in short how to use regex with `ls`, so that I could `OR` the filename parts. Original scenarion, there are many file in the directory, have shortened the case for asking.


title: How to align applets on Gnome panel

text: Does anyone know how to align applets on Gnome panel? For example I add notification area and there's five icons (you see it on the left of processor icon). Then, I plug my BlueTooth adapter out of my laptop and it's logo disappears, leaving blank space on the right side of applet. Here's screenshot: ![alt text](http://i.stack.imgur.com/GhAaC.png) Same happens with any applet that's width can change (for example tray). Is there any way to tell applet "Move right as far as you can".


title: Embedding a cmap in moinmoin

text: I'd like to embed a cmap in a moinmoin wiki page. I generated the cmap using dia. I then copy pasted the generated html code, modified it to point to the png image I attached to the wiki. However when saving the whole map section disappears from the code. Does anyone has a pointer for me? Has someone already managed to use a cmap in MoinMoin? PS: not sure it's the correct forum for asking this, don't hesitate to point me somewhere else if not.


title: Why change default ssh port?

text: I've noticed lot of admins change default ssh port. Is there any rational reason to do so?


title: How to read the temperature of Tesla M2050?

text: NVML(nvidia-smi) does not support the temperature for this videocard nvidia-settings does not work, because it is a cluster node(with 3 gpus) and there is no X lm-sensors does not show gpus Ipmitool should do it (found example in google), but for me it shows               Temp 16 (GPU2)   | 1Fh | ns  | 11.3 | Disabled     Temp 17 (GPU3)   | 20h | ns  | 11.4 | Disabled     Temp 18 (GPU1)   | 21h | ns  | 11.5 | Disabled      is there any other command-line tools or library that can do it? thank you in advance for any advice Driver Version: 304.43


title: What to do if Cacti monitering server goes down in Centos 6.3?

text: I have successfully deployed cacti with plugins thold, nectar, realtime. Currently I am monitering my amazon ec2 servers and internal servers in my organization. but I afraid what to do In following situation if any aws server disconnect due to problem of bandwidth but still running , how can I get its snmp data later on while it was disconnected ? Is there any idea to store snmp data when no connection found and later send it to cacti ??? What should I do in such situations ? What to do if my cacti itself goes down ?


title: Ksh loses data after piping 16K bytes

text: I recently found that ksh may lose some data after printing more than 16K bytes to the stdout if it is blocked for a couple of seconds. This `test.sh` script prints out 257*64 (16448) bytes:               #!/usr/bin/ksh     i=0     while [[ i -lt 257 ]]     do         x=$(file /tmp)         echo "0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDE"         i=$((i+1))     done |     while read datafile     do         echo $datafile     done      I performed the following test:               0 $ ./test.sh | wc -c        16448     0 $ ./test.sh | (sleep 3; wc -c)        16384      The line `x=$(file /tmp)` seems to affect this behaviour although it does not pipe anything to the second loop. If I use bash, it works as expected. It looks like a bug to me in ksh. I am using Solaris 5.10. Is there a solution or workaround for this? What is the root cause of this issue? I guess it might be related to pipe buffer size. Thanks, Peter EDIT: So running the test with `truss`, I can see an error at writing the last 64 bytes:               ioctl(0, I_PEEK, 0x08046B40)                    = 0         Received signal #18, SIGCLD, in write() [caught]           siginfo: SIGCLD CLD_EXITED pid=6561 status=0x0000     write(1, " 0 1 2 3 4 5 6 7 8 9 A B".., 64)      Err#4 EINTR     lwp_sigmask(SIG_SETMASK, 0x00020000, 0x00000000) = 0xFFBFFEFF [0x0000FFFF]     setcontext(0x08046670)     read(0, 0x0809064C, 1)                          = 0     ioctl(0, TCGETA, 0x08046B18)                    Err#22 EINVAL      Running the same script with dtksh looks like below. As Stephane indicated, the failed write is reattempted.               ioctl(0, I_PEEK, 0x08046694)                    = 1     read(0, " 0 1 2 3 4 5 6 7 8 9 A B".., 64)       = 64     Received signal #18, SIGCLD, in write() [caught]       siginfo: SIGCLD CLD_EXITED pid=28276 status=0x0000     write(1, " 0 1 2 3 4 5 6 7 8 9 A B".., 64)      Err#4 EINTR     lwp_sigmask(SIG_SETMASK, 0x00020000, 0x00000000) = 0xFFBFFEFF [0x0000FFFF]     waitid(P_ALL, 0, 0x08046500, WEXITED|WTRAPPED|WSTOPPED|WNOHANG) = 0     waitid(P_ALL, 0, 0x08046500, WEXITED|WTRAPPED|WSTOPPED|WNOHANG) Err#10 ECHILD     sigaction(SIGCLD, 0x08046510, 0x08046580)       = 0     setcontext(0x08046430)     write(1, 0x080F0FD8, 64)        (sleeping...)     write(1, " 0 1 2 3 4 5 6 7 8 9 A B".., 64)      = 64     ioctl(0, I_PEEK, 0x08046694)                    = 0


title: Rygel slowing down my Debian system

text: Recently I noticed that a process called `rygel` is taking a lot of IO resources every time I am starting something on my home system. What is this process doing and how can I disable it?


title: Compress old log file into single zip-linux

text: I have a folder `/home/testuser/log` which contain log files of one day old `*.log`. I wish to compress all the log files older than one day to a single zip(gzip or tar.gz) and delete the older files. I tried to pipeline find and tar commands but didn't work


title: Ossec Installation Error

text: While installing Ossec Hids 2.6 on Redhat 5.5 installed on Virtual Machine, I got this error message. ![enter image description here](http://i.stack.imgur.com/xZsJl.png) ![enter image description here](http://i.stack.imgur.com/PHa2G.png) Whats wrong here.


title: No idea how to troubleshoot Bugzilla email issue

text: I'm a complete n00b when it comes to Bugzilla (and complex perl applications in general) so don't assume any level of knowledge in that area. If I haven't documented it in this post, assume I haven't done it. Basically I have a Bugzilla 4.2.4 install that is now unable to send email. It was able to send email without issue up until about a month ago (after about three months without issue). If someone posts a comment, a new bug or anything else that should generate an email, after they hit submit the following page takes forever to time out but eventually comes back with "Internal Server Error". Whatever they happen to be trying to do succeeds (bug gets created, file attached, comment posted, etc), so it appears that the problem is solely with generating the email. Following the official guide's advice for troubleshooting I've created any `errorlog` but the output is nebulous at best:               ---------------------------------------------------------------------------     [11817] 06/03/13 13:02:02 global/code-error.html.tmpl mail_send_error 127.0.0.1     [11817] $env(ANSI_COLORS_DISABLED) = 1;     [11817] $env(HOME) = "/root";     [11817] $env(LOGNAME) = "root";     [11817] $env(OLDPWD) = "/root";     [11817] $env(PATH) = "/usr/lib:/usr/sbin:/usr/ucblib";     [11817] $env(PWD) = "/var/www/bugzilla";     [11817] $env(SHELL) = "/bin/sh";     [11817] $env(SHLVL) = 1;     [11817] $env(USER) = "root";     [11817] $env(_) = "/var/www/bugzilla/whine.pl";          ---------------------------------------------------------------------------     [23266] 06/03/13 13:17:02 global/code-error.html.tmpl mail_send_error 127.0.0.1     [23266] $env(ANSI_COLORS_DISABLED) = 1;     [23266] $env(HOME) = "/root";     [23266] $env(LOGNAME) = "root";     [23266] $env(OLDPWD) = "/root";     [23266] $env(PATH) = "/usr/lib:/usr/sbin:/usr/ucblib";     [23266] $env(PWD) = "/var/www/bugzilla";     [23266] $env(SHELL) = "/bin/sh";     [23266] $env(SHLVL) = 1;     [23266] $env(USER) = "root";     [23266] $env(_) = "/var/www/bugzilla/whine.pl";      I've verified that SELinux isn't the issue by switching it into Permissive for the full duration of this troubleshooting, and I've created simple perl scripts that send my personal email account when invoked over Apache httpd. httpd's `error_log` doesn't have anything too interesting for this error:               [Wed Jun 12 13:21:20 2013] [warn] [client 152.xx.99.118] Timeout waiting for output from CGI script /var/www/bugzilla/post_bug.cgi, referer: http://bugs.xxx.edu/enter_bug.cgi?product=Banner%20INB     [Wed Jun 12 13:21:20 2013] [error] [client 152.xx.99.118] Premature end of script headers: post_bug.cgi, referer: http://bugs.xxx.edu/enter_bug.cgi?product=Banner%20INB      Basically, I'm unsure where to take it from here, I don't know how to get Bugzilla to give me more descriptive error information. I know that administratively I didn't change anything, there's plenty of processor time and storage space available, so I'm not sure why it all of a sudden broke. If it makes a difference this is on a RHEL5 machine with Perl 5.8.8 **EDIT:** Vote to close? It's pretty well on topic, unless you imagine many Windows admins deploy Bugzillas or all that many large Perl web applications. Bugzilla is as much a "Unix" question as asking how to export directories over NFS is (both are application-level network services whose deployment is largely concentrated in Unix environments).


title: issue with how newly made gnome launchers work vs launchers rebuilt after a system boot. (title change for clarity)

text: This isnt so much a request for help as a curiosity of mine. I wrote this script to quickly pop up four terminal sessions and fill my screen, since so many of my current systems have things that come in fours, and I'm a bit OC about terminal positioning if I'll be using them all heavily.               #!/bin/bash     #launch 4 terminals setup to fill my screen     gnome-terminal --geometry 116x27+0+600 &         gnome-terminal --geometry 116x27+0+0 &     gnome-terminal --geometry 116x27+1000+0 &     gnome-terminal --geometry 116x27+1000+600 &     exit      Now, this script works just fine for me. Nothing to write home about etc. The wierd thing is that pre-rebooting my system (solaris 11 x86) I was not putting the commands to the background (no & at the end). It worked perfectly pre reboot. In fact, it worked slightly faster before the reboot, when it was not sending the commands to bg. post reboot, without back grounding the commands, I get one terminal, and when I exit from that one, I get the next one and so one. That seems reasonable to me, but I am now very curious if anyone knows what might have been different about how the script was launched that made it work without having to & all the commands. Its as if before it was being launched as a normal shell script, and now the same launcher, executing the same script, is launching it as though I were typing in each command at a prompt. I've looked around the docs, and tried options to see if anything affects this, unfortunately, my main use for desktops is usually just to have multiple terminal sessions up, so I'm kind of clueless about gui desktops. One last bit of weirdness. I copied the original script (with no &) to another script name. Then made a brand new launcher, and it worked again. So then I rebooted again. But post reboot.. it no longer worked (opening them one at a time and only after the previous one has exited). Summary, before rebooting, this script didn't need the & to work, and now it does. Fresh made, this script works, but after a reboot it stops working. Why might this be? No changes were made to the system. If someone has intimate knowledge of how launchers get their information at boot time vs how they work when assembled on the fly, that would be very nice to know.


title: Installing Gnome on FreeBSD

text: I am trying to install Gnome on a freshly installed FreeBSD using the ports. I am stuck with an error message that says:   `Checking for headers required to compile python extensions ... not found`   Then it fails unexpectedly. I've tried to re-install python27 and that didn't help. What could possibly be the problem? **EDIT:**   I am running FreeBSD 9.1; I tried to install gnome by following the FAQ I simply `cd /usr/ports/x11/gnome2` then I ran `make install clean`and as for the configs, I left them unchanged; by checking `make config` I have two unselected options:   `XSCREENSAVER`   `MAPI` As for the output of `python2.7-config --includes` I got the following:   `-I/usr/local/include/python2.7 -I/usr/local/include/python2.7`


title: Can I install Mint but defer setting language, timezone, username/password, etc.?

text: Going the follow-your-nose route, I can take a Mint install medium, set up the language, timezone, username, password, etc. during the install process, and at the end when I'm done setting all these factors, and not before, I can remove the installation medium. Is there a straightforward way I can alter this workflow so that I completely install the system and then later have the end user specify all these details without needing the install medium?


title: How to remove disk from RAID1 without knowing the /dev/XXX name?

text: BEFORE:               SERVER:~ # mdadm --detail /dev/md5     /dev/md5:         Version : 00.90.00       Creation Time : Fri Mar 18 14:53:33 2011          Raid Level : raid1          Array Size : 67103360 (63.99 GiB 68.71 GB)         Device Size : 67103360 (63.99 GiB 68.71 GB)        Raid Devices : 2       Total Devices : 1     Preferred Minor : 5         Persistence : Superblock is persistent              Update Time : Mon May 27 21:32:01 2013           State : clean, no-errors      Active Devices : 1     Working Devices : 1      Failed Devices : 0       Spare Devices : 0                   Number   Major   Minor   RaidDevice State            0       8      129        0      active sync   /dev/sdi1            1       0        0       -1      removed            UUID : 5cd4bFe4:dd1b759f:b7e070fe:c44bfRef          Events : 0.36000940      ADDING A DISK TO RAID1:               SERVER:~ # mdadm --add /dev/md5 /dev/sdj1     mdadm: hot added /dev/sdj1      AFTER:               SERVER:~ # mdadm --detail /dev/md5     /dev/md5:         Version : 00.90.00       Creation Time : Fri Mar 18 14:53:33 2011          Raid Level : raid1          Array Size : 67103360 (63.99 GiB 68.71 GB)         Device Size : 67103360 (63.99 GiB 68.71 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 5         Persistence : Superblock is persistent              Update Time : Mon May 27 21:32:32 2013           State : clean, no-errors      Active Devices : 1     Working Devices : 2      Failed Devices : 0       Spare Devices : 1                   Number   Major   Minor   RaidDevice State            0       8      129        0      active sync   /dev/sdi1            1       0        0       -1      removed            2       8      145       -1      spare   /dev/sdj1            UUID : 5cd4bFe4:dd1b759f:b7e070fe:c44bfRef          Events : 0.36000955     SERVER:~ #       QUESTION: how can I remove this line/disk from md5?                      1       0        0       -1      removed      Probably this is the reason why /dev/sdj1 is marked as spare... I already tried to remove it:               SERVER:~ # mdadm /dev/md5 -r detached     mdadm: cannot find detached: No such file or directory     SERVER:~ #       OS: SUSE LINUX Enterprise Server 9.4 UPDATE: so can I remove a disk from an md* device using it's number? ( in this case the number would be "1" )


title: Synaptics Touchpad Tap Lag (FastTaps Option Gone)

text: I own an Asus Zenbook Prime UX31A with a clickpad. Under the Synaptics driver, I'm trying to use tap-to-click. With the default settings, there is a very noticeable lag between when I tap and the tap is registered. Usually, I just set FastTaps to true in:               /etc/X11/xorg.conf.d/50-synaptics.conf      However, in the latest version of xf86-input-synaptics, FastTaps is no longer an option. I can set "SingleTapTimeout" to 0, which does make tapping instant, but then double tapping is impossible. Is there some way to make tapping instant while allowing for double tapping (and other related functions like tap-and-drag) in the latest Synaptics driver?


title: Will a users password expire if I set the "maxexpired" to "-1"? [maxage not 0] - AIX

text: So under AIX 6, according to "lsuser" the user has the following settings:               maxexpired=-1     maxage=2      So this means that 2 weeks after the last password update of the user the password will expire, but because of the "maxexpired=-1" the password will never expire, and the user [that has for ex.: only FTP access] will not be locked out? I'm asking because I got two different descriptions for "maxexpired": "man" source #1: ![enter image description here](http://i.stack.imgur.com/XAmjM.png) "man" source #2:   > **maxexpired** > > Defines the maximum time (in weeks) beyond the maxage value that a user can > change an expired password. After this defined time, only an administrative > user can change the password. The value is a decimal integer string. The > default is -1, indicating restriction is set. If the maxexpired attribute is > 0, the password expires when the maxage value is met. If the maxage > attribute is 0, the maxexpired attribute is ignored. Range: 0 to 52 (a root > user is exempt from maxexpired)


title: What does aux mean in `ps aux`?

text: `ps aux` seems to conveniently list all processes and their status and resource usage (Linux/BSD/MacOS), however I cannot comprehend the meaning of parameter `aux` using `man ps`. What does `aux` mean?


title: How to get dual booting to work when using burg and two hard drives?

text: I have arch linux on one 250GB hard drive and windows 7 on another. I can boot into ArchLinux just fine, and I can boot into windows if I unplug the hard drive with Arch. But when I boot with both plugged in, I get the option of either linux or windows and when I choose windows I nothing happens. Now I know the problem is that the Windows hard drive needs to be tricked into thinking it is the primary hard drive. But I don't know how to do this using burg. So what do i need to edit to make this happen?


title: Rsync different behavior when syncing folders HDD-HDD or HDD-Ext HD

text: When I sync two folders between two HDDs, rsync only lists the changes made at the end. However if I sync a folder between a HDD and an external HD, while the sync is running it is listing each directory where it gets in. So at the end I have a "dirty" log about tasks made and I have to be filtering it. I would like to have a clean log also when syncing with the external HD, any idea? I'm using -av --delete. Examples where both directories are the same already:   * HD to USB:              rsync -av --delete A/ /media/USB/E/     sending incremental file list     ./     B/     B/C/     B/D/          sent 102 bytes  received 27 bytes  258.00 bytes/sec     total size is 0  speedup is 0.00        * HD to HD:              rsync -av --delete A/ /media/DATA/E/     sending incremental file list          sent 90 bytes  received 15 bytes  210.00 bytes/sec     total size is 0  speedup is 0.00


title: Best way to call command within a shell function having the same name

text: I like to encapsulate commands within shell-functions using the same name. But to avoid the shell-function calling itself recursively, I specify the complete path of the command as the following example:               less()     {         test 0 -lt $# && echo -ne "\e]2;$@\a\e]1;$@\a"     # Window title         /usr/bin/less -i -rS --LONG-PROMPT --shift 5 "$@"     }      But for some commands, I do not want to specify the path because it may change. I would prefer to use `$PATH`. For instance, my following attempt failed to call `mvn` command using backslash: `\mvn`               mvn()  # colorizes maven output     {             \mvn "$@" 2>&1 | #here: the shell-function recursively calls itself indefinitely             sed -u '                                                      s/^\[ALL\].*/\o033[1;37m&\o033[0m/       s/^\[FATAL\].*/\o033[1;31m&\o033[0m/       s/^\[ERROR\].*/\o033[1;31m&\o033[0m/     s/^\[WARNING\].*/\o033[1;33m&\o033[0m/        s/^\[INFO\].*/\o033[1;37m&\o033[0m/       s/^\[DEBUG\].*/\o033[1;36m&\o033[0m/       s/^\[TRACE\].*/\o033[1;32m&\o033[0m/'     }      **What is the best way to bypass this issue?**   Please do not suggest to use a different shell-function name. (I usually use `bash` but I am interested about other shell solutions.)


title: UFW: Allow traffic only from a domain with dynamic IP address

text: I run a VPS which I would like to secure using UFW, allowing connections only to port 80. However, in order to be able to administer it remotely, I need to keep port 22 open and make it reachable from home. I know that UFW can be configured to allow connections to a port only from specific IP address:               ufw allow proto tcp from 123.123.123.123 to any port 22      But my IP address is dynamic, so this is not yet the solution. The question is: I have dynamic DNS resolution with DynDNS, so is it possible to create a Rule using the domain instead of the IP? I already tried this:               ufw allow proto tcp from mydomain.dyndns.org to any port 22      but I got `ERROR: Bad source address`


title: File- and directory-based workflow

text: I work at a company where third party contributors transfer files, typically by FTP, to our site. Depending on which account the file is uploaded to, some scripts are triggered and the file is processed. Usually the file is transferred via FTP to another machine, that does a specific job on the file, and then we monitor a "finished" folder on the remote machine and transfer it back. The final stage of the job is to transfer the file to its long-term storage server. Today we have solved this with Windows and a software called RoboTask. It has done the work okay for now, but it is not very user friendly and hides a lot of the logic. I am looking for something that is:   * Maintainable for many workflows   * Modular, so that common jobs can be reused   * Visual, so that our less tech savvy employees can understand what is going on Any suggestions to this problem? I tried asking this question to Superuser, but was told it was off topic since I am asking for a software recommendation. If this is also the case in Unix & Linux, I am sorry, but could you tell me where it is appropriate to ask the question?


title: Issues with Skype, ia32-libs and Qt apps in elementaryOS

text: I just installed elementaryOS Luna. After updating my system, drivers etc. I added the Canonical Partners and installed skype immediatly. This worked just fine, but when I wanted to install apps such as VLC or Clementine, the software center tells me that I have to uninstall multiple libraries like ia32-libs (and ia32-libs-multiarch), some qt-libraries and Skype, which depends on these libraries. Installing this via the terminal (`apt-get and aptitude`) did unfortunately not help. By the way, here is a list of my repos:               http://archive.canonical.com/ubuntu     http://ppa.launchpad.net/versable/elementary-update/ubuntu     http://ppa.launchpad.net/elementary-os/stable/ubuntu     http://ppa.launchpad.net/elementary-os/os-patches/ubuntu


title: use search result in replace statement with vim substitute

text: I know this is gonna be a stupid question, but I've tried here, google and the official documentation. I've got a file with a whole heap of words of the form 'foo' and i want to change them to Literal('foo'). The following :s command `:%s/'.*'/Literal('.*')/gci` finds the things i want to change but then it replaces them all with Literal('.*') rather than Literal('foo')               Examples:     I get:     '_' -> Literal('.*')      'dog' -> Literal('.*')      I want:      '_' -> Literal('_')      'dog' -> Literal('dog')


title: Saving files on lost focus in Vim

text: I have been trying to setup the shell version of vim to save any changed files when the shell window loses focus. Following these instructions does not work. Even though I am using OS X, I figure this may be something that affects vim running on Linux as well. Could be wrong, but I thought I'd also try on here as well as apple.stackexchange.com. Am I to assume that maybe the reason why this does not work for a command line version of vim is because it's only intended to work with GUI versions, i.e. MacVim? Is there a way to get this to work for a shell version of vim? I'm using the latest version of vim available in homebrew.


title: Non-distro specific, linux tweaking, hacking and learning support IRC

text: Distro-specific support channels are good only if you run their clean stable versions out of the box and basically don't install anything other than what you get out of the box. But what about those who want to play around and experiment and learn a little bit more? I'm looking for a non-distro-specific channel that will offer support and troubleshooting advice for people who have hacked their machine to shreds. I am really having a hard time finding support and a positive atmosphere when it comes to experimentation.


title: sudo: unable to execute ./script.sh: no such file or directory

text: I'm stumped. I have a script in my `/home` directory which is executable:               [user@server ~]$ ll     total 4     -rwx------ 1 user user 2608 Jul 15 18:23 qa.sh      However, when I attempt to run it with `sudo` it says it can't find it:               [user@server ~]$ sudo ./qa.sh      [sudo] password for user:      sudo: unable to execute ./qa.sh: No such file or directory      This is on a fresh build. No changes have been made which would cause problems. In fact, the point of the script is to ensure that it is actually built according to our policies. Perhaps maybe it isn't and `sudo` is actually being broken during the build? I should also note that I can run `sudo` with other commands in other directories. EDIT: The script ( I didn't write it so don't `/bin/bash` me over it, please ;) )               #! /bin/bash          . /root/.bash_profile          customer=$1          if [ -z "$customer" ]; then                  echo "Customer not provided. Exiting..."             exit 1          fi          space ()     {     echo     echo '###########################################################################'     echo '###########################################################################'     echo '###########################################################################'     echo     }          g=/bin/egrep          $g ^Listen /etc/ssh/sshd_config     $g ^PermitR /etc/ssh/sshd_config     $g ^LogL /etc/ssh/sshd_config     $g ^PubkeyA /etc/ssh/sshd_config     $g ^HostbasedA /etc/ssh/sshd_config     $g ^IgnoreR /etc/ssh/sshd_config     $g ^PermitE /etc/ssh/sshd_config     $g ^ClientA /etc/ssh/sshd_config          space          $g 'snyder|rsch|bream|shud|mweb|dam|kng|cdu|dpr|aro|pvya' /etc/passwd ; echo ; echo ; $g 'snyder|rsch|bream|shud|mweb|dam|kng|cdu|dpr|aro|pvya' /etc/shadow          space          $g 'dsu|scan' /etc/passwd ; echo ; echo ; $g 'dsu|scan' /etc/shadow          space          $g ${customer}admin /etc/passwd          space          chage -l ${customer}admin          space          $g 'urs|cust|dsu' /etc/sudoers          space          $g dsu /etc/security/access.conf          space          $g account /etc/pam.d/login          space          /sbin/ifconfig -a | $g addr | $g -v inet6          space          echo "10.153.156.0|10.153.174.160|10.120.80.0|10.152.80.0|10.153.193.0|172.18.1.0|10.153.173.0"     echo     $g '10.153.156.0|10.153.174.160|10.120.80.0|10.152.80.0|10.153.193.0|172.18.1.0|10.153.173.0' /etc/sysconfig/network-scripts/route-eth1          space          cat /etc/sysconfig/network-scripts/route-eth2          space          netstat -rn | tail -1          space          cat /etc/sysconfig/iptables          space          cat /etc/hosts          space          ##file /usr/local/groundwork ; echo ; echo ; /sbin/service gdma status          ##space          cat /etc/resolv.conf          space          HOSTNAME=`echo $HOSTNAME | awk -F. '{ print $1 }'`          nslookup ${HOSTNAME}          echo     echo          nslookup ${HOSTNAME}-mgt          echo     echo          nslookup ${HOSTNAME}-bkp          space          /sbin/service rhnsd status ; echo ; echo ; /sbin/chkconfig --list rhnsd ; echo ; echo ; yum update --security          space          /sbin/service osad status ; echo ; echo ; /sbin/chkconfig --list osad          space          /sbin/service sshd status ; echo ; echo ; /sbin/chkconfig --list sshd          space          /sbin/service snmpd status ; echo ; echo ; /sbin/chkconfig --list snmpd ; echo ; echo ; echo ; cat /etc/snmp/snmpd.conf          space          df -h          space          cat /proc/cpuinfo | $g ^processor          space          free -g          space          if [ -f /etc/rsyslog.conf ]; then                  tail -3 /etc/rsyslog.conf          else                  echo "This system is not running rsyslog."          fi          rm -f $0


title: Rename Multiple files in unix

text: I have multiple files whose names look like this               2313_ABCDEAUG2014_PQRST_0_.pdf     3244_ABCDEAUG2014_PQRST_0_.pdf     4234_ABCDEAUG2014_PQRST_0_.pdf      t want to rename the file in the following format.               AZ-2014-08-2313.pdf     AZ-2014-08-3244.pdf      Please suggest.


title: How do I restart apache as non-root (using a git-hook)?

text: For one specific user I want to be able to restart Apache. This user does have sudo privileges and I could run `sudo /etc/init.d/apache2 reload`, but I want to include this restart script in a git post-receive hook. So this would prompt for the password and fail. So the question is: what is the proper way to allow this user to restart apache, without requiring sudo? I want to restrict option to only restarting Apache, and only this particular user.


title: What should I teach in my Linux class?

text: I'm teaching a basic Unix class using Ubuntu. We've already covered basic Unix stuff such as:   * bash shell scripting   * file and directory permissions   * filesystem hierarchy   * common commands I would like to give students some less academic, more real-world skills. Most of my students are headed toward network/system administration. We've got about a month left, with four hours a week of class. What should I teach and have the students practice? Here are some ideas:   * study and practice for certifications      * is CompTIA Linux+ a good beginner certification? Server+?   * cPanel   * Apache/PHP   * mail server with IMAP   * DNS server   * backups      * what backup software?


title: Xlib error "extension "GLX" missing on display" on VirtualBox guest OS

text: I have a remote build-machine with Jenkins and I'm trying to run GUI application. In Jenkins I installed Xvnc plugin, which uses TightVNC Server, but each build has failed. Earlier, there was a problem with loading driver swrast (by libGL), currently in the log there are this lines:               Xlib:  extension "RANDR" missing on display ":51".     (...)     Xlib:  extension "GLX" missing on display ":51".     Terminating xvnc.     $ vncserver -kill :51     Killing Xtightvnc process ID 22513      When I changed system to use Xvnc4server instead of tightvncserver, the output is:               [Warning] QXcbConnection: Failed to initialize XRandr     [Warning] Qt: XKEYBOARD extension not present on the X server.      (...)     [Warning] Unrecognized OpenGL version     [Warning] Unrecognized OpenGL version     Terminating xvnc.     $ vncserver -kill :47     Killing Xvnc4 process ID 26522      Remote desktop is Ubuntu 14.04 running over VirtualBox, so I installed VBoxAddons but it didn't resolve the problem. Below I'm putting some logs, maybe helpful for you.               $ cat /var/log/Xorg.0.log | grep GL -is     [266219.686] (II) LoadModule: "glx"     [266219.686] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/modules/extensions/libglx.so     [266219.687] (II) Module glx: vendor="Advanced Micro Devices, Inc."     [266219.687] Loading extension GLX     [266219.687] (==) Assigned the driver to the xf86ConfigLayout               $ lsmod | grep box     vboxsf                 43786  0      vboxpci                23194  0      vboxnetadp             25670  0      vboxnetflt             27613  0      vboxdrv               339502  3 vboxnetadp,vboxnetflt,vboxpci     vboxvideo              12658  0      vboxguest             248441  8 vboxsf     drm                   302817  1 vboxvideo          $ lspci | grep VGA     00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter          $ glxinfo      Error: unable to open display       Any ideas what should I do?


title: Install only a few GNU coreutils?

text: Is there a way to build and install only a few of the GNU coreutils? The README in coreutils-8.19.tar.xz lists 100-odd, but the INSTALL doesn't say how to install only a few, and the Makefile is (to me) opaque.


I have several Amazon EC2 servers and I'm using Chef to manage the configuration. I'd like to set the hostname so that the default bash prompt is more helpful. Right now after launching a new server it's just set as:               root@ip-10-123-123-123      Since I'm using Ubuntu 12 on these boxes I consulted the corresponding man page for hostname. It has a lot of good information on how to set it, and talks a little about the hostname and the fqdn, but it doesn't really tell me what I want to know: > What are the ramifications of setting the hostname? I'd like to assume that setting the hostname is mostly a convenience item for users and sysadmins, giving the box a face / nice-name so it can be more easily recognized internally (via the command prompt, e-mails that are sent, etc), but I'm not positive. I don't see the hostname listed in the `/etc/hosts` file, which appears to be a good sign that it won't affect anything negatively if changed:               127.0.0.1 localhost     # The following lines are desirable for IPv6 capable hosts     ::1 ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters     ff02::3 ip6-allhosts      Am I on the right track? What are the ramifications of setting the hostname? **Update** I tried changing the hostname on my ec2 instance from `ip-10-123-123-123` to `webserver` and `hostname --fqdn` no longer works. If I put it back then it works fine. Apache also gives me an error when starting that it can't reliably determine the fqdn. I suppose there must be some way to set the hostname without messing up the fqdn.


title: How to increase the memory used by Java in linux?

text: I have a program Vuze that is written in Java, which I use to download very large files, and I'm having a problem with it. I need to increase the amount of memory it uses. I've followed the directions for the application but it doesn't change the real memory usage. I would think this would then be because Java (JVM) is not set to support the amount of memory I set in the application. I both get errors about files missing and low memory. How can I increase the memory used by my Java Virtual Machine? My Java is Oracle. My system is Fedora 20 X86_64 KDE.


title: How to move all files and folders via mv command

text: How can I move all files and folders from one directory to another via mv command?


title: Tmpfs only with RAM

text: How to be sure that a `tmpfs` filesystem can only deal with physical and it's not using a swap partition on disk ? Since i have a slow HDD and a fast RAM i would like, at least, giving higher priority to the RAM usage for `swap` and `tmpfs` or disabling the disk usage for `tmpfs` related mount points. Thanks.


title: How do I dual-boot Kali Linux With ISO (no CD/USB/DVD)

text: I am trying to install Kali Linux 1.0.7 to my Windows 8.1 32-bit PC. I have the ISO, but I have no CD's, USB Sticks, or DVD in my home so I was wondering how can I install Kali Linux without CD/USB/DVD? I've tried UNetBootIn but that didn't work. So what do I do?


title: SSH Public key comment separator

text: I've created a SSH authentication key (with `ssh-keygen`) in two different servers, both with a useful comment, but the public key of one server has `==` between the key and the comment, while the other has no separator at all. Is this right?


title: service vsftpd restart : not working

text: I edited /etc/vsftpd.conf on my remote server. Now to restart the vsftpd, I ran               ravbholua@ravi:~$ sudo /etc/init.d/vsftpd restart     [sudo] password for ravbholua:      Rather than invoking init scripts through /etc/init.d, use the service(8)     utility, e.g. service vsftpd restart          Since the script you are attempting to invoke has been converted to an     Upstart job, you may also use the stop(8) and then start(8) utilities,     e.g. stop vsftpd ; start vsftpd. The restart(8) utility is also available.     vsftpd stop/waiting     vsftpd start/running, process 4658      The above command has already been executed and I see the system works as per the new change. Now looking at the above command output, I wanted to use service utility. So I changed the configuration file again and ran the below:               service vsftpd restart      But the above command didn't work (I came to know this as the system fails to behave as per the new change). Now when I enter the 1st command again , i.e.               sudo /etc/init.d/vsftpd restart      the system behaves as per the latest change. In nutshell, `sudo /etc/init.d/vsftpd restart` works but not `service vsftpd restart` Where am I mistaken in my thinking?


title: ftp: in remote machine, file owner changes with the change in username used for logging in the remote machine

text: It was a wonder for me to see why the file owner changes when I log in the remote machine with different usernames. Please see: 1st I logged in a remote machine using username : peacenews. I entered a directory (`pwd` outputs `/` as the directory) When I run `ls` to see the files there, I get the below: (I am only showing the last few lines of the output)               -rwx rwxrwx    1 peacenew 504      198311940 Oct  4 02:21 Rotary club ORC, Delhi .m2p      drwxrwxrwx    2 peacenew 504          4096 Sep 19 23:09 Vizianagaram, AP      -rwxrwxrwx    1 peacenew 504      296817474 Oct  3 10:30 dehradun-prem.VOB      226-Options: -l      226 18 matches total       Then I logged out and reconnected as anonymous user. This time also I logged in the same directory (having the same filenames) See the output of ls please (last few lines only):               -rwxrwxrwx    1 504      504      198311940 Oct  4 02:21 Rotary club ORC, Delhi .m2p      drwxrwxrwx    2 504      504          4096 Sep 19 23:09 Vizianagaram, AP      -rwxrwxrwx    1 504      504      296817474 Oct  3 10:30 dehradun-prem.VOB      226-Options: -l      226 18 matches total       Have a note at the 3rd column and compare with the previous one. Group owner for the files are the same but file owner changes. How come? It's a wonder!!!


title: Where does my web server serve files from?

text: I want to put files on my Arch Linux file server so that others can download them via HTTP. Where under `/var` should they be placed?


title: Check and fix all files from Debian packages.

text: I've been having some memory corruption issues, causing random crashes, but I've fixed them now. However, I'm concerned that some packages may be corrupted (as naturally any package update has to go through memory before it's written to disk). Is there any way to automatically checksum all of the package files on a Debian system, and compare them to the archives, and if they're incorrect, update them?


title: Switching output sink/moving audio streams - but some apps still use the old sink!

text: I'd like to easily switch between a usb-connected amplifier/dac and my onboard audio. I'm using a fully updated Arch Linux x64 with PulseAudio 4.0-2. Another thread on this board is about switching the output sink and moving active audio streams, see here. Using the accepted answer's script, albeit a little modified, I am able to switch back and forth between the amp/dac and my onboard audio, just as I would like. Equally as well, my audio streams are moved from the old sink to the new one. The problem is that not every application uses the new sink. For example: If I have a YouTube clip paused in my web browser and I switch the output sink and move all the audio streams, if I then unpause the clip, the audio will still be played via the old sink! It seems that moving audio streams is only about moving active - currently playing - audio streams. I thought that maybe audio streams that weren't playing was in some kind of suspended mode but still tracked by PulseAudio, and therefore movable, but it doesn't look that way. Probably for a reason, I don't really know since I'm not particulary familiar with how the sound system(s) work. But if I instead of using _pactl_ use the sound settings of _gnome-control- center_ to switch sink, every single application honors the newly-switched-to sink - even my web browser with a paused YouTube clip. **The question can probably be distilled to:** How can I, by using terminal programs like e.g. _pactl_ , make every application use my new sink for playing sound, just like _gnome-control-center_ does it? This includes programs that aren't currently playing some kind of sound, and therefore doesn't seem to have movable audio streams.


title: Do kernel threads seem to interfere with full tickless mode?

text: I'm trying to disable local timer interrupts for low latency. I have full tickless mode enabled in the kernel config and I have the boot parameter nohz_full set for the cores in question. However when I look at the interrupt count through /proc/interrupts I see the local timer interrupts counting up 1000 times a sec per core meaning full tickless isn't working. The tickless mode documentation says that for tickless to work that only one running process needs to be on that core. When I look at top, I see the following under a given core (core 1 in this example):                  19 root      RT   0     0    0    0 S  0.0  0.0   0:00.00  1 watchdog/1        20 root      -2   0     0    0    0 S  0.0  0.0   0:02.15  1 rcuc/1        21 root      RT   0     0    0    0 S  0.0  0.0   0:00.04  1 migration/1        22 root      -2   0     0    0    0 S  0.0  0.0   0:00.25  1 ksoftirqd/1        23 root      RT   0     0    0    0 S  0.0  0.0   0:00.00  1 posixcputmr/1        24 root      20   0     0    0    0 S  0.0  0.0   0:00.00  1 kworker/1:0        25 root       0 -20     0    0    0 S  0.0  0.0   0:00.00  1 kworker/1:0H      I do know that some of these are kernel threads. Are these the reason why my full tickless mode isn't working?


title: Installing GCC 4.6.3 on Fedora 18

text: I am trying to install GCC 4.6.3 on Fedora 18. I was following the instructions provided by Lars Rohrbach. When I run `make`, I get the error               /usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory     compilation terminated.      I read online that this is because of a missing library glibc, however glibc already is installed on my computer.               yum install glibc     Loaded plugins: langpacks, presto, refresh-packagekit     Package glibc-2.16-28.fc18.x86_64 already installed and latest version     Nothing to do      (Earlier I was experiencing a similar error when installing a program that required zlib and zlib also already exists.) Can someone please help me successfully install gcc 4.6.3? Thank you.


title: lintian and script-not-executable

text: I'm trying to make a `deb` package. But there is warning from lintian:               W: package: script-not-executable etc/package/hooks/script      It is a script, but noone executes it directly. I source it in another script.   Do I need to make it executable to pass lintian, or remove its shebang header?


title: Solaris: find the day of last Monday,Tuesday,...Sunday by means of shell script

text: I'm trying desperatly to find a bash or ksh routine that allows me to find for example the previous Monday,Tuesday,Wednesday,... preceding today's date. Additonal it has to work on plain vanilla Solaris X and I don't have the GNU date available. eg: Today = Thursday 2013/01/17 ; Let's say I want to find the last Monday. It has to return: 2013/01/14 I've managed to find a script on the net that does the job perfectly for all days except in this specific case: eg: Today = Thursday 2013/01/17 ; I want to find the last Thursday which should give as result: 2013/01/10 ; but instead I get todays date again. The script used was this:               #!/bin/ksh          #Get the nbr of the current weekday (1-7)     DATEWEEK=`date +"%u"`     #Which previous weekday will we need (1-7)     WEEKDAY=$1     # Main part     #Get current date     DAY=`date +"%d"`     MONTH=`date +"%m"`     YEAR=`date +"%Y"`     #Loop trough the dates in the past     COUNTER=0     if [[ $DATEWEEK -eq $WEEKDAY ]] ; then     # I need to do something special for the cases when I want to find the date of the same day last week       DAYS_BACK=168       DAY=`TZ=CST+$DAYS_BACK date +%d`       echo "DAY (eq) = $DAY"     else         while [[ $DATEWEEK -ne $WEEKDAY ]] ; do            COUNTER=`expr $COUNTER + 1`            echo "Counter is: $COUNTER"            DAYS_BACK=`expr $COUNTER \* 24`            echo "DAYS BACK is: $DAYS_BACK"            DAY=`TZ=CST+$DAYS_BACK date +%d`            echo "DAY is: $DAY"             if [[ "$DAY" -eq 0 ]] ; then              MONTH=`expr "$MONTH" - 1`                if [[ "$MONTH" -eq 0 ]] ; then                 MONTH=12                YEAR=`expr "$YEAR" - 1`                fi              fi            DATEWEEK=`expr $DATEWEEK - 1`          if [[ $DATEWEEK -eq 0 ]]; then          DATEWEEK=7          fi     done     fi     echo $DAY/$MONTH/$YEAR


title: Power broker safe shell or full shell script

text: I am looking for a script which we can pass as an argument to the pbrun command. Eg:               Login: test1     Passwd: xxxxxxx          Welcome to Solaris 10 gcmsys01          $ pbrun sysadmins safeksh      Here sysadmins is the group-name and safeksh is a script which will disable any harmful commands like rm, init 6, format etc etc., similarly, there should be a fullksh script which will allow full shell access to the server (can execute any root commands without any restriction). This script is to overcome any unwanted outages due to some harmful commands. Any suggestions are highly appreciated.


title: How to route one video device to multiple programs

text: I'd like to direct the output of a single capture card (Hauppauge PVR-150) to two programs: VLC (for streaming on LAN) and MythTV for scheduled recording. I think it's possible to do this with the V4L2loopback device, but I'm not sure how. Example of what I want to accomplish: If these are the pertinent devices:               /dev/video0   #PVR-150 baseband source     /dev/video1   #v4l2loopback sink 1     /dev/video2   #v4l2loopback source 1     /dev/video3   #v4l2loopback sink 2     /dev/video4   #v4l2loopback source 2      On boot, I want to direct /dev/video0 to /dev/video1 and /dev/video3. Then I would direct VLC to encode from /dev/video2 and MythTV to record from /dev/video4. Can this work? If so, how can I set it up to run every time the machine boots?


title: MSSQL database server on UNIX

text: I have heard rumors, but did not manage to find anything more, about some sort of MSSQL serving on UNIX machine, or MSSQL/MySQL server, that can handle MSSQL storage. I would like to know, if it is possible, and what are possible methods to achieve this.


title: What is the %U in `chromium %U` for inside chromium.desktop?

text: Is that specific for chromium, or does it have to do with the way unix/linux launches the command? What does it do?


title: Tcpdump: how to capture outgoing packets on a virtual interface?

text: On a Linux system that I am testing now, it has a couple of virtual L2 devices chained together to add/manipulate our own frame headers which are encaped between Eth header and IP header. now this is what "tcpdump -xx -i virtual_if_1" shows for a captured outgoing packet               tcpdump: WARNING: xxxtype 1000 not supported by libpcap - falling back to cooked socket     tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on virtual_if_1, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes          20:20:25.558423 IP 0.0.0.0.52368 > 5.5.2.2.telnet: S 3501169179:3501169179(0) win 35848 <mss 17924,sackOK,timestamp 17386889 0,nop,wscale 8>         0x0000:  0004 03e8 0006 0000 0000 1b9a 0000 0800         0x0010:  4510 003c d792 4000 4006 5c13 0000 0000         0x0020:  0505 0202 cc90 0017 d0af 9a1b 0000 0000         0x0030:  a002 8c08 0735 0000 0204 4604 0402 080a         0x0040:  0109 4d89 0000 0000 0103 0308`      Starting from 0x0010 it's IP header from L3, but 0x0000-0x000f is bogus, it is not the header this virtual device is supposed to prepend to the L3 header. It looks like tcpdump automatically adds an imaginary Ethernet header to it? It is because of the warning showed above, the type is not supported by lipcap? Where does tcpdump gets this data anyway. is it from sk_buff->data? Thanks


title: How to undo in spreadsheet calculator sc?

text: spreadsheet calculator **sc** is a very old console-based program. It does what the name says. I cannot find how to undo an operation in its man page. I currently use it together with RCS, _ie_. manually create versions in RCS before big changes, and rotate back to a version if needed. I am wondering if there is a better way to do it. Thanks.


title: Why does visudo discourage other editors?

text: `man visudo` explains that visudo will not (by default) use `EDITOR` or `VISUAL` environment variables. It states that > "There is no easy way to prevent a user from gaining a root shell if the > editor used by visudo allows shell escapes." Now I am confused where the security risk lies. I believe that   * only root can use visudo to edit `/etc/sudoers`   * only root can change root's environment variables   * root already has a root shell There is probably a use case where this does not hold, but I can't think of it.


title: check if genisoimage is succesful

text: I use a script to convert all VIDEO_TS directories to .ISO. How can I check if genisoimage is actually converting it instead of it failling and converting the next folder? After conversion I have a command to delete the folder but if genisoimage fails then it still deletes it.               #!/bin/bash     iso_name=""     parent_path=""     full_path=""     total=0          IFS=$'\n'     clear          for file in $(find /shares/media/ -type d -name 'VIDEO_TS')     do          parent_path="$(dirname -- "$file")"     full_path="$file"     iso_name="$(basename -- "$parent_path").ISO"     iso_path=""$(dirname -- "$parent_path")"/"$iso_name""          echo "Converting to "$iso_name""          ((total++))     genisoimage -allow-limited-size -o  "$iso_path" -dvd-video "$parent_path"     rm -rf "$parent_path"           done          echo "Succesfully converted "$total" videos to ISO!"


title: understand if a shell process is in background?

text: I keep an instance of mutt idling on a terminal, if it is on index or pager I want it to be able to receive a macro from an external process (AutoKey or xdotool etc..), but the external program need to check mutt isn't running some sub process (emacs, shell...), how to check? It is Linux, so if some `/proc/$pid/*` could help would be fine.


title: Permanently disabled touchpad with function key

text: I pressed `Fn`+`F5` on my Samsung 9 laptop, which disables the touchpad. It worked, but now I can't re-enable it. Clicking (and even click-through tapping) work, but the pointer doesn't move. If I `cat /dev/input/mice`, it shows output when I use the touchpad. Restarting the laptop doesn't help, and the touchpad is listed as enabled in the various graphical utilities I tried, including `xinput`. What else can I try? I'm using Ubuntu 12.10 if it matters.


title: Partition wiped out possibly due to the partition table changed by Windows, malicious software, or ...?

text: **When the data loss problem occurred:** My Lenovo laptop has both Windows 7 and Ubuntu 12.04. There are two ntfs partitions shared between the two OSes: one for Windows 7 installation ,and the other for personal data files. Earlier today, when I was in Windows 7, I restarted the computer into Ubuntu. The ntfs data partition shared between Windows 7 and Ubuntu 12.04 was not able to automatically mounted, which is unlike usual, while The ntfs Windows installation partition was mounted automatically just like usual. Then I restarted the computer back into Windows 7, and the ntfs data partition had been completely emptied, except leaving only one Windows system file `bootsqm.dat` and one Windows system directory `System Volume Information. The time shown by Windows 7 has also been adjusted to be 4 hours in advance than the actual time. The ntfs Windows installation partition was still fine. When I restarted the computer again into Ubuntu, same things as in the previous paragraph happened. * * * **What happened before the problem occurred:** Right before my first reboot from Windows 7 to Ubuntu 12.04, upon logging into Windows 7, there was some automatic configuration of Windows, which took two reboots and a couple of minutes to complete. after logging into Windows 7, I installed some software (MathType and MikTex and LibreOffice), and edit some documents in Microsoft Office Word, and MathType (I got it from http://dl.portablesoft.org/down/?id=2515, which I originally thought was a trial version, but later I learned was a cracked version and felt wrong. I made a copy of it at dropbox http://dl.dropbox.com/u/13029929/MathType_6.8_PortableSoft.rar, not for distributing it but to list it there just in case it will help to identify the problem), and LibreOffice. De-select the autorun of some "message center" of Lenovo Toolkit when Windows starts each time. * * * **Possible reasons and recovery solutions?** I got some suggestion from another person: > First tip is to look at your partition table. Windows is particular about > the partition IDs and order of partitions in a way that Linux is not, and if > it sees something it doesn't like, it will rewrite the partition table. > Check the tables to see if they are in the same order as before you booted > into Windows. I wonder how to look at the partition table, and how to see whether Windows rewrite the partition table, and whether they are in the same order as before I booted into Windows? Any other possible reasons and recovery solutions for the data loss? Can the cracked MathType be the reason? When trying to make diagnosis and recover my data, which operating system shall I work under, Windows 7 or Ubuntu 12.04? * * * Thanks in advance!


title: Cross-Compiling with makepkg command

text: I'm running a x86_64 Arch Linux, now I need to build packages for a i386 Arch Linux, Is that possible? I already checked `makepkg (8)`, it doesn't seem to support manually selection of package architecture. I'm doing this for a few AUR packages, and I don't really want to, e.g add CLAGS


title: How to monitor RAM ECC errors on Ivy Bridge Xeon E3 processor in Linux?

text: How can I monitor if there are any errors in RAM that get corrected by ECC? The processor is an Intel Xeon (Ivy Bridge) processor, the operating system is Scientific Linux 6.3. On a previous system I had an AMD CPU, and on that system I could use edac-util to get this info, and it would also issue alerts to the kernel log.


title: Touchpad recognized as PS/2 mouse and not working (Kernel 3.14.3-2)

text: On an ASUS r510l or x550l laptop the touchpad is not working. I run Arch Linux, with kernel 3.14.3-2, but I also tried it in Ubuntu 12.04, Ubuntu 14.04, Debian Jessie and Fedora. This is what I get from `xinput`:               $ xinput list     ⎡ Virtual core pointer                      id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ PS/2 Logitech Wheel Mouse                 id=14   [slave  pointer  (2)]     ⎜   ↳ USB_PS2 Optical Mouse                     id=11   [slave  pointer  (2)]     ⎣ Virtual core keyboard                     id=3    [master keyboard (2)]         ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]         ↳ Power Button                              id=6    [slave  keyboard (3)]         ↳ Video Bus                                 id=7    [slave  keyboard (3)]         ↳ Video Bus                                 id=8    [slave  keyboard (3)]         ↳ Sleep Button                              id=9    [slave  keyboard (3)]         ↳ USB2.0 HD UVC WebCam                      id=10   [slave  keyboard (3)]         ↳ Asus WMI hotkeys                          id=12   [slave  keyboard (3)]         ↳ AT Translated Set 2 keyboard              id=13   [slave  keyboard (3)]      It gets recognized as a PS/2 Logitech Wheel Mouse, and the `psmouse` module is loaded, but the touchpad doesn't work, `dmesg` keeps showing the same message over and over:               psmouse serio4: Failed to enable mouse on isa0060/serio4      And using `hwinfo` it also appears as a mouse:               $ hwinfo     PS/2 00.0: 10500 PS/2 Mouse       [Created at input.249]       Unique ID: AH6Q.U5GX9Ignjc0       Hardware Class: mouse       Model: "PS/2 Logitech Wheel Mouse"       Vendor: 0x0002        Device: 0x0001 "PS/2 Logitech Wheel Mouse"       Compatible to: int 0x0210 0x0003       Device File: /dev/input/mice (/dev/input/mouse1)       Device Files: /dev/input/mice, /dev/input/mouse1, /dev/input/event15, /dev/input/by-path/platform-i8042-serio-4-event-mouse, /dev/input/by-path/platform-i8042-serio-4-mouse       Device Number: char 13:63 (char 13:33)       Driver Info #0:         Buttons: 3         Wheels: 0         XFree86 Protocol: explorerps/2         GPM Protocol: exps2         Config Status: cfg=new, avail=yes, need=no, active=unknown      I tried several things, like installing the ALPSv7 module or an elantech module, and nothing worked. I posted this on the Arch forum (https://bbs.archlinux.org/viewtopic.php?id=181048) and so far I haven't got any information. I found other people having a similar problem with another ASUS model here: Touchpad not recognized on linux (ASUS R751LB) But I'm not sure if it is related, since mine gets recognized (only as a mouse). EDIT: I have updated to kernel 3.14.6 and it is still not solved. If someone knows an easy guide to kernel drivers I can try to take a further look. Seems a generalized bug of various Asus models: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1325881 But so far there isn't a solution.


title: viewing info documentation with vim

text: I'm trying to use the ManPageView addon to view info documentation within `vim`. Although I find ManPageView very useful for, well, viewing manpages, its info- reading functionality doesn't seem to work at all. But then I almost never read info documentation, mostly because it doesn't seem worth taking the time to learn the `info` interface. So I may be doing it wrong. Anyhow: running `:Man info.i` as suggested by the ManPageView documentation gives me               info: No menu item `(info)Top' in node `(dir)Top'.     info: No menu item `(info)Top' in node `(dir)Top'.     info: No menu item `(info)Top' in node `(dir)Top'.     ***warning*** sorry, no manpage exists for <(info)Top>      I see some success if I delete the following lines, which start at line 345 in the file `autoload/manpageview.vim`:               " special exception for info {{{3     if a:viamap == 0 && ext == "i"      let s:manpageview_pfx_i = "(".manpagetopic.")"      let manpagetopic        = "Top"     " call Decho("top-level info: manpagetopic<".manpagetopic.">")     endif      Deleting those lines will allow `:Man info.i` to work, but I still can't follow links in the displayed page. It works by calling `info` on the command line and capturing the output, so perhaps it's just that `info`'s CLI has changed? Specifically, `$ info info Advanced` will bring up the topic "Advanced" within the "info" node. I dug around in the addon's source code for a while but didn't find any obvious way to direct it to pass the node as an extra argument instead of doing what it seems to be supposed to do, which is to wrap the node name in parentheses and prefix it to the topic, passing the combination as a single command-line argument to `info`. I've not tried to use this addon to view info documentation before. I'm running an updated ubuntu 10.10, using the vim-gnome package. I've filed some semblance of a bug report at what seems to be the recommended location Have others had success using this addon to view info documentation? I feel like I'm lost in the mists that eternally shroud the outer reaches of Obscurity. **note** : Whilst composing this message, I've discovered the info addon, which seems to work acceptably, at least at first glance.


title: Resolving executable user stack trace addresses in ftrace

text: I'm trying to obtain a user stack trace in `ftrace`, but for some reason, only my user program cannot resolve the addresses to symbols. First, the OS I'm using is:               $ uname -a     Linux mypc 2.6.38-16-generic #67-Ubuntu SMP Thu Sep 6 18:00:43 UTC 2012 i686 i686 i386 GNU/Linux      The (trivial) user-space program I'm using, `wtest.c`, is included below. I compile it with:               gcc -g -pg -O0 wtest.c -o wtest      ... hoping that `-g` and `-pg` will include enough debugging symbol information. Then, I run the `wtest` program under `ftrace`. Note that the I want to obtain the user space stacktrace as a sort of a guide where in my user space program I am currently, while I otherwise run the `function` tracer. The Linux/Documentation/trace/ftrace.txt isn't explicit about this, but in order to have a stack trace, there _must_ be something to trigger it - and just the `function` (or `function_graph`) tracer, on its own, will not do any such triggering. So I choose to trigger anytime a system call is detected via `events/raw_syscalls`. Furthermore, the stack trace will print addresses only, unless `sym-userobj` is specified. So, I run this script to do the tracing:               sudo bash -c '     KDBGPATH="/sys/kernel/debug/tracing"     echo 1 > $KDBGPATH/events/raw_syscalls/enable     echo userstacktrace > $KDBGPATH/trace_options     echo sym-userobj > $KDBGPATH/trace_options     echo function > $KDBGPATH/current_tracer ;     echo 0 > $KDBGPATH/tracing_on     echo > $KDBGPATH/trace     echo 1 > $KDBGPATH/tracing_on ; /media/disk/wtest ; echo 0 > $KDBGPATH/tracing_on     cat $KDBGPATH/trace > wtest.ftrace     '      However, the trace ends up containing something like this:               ...                wtest-16108 [000] 16246.413238: arch_flush_lazy_mmu_mode <-__kunmap_atomic                 Xorg-1136  [001] 16246.413239: syscall_trace_leave <-syscall_exit_work                wtest-16108 [000] 16246.413240: up_read <-do_page_fault                 Xorg-1136  [001] 16246.413241: sys_exit: NR 54 = 0                 Xorg-1136  [001] 16246.413242: <user stack trace>      =>  <008f9416>      => /lib/i386-linux-gnu/libdrm_intel.so.1.0.0[+0x4f49]      => /lib/i386-linux-gnu/libdrm_intel.so.1.0.0[+0x5cc3]      => /lib/i386-linux-gnu/libdrm_intel.so.1.0.0[+0x13a3]      => /usr/lib/xorg/modules/drivers/intel_drv.so[+0xec58]      => /usr/lib/xorg/modules/drivers/intel_drv.so[+0x2957a]      => /usr/lib/xorg/modules/drivers/intel_drv.so[+0x2d403]      => /usr/bin/Xorg[+0xdefc8]                 Xorg-1136  [001] 16246.413242: save_stack_trace_user <-ftrace_trace_userstack                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                 Xorg-1136  [001] 16246.413242: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413242: syscall_trace_leave <-syscall_exit_work                wtest-16108 [000] 16246.413243: sys_exit: NR 120 = 0                wtest-16108 [000] 16246.413245: <user stack trace>      =>  <00222416>      =>  <08086a69>      =>  <080753e0>      =>  <080783b5>      =>  <08073c09>      =>  <08077c93>      =>  <08078374>      =>  <08073c09>                wtest-16108 [000] 16246.413245: save_stack_trace_user <-ftrace_trace_userstack                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413245: __copy_from_user_ll_nozero <-save_stack_trace_user                wtest-16108 [000] 16246.413260: down_read_trylock <-do_page_fault                wtest-16108 [000] 16246.413262: _cond_resched <-do_page_fault                wtest-16108 [000] 16246.413263: find_vma <-do_page_fault                wtest-16108 [000] 16246.413265: handle_mm_fault <-do_page_fault                wtest-16108 [000] 16246.413266: __kmap_atomic <-handle_mm_fault     ...      In other words - `Xorg` has its user stack trace resolved fine (at least in the `.so` libraries) - and pretty much all other processes ending up in the `ftrace` log (like `bash`, etc); however, the user stack trace for `wtest` is printed with addresses only ?! I explicitly called the executable through its absolute path, but that doesn't seem to make much difference. Is there a way I could compile my `wtest` program, so its user stack trace gets its symbols resolved - or does the problem lie elsewhere? (I have tried `-ggdb` and `-gdwarf-2` instead of `-g`, but those don't really help here...) Here is the code for `wtest.c`:               #include <stdio.h>     #include <fcntl.h>  // O_CREAT, O_WRONLY, S_IRUSR          int main(void) {       char filename[] = "/tmp/wtest.txt";       char buffer[] = "abcd";       int fd;       mode_t perms = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH;            fd = open(filename, O_RDWR|O_CREAT, perms);       write(fd,buffer,4);       close(fd);            return 0;     }


title: named.run file deleted but data left on disk?

text: Today I had a name-server stop resolving DNS due to the /var directory being full from the named.run cache build up. I tried removing all the files using:               rm -rf name*      However, although running ls showed now files in the directory "data" running df -h still showed 100% use on /var. In the end I rebooted the machine and this resolved the problem but I am a little confused why this did not delete the files. (Obviously rebooting is not something I want to do every time even though we have failover.) Does anyone know the reason?


title: (cp is to cat AS mv is to ?) mv multiple files into one file instead of cat * rm *

text: For everything in this question pretend the system only has one disk and filesystem. (we are not writing to different partitions, disks or filesystems) I am working on a project that `cat`s very large .MTS files into one huge .MTS file. This requires reading each small file and writing them to a new bigger file then deleting the small files. This takes a very long time with files this big. _My understanding_ - `cp` takes longer than `mv` because `cp` reads the file and writes it to a different place on the disk. `mv` on the other hand doesn't copy or move the file. `mv` removes the reference to the file and creates a new one at the new location. For instance `mv /tmp/foo /tmp/bar` leaves the file as is on disk and removes the reference that directs `/tmp/foo` to the file on disk and adds the new reference that points `/tmp/bar` to the file on disk. **The Question:** `cat` is like `cp` because it copies the file to the new location. With such large files and no need for the smaller files when I am done, is there something similar to `cat` that uses `mv` instead of `cp`? _Theory_ (I may have it wrong) It is already common for files to be stored scattered about the drive. For instance a 2GB file might have several smaller chunks stored in different parts of the drive. This way when a 5K files is deleted it can be overwritten with part of a 20MB file. If we left the 2GB files where they are and just reference all the parts it seems like we could make the same effect as `cat foo/* >> bar/bigfile.MTS; rm foo/*` in a fraction of the time. If there is nothing out there that does this and it is a bad idea, can anyone give me example of why? Is it bad to encourage mucking up the disk with scattered file chunks?


title: Auto-delete LUKS Key-slots

text: After installing Kali with the Nuke feature I'm wondering if there's an easy way to limit failed login attempts by simply erasing the LUKS keys-lots. EDIT: I'm asking with the idea in mind to store the password - with some random strings inside and besides it or in some other creative way - in front of the computer monitor.


title: aircrack-ng shows negative channel

text: On many Linux distributions, be it BackTrack, Kali, BackBox, Ubuntu, Mint, etc., whenever I use anything from the aircrack-ng suite my wireless card is shown as channel -1. This problem has been around for years if I recall and I have never found a solution to it. Why does this happen? What could I do to resolve this? I have tried installing the latest backports to no avail, and I am unable to figure out how to apply this patch due to lack of available information on using it properly, nor do I even know if it will work due to how outdated it is. Currently I am using the Alfa AWUS051NH wireless adapter with BackBox Linux 3.13 64-bit, but I have the same issue with the tried and true Alfa AWUS036H and other Linux distributions. Here's some hopefully helpful info:               backbox@backbox-vm:~$ uname -r     3.11.0-26-generic     backbox@backbox-vm:~$ lsusb     Bus 001 Device 002: ID 148f:2770 Ralink Technology, Corp. RT2770 Wireless Adapter     backbox@backbox-vm:~$ lsmod | grep rt2     rt2800usb              27225  0      rt2800lib              81972  1 rt2800usb     crc_ccitt              12707  1 rt2800lib     rt2x00usb              20886  1 rt2800usb     rt2x00lib              56180  3 rt2800usb,rt2800lib,rt2x00usb     mac80211              623710  3 rt2800lib,rt2x00usb,rt2x00lib     cfg80211              499466  2 rt2x00lib,mac80211


title: nfsd fails to start: modprobe: FATAL: Could not load /lib/modules/2.6.18-238.1.1.el5/modules.dep: No such file or directory

text: Before asking, here are some system specs:               [root@SERVER ~]# cat /etc/*release     **##############CARS build log for cars20-rhel-x86_64##############      > Date: Mon Feb 28 20:06:05 PST 2011   >  Builder: pmbure   >  Project: cars20-rhel-x86_64   >  Branch: trunk   >  Build Version: 2.0.1.021   >  Build Server: aons-build5               Destination: /auto/johann/linux/kickstarts/cars20-rhel-x86_64//CARS_2.0.1.021_cars20-rhel-x86_64_022811_2006/2.0.1.021          Log File: /auto/johann/linux/kickstarts/cars20-rhel-x86_64//logs/CARS_2.0.1.021_cars20-rhel-x86_64_022811_2006.log      Local Arch: x86_64 Distro Vendor: rhel               Using master kickstart import file: /auto/perseus/BRANCHES/meta/trunk/ks_import_rhel_x86_64.cfg          Partitioning scheme: /auto/perseus/etc/templates/smos30.part      Red Hat Enterprise Linux Server release 5.4 (Tikanga)**               [root@SERVER ~]# uname -a     Linux LMS-TEAMC 2.6.18-238.1.1.el5 #1 SMP Tue Jan 4 13:32:19 EST 2011 x86_64 x86_64 x86_64 GNU/Linux      The problem is that the NFS service will not start up.               [root@SERVER ~]# service nfs start     Starting NFS services:                                     [  OK  ]     Starting NFS quotas:                                       [  OK  ]     **Starting NFS daemon:                                       [FAILED]**     [root@SERVER ~]#      I tracked the `/var/log/messages` file to check for any problem and apparently the modprobe routine is looking for a file that does not exists:               /var/log/messages:          [root@SERVER ~]# tail -f /var/log/messages &     [root@SERVER ~]# service nfs start     Starting NFS services:                                     [  OK  ]     Starting NFS quotas:                                       [  OK  ]     **Starting NFS daemon:                                       [FAILED]**     **[root@SERVER ~]# Jul 17 15:55:49 SERVER modprobe: FATAL: Could not load /lib/modules/2.6.18-238.1.1.el5/modules.dep: No such file or directory**     [root@SERVER ~]# kill %1      All I have installed for NFS is:               [root@LMS-TEAMC ~]# rpm -qa | grep nfs     **nfs-utils-1.0.9-42.el5**     **nfs-utils-lib-1.0.8-7.6.el5**        I'm not sure if I'm supposed to install any other nfs package? After doing some research, I wasn't able to find a quick and not complex solution for this but to recompile the kernel (this is the "complex" solution) in which case, I will need to ask permission to everybody in the world to do it I checked if indeed the file/folder at `/lib/modules/2.6.18-238.1.1.el5/modules.dep` and apparently it doesn't:               [root@SERVER ~]# cd /lib/modules/     [root@SERVER modules]# ls -1 -lha      total 20K      drwxr-xr-x 3 root root 4.0K Jul 16 16:46 .      drwxr-xr-x 9 root root 4.0K Jul 17 04:03 ..      drwxr-xr-x 6 root root 4.0K Jul 16 16:14 2.6.18-348.12.1.el5      The curious thing here is that I have another server (exactly the same version of RH and Kernel) that worked alright and is actually the main NFS server among the network. So the question here is, how do I fix this? Do I need to recompile the kernel or am I missing an RPM package to get the NFS up? Some basic things:   * The server does know the main NFS server by DNS and can ping it alright.   * The exports have been already set and are working good from other servers. This is the only one giving trouble. Any help/comment/suggestion will be greatly appreciated.


title: How do you construct a grep & command to match a number of patterns depending on how many are provided at runtime?

text: I have exported some _MS Word_ documents to plain text and use this function to parse the contents of the `.txt` files in the current directory:               mo1 () {     for i in *.txt; do         echo "File: $i"         grep -n -HC 1 "$@" "$i"     done     }      If I had more than one pattern to look for, I could do `mo1 | grep pattern2`. But what if I want to do something the result of which would be like `grep -E 'pattern1.*pattern2[.*...]...'` depending on how many patterns are supplied to the function at runtime i.e. `mo1 pattern1 pattern2 [...]` etc.? I can see the `@` array could provide the number of items and I could construct over a loop a variable (finalpattern='$1.*$2.*$3') that would end up being the expression used for `grep`. But I can't think of how to abstract that bit where you craft the expression in the function? Or is there a better/simpler way to do something like this?


title: Automating backups run from a bash script in Linux the right way

text: I have a bash script I wrote to backup a Moodle installation. It works fine, I've tested the backups, but there's a problem with it; when I do the backups, since I have to use `sudo` to type the password every time, I have to physically type in the password instead of just running a `cron` job to do it automatically. Now I suspect this has something to do with either something I don't know about `cron` or using an SSH key; either way I'd like to automate the backup.               #!/bin/bash          # Turn on Maintance mode and log it...     logger "BEGIN Turning on maintance mode in moodle"     lynx -cmd_script=./backupScripts/turnOnMaintMode http://moodle.leeand00domain.local     logger "END Turning on maintance mode complete."          logger "BEGIN Creating Backup Directory"     export bkdir=$(date +"%Y-%m-%d")     mkdir $bkdir      cd $bkdir     logger "END Creating Backup Directory"          #Get a backup copy of the database     logger "BEGIN Backing up the Moodle Database"     mysqldump -u moodleuser --password=XXXXX -C -Q -e --create-options moodle > moodle-database.sql     logger "END Backing up the Moodle Database"          #Get a backup copy of moodle data      logger "BEGIN Backing up moodledata"     tar -cvzf moodledata.tar.gz --exclude='/var/moodledata/cache' --exclude='/var/moodledata/lang' --exclude='/var/moodledata/sessions' --exclude='/var/moodledata/temp' /var/moodledata  && tar -cvzf moodleinstallation.tar.gz /var/www     logger "END Backing up moodledata"          cd ..          tar -cvzf  $bkdir.tar.gz  $bkdir          # Turn off Maintance mode and log it...     logger "BEGIN Turning off maintance mode in moodle"     lynx -cmd_script=./backupScripts/turnOffMaintMode http://moodle.leeand00domain.local     logger "END Turning off maintance mode in moodle complete."


title: To append columns from file 1 to 3 for each row that the first cell of that row matches ow create a new row and then append

text: I have four CSV files as examples given below; I want to append columns from file 1 to 3 for each row that the first cell of that row matches ow create a new row and then append. file1:               N,Mon,Tue,Wed     1,A,B,C     2,D,E,F     3,I,J,X      file2:               N,Mon,Tue,Wed     3,D,E,F     5,O,P,q     1,D,E,K      file3               N,Mon,Tue,Wed     2,B,E,J     6,L,D,O     3,I,J,B      My output should be as below               N, Mon, Tue, Wed, Mon, Tue, Wed, Mon, Tue, Wed     1, A, B, C, D, E, F , , ,     2, D, E, F, , , , B, E, J     3, I, J, K, D, E, F, I, J, B     5, , , , O, P, q, , ,      6, , , , , , , L, D, O                    Client Name,Monday 08/18,Tuesday 08/19,Wednesday 08/20,Thursday 08/21,Friday 08/22,Saturday 08/23,Sunday 08/24,Monday 08/25     ns2.advancemags.com->/var,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B; ,,,,,,,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B;     ns2.advancemags.com->/usr,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B; ,,,,,,,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B;     ns2.advancemags.com->/,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B; ,,,,,,,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B;     ns2.advancemags.com->/boot,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B; ,,,,,,,Successful Full FS_UNIX_Mon_B Synthetic_Full 0B;     ns3.advancemags.com->/boot,,Successful Full FS_UNIX_Tue_C Synthetic_Full 0B; ,,,,,,     ns3.advancemags.com->/,,Successful Full FS_UNIX_Tue_C Synthetic_Full 0B; ,,,,,,     ns3.advancemags.com->/usr,,Successful Full FS_UNIX_Tue_C Synthetic_Full 0B; ,,,,,,