title: Accounts attacked

text: I have run two commands below. I find some of the accounts attack as below. I do not have the account test,teste,oracle and admin in my home directory. As there system account. How to know which are valid and in-valid accounts.               lastb | awk '{print $1}' | sort | uniq -c | sort -rn | head -5        5898 root         196 test         164 oracle         154 teste          86 admin     [root@localhost ~]# awk 'gsub(".*sshd.*Failed password for (invalid user )?", "") {print $1}' /var/log/secure* | sort | uniq -c | sort -rn | head -5       13835 root         386 test         185 oracle         146 admin         131 nagios


title: How to remove all instances of a particular symbol from a text file?

text: I've got a huge (about half a GiB, impossible to use a usual text editor on) CSV file with fields enclosed in double quotes like `"abc","def"` but need a file without quotes (I am sure this is not going to break the file consistency - a comma is never used inside the values in it). How to remove all the quotes (without introducing spaces on their places)?


title: suid-root doesn't have effect

text: A program from apue.               #include "apue.h"     #include <fcntl.h>          int main(int argc, char *argv[])     {         if(argc!=2)             err_quit("usage: a.out <pathname>");              if(access(argv[1], R_OK)<0)             err_ret("access error for %s",argv[1]);         else             printf("read access OK\n");         if (open(argv[1], O_RDONLY)) {             err_ret("open error for %s", argv[1]);         } else {             printf("open for reading OK\n");         }              return 0;     }      I compiled it to an executable named `4-2` and I changed the owner and set the suid this is the output of `ls -l`:               -rwsr-xr-x 1 root sinners 8490 Jan  7 18:50 4-2*      and `/etc/shadow`:               -rw------- 1 root root 421 Jan  4 01:29 /etc/shadow      But when I run it:               user% ./4-2 /etc/shadow      access error for /etc/shadow: Permission denied     open error for /etc/shadow: Permission denied      Can someone explain why I am getting these `access` and `open` errors?


title: What is the security impact of not using tls-remote with OpenVPN

text: Is it a security issue not using the tls-remote option in OpenVPN? That is not verifying the server's common name. Is a MITM attack possible? Could this be an issue, especially with services like dyndns.org?


title: Pacman Full system upgrade ask for replacing packages

text: Every time I do a full system upgrade pacman ask me the same question :               tarting full system upgrade...     :: Replace mga-dri with extra/libgl? [Y/n] n     :: Replace r128-dri with extra/libgl? [Y/n] n     :: Replace sis-dri with extra/libgl? [Y/n] n     :: Replace tdfx-dri with extra/libgl? [Y/n] n      and everytime I click no. It's some kind of annoying. How can I fix it ?


title: Is there a risk of data corruption if suspended laptop runs out of battery?

text: I often tend to just put my laptop on `suspend` using `xfce4-power-manager`, and although usually the battery is sufficiently charged up until the next time (when I plug in the charger), sometimes I forget and after a week or so the battery empties out and the laptop shuts itself down (forcefully). In these cases, is there any risk of data corruption? I would assume that no, since the hard-drive has already synced and was turned off upon `suspend`, but I would like some expert opinion so as to avoid unnecessary surprises. Additionally, should one prefer `suspend`, `hibernate` or some hybrid variant?


title: How to export variables that are set, all at once?

text: `set` command displays all the local variables like below. How do I export these variables all at once?               >set     a=123     b="asd asd"     c="hello world"


title: GTK: Specify application foreground and background color on command line

text: In the old days, all `X11` applications would take standard command-line arguments to specify things like _foreground/background color_. Is there a way to do that today for `GTK` applications? In particular I'm interested in controlling the colors of `zenity` dialogs. I use `Xfce` with `Fedora 20`, if that matters. If it can't be done on command line, I'm open to hearing about alternatives. I don't know how to do this at all (even though command line would be preferable).


title: Is there any major difference when comparing a variable as a string or as an int

text: Out of curiosity, when doing a bash variable comparison (its value being an `integer`) it's possible to test it against some predefined value either declared as an `int` or as a `string`. **Sample script** :               #!/bin/bash     f1()     {             [ "$1" == "1" ] && echo "$FUNCNAME: \"1\" compared as string"     }          f2()     {             [[ "$1" -eq 1 ]] && echo "$FUNCNAME: \"1\" compared as int"     }          f1 $1     f2 $1      **Output** :               $  ./param.sh 1     f1: "1" compared as string     f2: "1" compared as int      and               $  ./param.sh blah     $      Both functions behave the same way, and so I'm wondering if there's a preferred way when checking an integer variable? I would go for checking `int` versus `int` as it's more strict but I wonder if there are any draw backs doing it with `string`? In this case, `f2()` is also more strict about the comparison, i.e. passing a decimal value will break it, whereas `f1()` will take it no problem.


title: Shortcut key for scrolling inside a terminal

text: What is the shortcut key for scrolling inside a terminal? If I hit the `Up` or `Down` arrow or `PageUp` or `PageDown`, it will only traverse through command history, not let me traverse the previous part displayed in the terminal. Especially when I run Matlab in a terminal, I have the same problem. My OS is Ubuntu.


title: Reformat terminal output and save to file

text: I was wondering how to reformat terminal output for logging information. More specifically I would like to reformat the output of the `sensors` command from the `lm-sensors` package and write it to a file. The output looks something like this:               acpitz-virtual-0     Adapter: Virtual device     temp1:        +61.0°C  (crit = +99.0°C)     temp2:        +29.8°C  (crit = +99.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +63.0°C  (high = +86.0°C, crit = +100.0°C)     Core 0:         +62.0°C  (high = +86.0°C, crit = +100.0°C)     Core 1:         +59.0°C  (high = +86.0°C, crit = +100.0°C)     Core 2:         +63.0°C  (high = +86.0°C, crit = +100.0°C)     Core 3:         +61.0°C  (high = +86.0°C, crit = +100.0°C)          radeon-pci-0100     Adapter: PCI adapter     temp1:        +61.5°C      My purpose for reformatting is, for later using the data with gnuplot (realtime plotting). So the result should look similar to this:               # Timestamp [hh:mm:ss]    temp1 [°C]       temp2 [°C]     ...      13:45:52                  65.0             29.0            .     13:45:53                  66.0             28.0            .     13:45:54                  64.0             27.0            .     13:45:55                  55.0             26.0            .     ...                       ...              ...             .      I would like to use this on multiple computers with a different amount of sensors this would require some sort of loop. But from where to where would one loop and how to eliminate the redundant lines (e.g. acpitz-virtual-0, Adapter: Virtual device, ...). Also i'm aware of the `lm-sensors` package capabilities to produce graphs. But I would like to realize a homebrew solution and also keep the question more general.


title: Best way to release an RPM that includes an independently version module

text: I work on a server software that is targeted for RHEL/CentOS and is currently distributed via a standard RPM file. What brings me here is that it includes a downloadable client engine that users can get to by going through the main web UI. So this is what I have:   1. Downloadable agent is still something my company maintains but it has a separate release cycle.   2. Each new RPM version is typically associated with a specific agent version (typically also newer, but potentially could be the same)   3. When users upgrade the server, they may wish to continue using the same agent   4. Agent install is currently packaged with the RPM, so when the server is upgraded, older version of the agent is removed from the system. Apparently (4) is not desirable so what we want is to keep all agent versions that have every been installed even as the server component is being upgraded. One possible solution that might work is to put agent into its own RPM that has agent version number in the name and that the main RPM would require as its dependency. So when the product is installed, rpm -qa would show:               <product>-1.0.0     <product>-agent-install-1.0.5-1.0  (might be a better way to format the name)      And when the server is updated, you would see:               <product>-2.0.0     <product>-agent-install-1.0.5-1.0     <product>-agent-install-1.2.0-1.0      As I'm not by any stretch of imagination a Linux expert, I'd like to know if the strategy I outlined above is...   1. a possible solution (i.e. I'm not missing something obvious that would kill the whole idea)   2. an acceptable practice or a hack Is there a cleaner way that you would do instead? For example, I could have each server install, simply copy off the agent installer into a separate directory and since the other directory is not managed by the RPM, it'll stick around and not get deleted. But would that be better?


title: Should I assign gid explicitly when I create a group?

text: I thought `gid` is automatically assigned when I create a group. But I found a chef receipt file that assigns a number `403` to `gid` directly. https://github.com/treasure-data/chef-td-agent/blob/master/recipes/default.rb Does it not cause a overlapping `gid`s? And what is the reason when you assign a `gid` explicitly?


title: How to export variables from a file?

text: `tmp.txt` file contains the variables to be exported, for e.g.               a=123     b="hello world"     c="one more variable"      How to export all these variables using **export** command, so that, they can later be used by child processes?


title: echoing symbols in terminal/bash

text: Why am I not able to use "!" when trying to echo a message in terminal? For example:               echo -e "Hello\nWorld!"      bash returns the following command:               bash !: event not found


title: root can only login with bash restricted mode

text: I was implementing a series of recommendations to 'harden' my linux server, involving lots and lots of changes. Linux is CentOS 6.2, kernel 2.6.32-220.*. I'm currently using `tty2`..`tty5` (no X/GUI etc) switching between them via `Ctrl+Alt+F?`. Now when I login as root in a tty, I find I am in 'bash restricted mode'. The first thing I checked was `/etc/passwd` which still has `root:x:0:0:root:/root:/bin/bash` as the first line. My question is this: Apart from invoking the root shell with `/bin/rbash` (which didn't exist) or `/bin/bash -r` is there any other way that bash can be defaulted to restricted mode? For example:   1. If a particular file is unreadable or unexecutable, will bash start in restricted mode? If so, which file(s)?   2. Could this happen if I've botched up the SELinux security context for a particular file? (Policy is 'targeted') I haven't listed the changes since there are far too many, my fault rx nb: shell is definitely bash, since running '# ps ' lists only "bash & ps" ...


title: Testing Scripts

text: If I have a script called teiid.sh set to run daily by a cron job. The scripts purpose is to initialize the startup of teiid. How would I make a call to test to see the if teiid.sh is working properly with cron, and not just performing endless actions or no action at all? Example:               @daily * * * * /etc/init.d/teiid.sh jeff@****.edu      Would `chkconfig --add /etc/init.d/teiid.sh` help with anything at all?


title: Why does installing python-minimal package also grab the python package on Debian?

text: From running:               apt-cache depends python2.6-minimal | grep Depends      and               apt-cache depends python2.6 | grep Depends      it looks like `python2.6` depends on `python2.6-minimal` and a lot more. However, when I run, `apt-get install python2.6-minimal` it tries to install the same packages as when I run `apt-get install python2.6` -- both warns `17.0 MB of additional disk space will be used`. Why is this happening? P.S. Another funky thing that seems to happen is that when I try to install the python package, it wants `18.0 MB of additional disk space`. But               apt-cache depends python | grep Depends      only shows               Depends: python2.6     Depends: python-minimal      Why does `python` require a megabyte more than `python2.6`?


title: How to force the time and date settings to refresh from the internet?

text: I'm running Ubuntu 12.04 LTS under vmWare. When I restart a suspended image, the system clock doesn't detect that the system time is out of date. In the Time and Date settings dialog, I've selected "Set time automatically from the Internet", but no amount of clicking on the two options (the other is "Set time manually") makes the System actually "check the internet" and use the correct time. Is there a way that I can force the local system (running under vmWare) to change the time to the "internet time"?


title: Is it possible to split file and append the pieces with same extension in one liner?

text: I did it in two commands --- one for splitting, and one for moving. I can't seem to find my way around it such as to have it all done with one line. What I did was:               split.exe --bytes=2300k -d 01_somefile.mp3 01_somefile.mp3      to get **01_somefile.mp301, 01_somefile.mp302, 01_somefile.mp303** , and so on. Then               for file in *0?; do mv "$file" "$file.mp3"; done      to have them all back as mp3. I would appreciate if someone could help me with an one liner for this that loops through the directory and does this splitting and renaming. I am still poor with the commands. I've tried this:               for file in *.MP3; do split.exe --bytes=2500k -d "$file" "$file" && mv "$file" "$file".mp3; done      I want to ask how can I control the name of the resulting pieces. Say, I have this file in the dir: 01_dickens_copperfield.mp3, next to 02.dickens_copperfield.mp3 and so on. I'm still finding them large and want them broken to other pieces and finally, want them renamed as .mp3 Doing               for file in *.MP3; do split.exe --bytes=2500k -d "$file" "$file"; done      produces the files **01_dickens_copperfield.mp301** , **01_dickens_copperfield.mp302** , **01_dickens_copperfield.mp303** , and so on. Next, doing               for file in *.*; do mv "$file" "$file".mp3; done      gives: 01_dickens-copperfield.mp301.mp3, 01_dickens_copperfield.mp302.mp3, *.mp3ac.mp3 and so on. How do I tell it to split the file into files having the original name but not the extension. Let `mv` add extention. Sorry for such lenghty expose. I am learning my way into this beautiful jungle but full of powerful animals such as these split, mv.


title: Setting user environment variable permanently, outside shell?

text: Is it possible to set up an envinronment variable that can be accessible from any shell, not an specific one, and that doesn't decay as soon as your session ends? I'd like to set up a `NODE_ENV` variable system wide, how could I achieve that?


title: Linux Kernel Firewire Feature: Use Unclear

text: In the Linux kernel, there is a setting "FireWire SBP-2 fabric module". I do not understand the documentation: > Say Y or M here to enable SCSI target functionality over FireWire. This > enables you to expose SCSI devices to other nodes on the FireWire bus, for > example hard disks. What is the use of this feature? That is, what is it for? Why would someone need to enable this driver?


title: OpenVPN not showing easy-rsa

text: wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm     rpm -Uvh epel-release-6-8.noarch.rpm      I did yum install openvpn in the guide then did the following:               mkdir -p /etc/openvpn/easy-rsa/keys     cp -rf /usr/share/openvpn/easy-rsa/2.0/* /etc/openvpn/easy-rsa      Fails. I get:               ls -la /usr/share/openvpn/     total 8     drwxr-xr-x  2 root root 4096 Jul 31 21:19 .     drwxr-xr-x 64 root root 4096 Sep 20 20:26 ..      Where do I find the easy-rsa keys? I'm told in the guide I need to edit `/etc/openvpn/easy-rsa/vars` but I can't find the vars. What I did find was:               ls /usr/share/doc/openvpn-*/sample/sample-keys     ca.crt  ca.key  client.crt  client.key  dh1024.pem  pass.crt  pass.key  pkcs12.p12  README  server.crt  server.key


title: cabal dies on NixOS in KVM

text: I set up a NixOS system on KVM and installed the haskelPlatform package. Everything works fine, ghci works fine, but cabal dies without any helpful error message:               [michas@nix:~]$ type -a cabal     cabal is /run/current-system/sw/bin/cabal          [michas@nix:~]$ cabal --version     cabal-install version 1.16.0.2     using version 1.16.0 of the Cabal library           [michas@nix:~]$ cabal update     Downloading the latest package list from hackage.haskell.org     Aborted          [michas@nix:~]$ cabal update -v3     Downloading the latest package list from hackage.haskell.org     Sending:     GET /packages/archive/00-index.tar.gz HTTP/1.1     Host: hackage.haskell.org     User-Agent: cabal-install/1.16.0.2     Creating new connection to hackage.haskell.org     Received:     HTTP/1.1 200 OK     Date: Thu, 19 Sep 2013 17:28:04 GMT     Server: Apache/2.2.9 (Debian) mod_python/3.3.1 Python/2.5.2     Last-Modified: Thu, 19 Sep 2013 16:01:27 GMT     ETag: "1888006-641488-4e6beaa9663c0"     Accept-Ranges: bytes     Content-Length: 6558856     Content-Type: application/x-tar     Content-Encoding: x-gzip     Downloaded     to /home/michas/.cabal/packages/hackage.haskell.org/00-index.tar.gz     Aborted          [michas@nix:~]$ strace cabal update     [...]     close(9)                                = 0     lstat("/home/michas/.cabal/packages/hackage.haskell.org/00-index.tar5861.tmp",     {st_mode=S_IFREG|0644, st_size=104366080, ...}) = 0     rename("/home/michas/.cabal/packages/hackage.haskell.org/00-index.tar5861.tmp",     "/home/michas/.cabal/packages/hackage.haskell.org/00-index.tar") = 0     --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_pid=0,     si_uid=18, si_value=0} --- rt_sigreturn()                          = 0     --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_pid=0,     si_uid=0, si_value=0} --- rt_sigreturn()                          =     139968722321408     stat("/home/michas/.cabal/packages/hackage.haskell.org/00-index.cache",     {st_mode=S_IFREG|0644, st_size=1058094, ...}) = 0     stat("/home/michas/.cabal/packages/hackage.haskell.org/00-index.tar",     {st_mode=S_IFREG|0644, st_size=104366080, ...}) = 0     stat("/home/michas/.cabal/packages/hackage.haskell.org/00-index.cache",     {st_mode=S_IFREG|0644, st_size=1058094, ...}) = 0 --- SIGVTALRM     {si_signo=SIGVTALRM, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=0}     --- rt_sigreturn()                          = 0     rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 tgkill(5861, 5861,     SIGABRT)             = 0 --- SIGABRT {si_signo=SIGABRT,     si_code=SI_TKILL, si_pid=5861, si_uid=1000} --- +++ killed by SIGABRT     +++ Aborted          [michas@nix:~]$      The VM has no swap, but 2GB of RAM. No hints in `dmesg`. Any idea what is going on? (On another NixOS installation on a VirtualBox-based VM this works without problems.)


title: Can (and how) KVM use NTFS storage?

text: Using SL6.4, I am trying to create a new KVM virtual machine using `virt- manager`. When defining storage at default pool, it boots up OK. However, when trying to use storage located on external NTFS drive, it fails with permission denied. I've changed SElinux to permissive mode, defined a directory on the NTFS drive as storage pool; (un)commented the "user" and "group" lines on `/etc/libvirt/qemu.conf` file, but none of these helped. Should something with the NTFS mounting be changed? Maybe some other configuration? EDIT: virt-manager succeeded creating .img file on the NTFS partition (but warned me that it doesn't have search permission (??) in that directory), it failed only when trying to start the virtual machine. Furthermore, if I try to use default storage, and read an ISO file from /home partition - it works; but when I try to use default storage and read an ISO file from NTFS partition it fails with the same failure. (the ISO file is readable from the NTFS partition. I know that because it was copied from there to /home ...)


title: Verify if a hard drive is encrypted on Linux

text: How can I verify if a hard drive is encrypted in Fedora 20? If not, does it mean I have to re install Fedora to encrypt it?


title: Gnome: Show full path in Nautilus

text: Unfortunately, Gnome's nautilus address bar is not showing the **full path** in its top bar. How can I change this behavior? I'm looking for a solution to display a editable `text field` instead, like in the good old days. ![enter image description here](http://i.stack.imgur.com/HEA1G.png)


title: Moving latest files from one directory to another

text: I'm trying to move newest files from one directory to another directory. The `find` command finds the files but not moving them to another directory. The destination directory exists.               $ cd /app/path1/path2 && \         find . -type f -printf "%C@ %p\n" | sort | tail -n 2 | \         cut -d " " -f 2- |xargs -0 mv -t /app/path1/path2/path3          error:  mv: cannot stat No such file or directory


title: Launch a GTK3 aplication without customized gtk settings?

text: In previous versions of gtk it was easy to launch one instance of an application with default gtk settings:               GTK2_RC_FILES= epdfview      But for version 3, it won't work anymore:               GTK3_RC_FILES= evince      has no effect. Is this convenience definitely gone?


title: how does built in commands of a shell implemented in Linux? as a function or thread of shell process?

text: I know that external commands are run in the shell by creating a separate process. But what exactly happens when a built in command is run in a shell. Are they executed as a function or if the shell creates a new thread to execute the built in command?


title: Pause music while screen is locked

text: I was wondering whether it is possible to pause a music player (in my case Rhythmbox), by pressing a button, while the screen is locked. I would assume no, but I thought I'd ask. A short example: If the screensaver goes on the music continues. But lets say somebody comes in my office, I don't want to type in the password, but just hit a button to pause it. And ideally of course play again once I'm alone. Is there a program that would allow something like this? I'm using Fedora16. Edit thanks to pbm for the solution. Here is my `actkbd.conf` (using `Ctrl`+`Alt`+`P`):               25+29+56:::su MyUserName -c "dbus-send --type=method_call  --print-reply --dest=org.gnome.UPnP.MediaServer2.Rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"


title: Does "freshening" a zip file with the -FS option change the modification time of the file?

text: I have a zip file that I use as a backup for my work. I use the "freshen" option (`-FS`) whenever I want to update my backup file. However, the file shows the date of last modification as being the date I originally created the file, rather than any of the several times since I have "freshened" the file. Is this normal behavior?


title: How to generate Zipf-like samples, by using scripting language

text: Is there any scripting language function (like in `python` or `bash`) that samples from a zipf-like distribution, for exponent `0<a<=1`. PS: I am aware of existence of a numpy function that can generate zipf samples, but it's only for `a >1`.


title: How can I get my lp printout to *always* be smaller and one sided?

text: The default output is double sided and too big. I can get better output with `lp spec/scenarios_spec.rb -o sides=one-sided -o fit-to-page` How could I make those options - `-o sides=one-sided -o fit-to-page` - be the default for all printing that I do on my machine.


title: How to find the cpu and memory usage of a single process in linux

text: This question is similar to this SO. I wanted to find the CPU and memory utilization for a single process so I decided to use the `top -p <$PID>` as mentioned in the question. Here is my script.               #!/bin/bash     # get the process Id of the program executing this shell script     ID=$PPID     echo the process id of the parent of this script is $ID          #fetch the parent of the program which executed this shell     read PID < <(exec ps -o ppid= "$ID")     echo the grand parent id of the script is $PID          read GPID < <(exec ps -o ppid= "$PID")     echo the grand parent id of the script is $GPID               while read -u 4 P; do      top -b -c -n 1 -p "$P"     done 4< <(exec pgrep -P "$GPID")      When I am running the script I am getting the absolutely same CPU utilization and memory usage for all process which is not correct. I am not sure how to fix this all I am trying to do is to find the individual memory usage of child processes of a process. Could someone please help me. Thanks in advance.


title: What is using memory?

text: According to `htop` and `free`, the machine I'm looking at is currently at 6631 / 11907 MB of RAM. That's more or less half of the RAM available. However when I sort `top` or `htop` by MEM%, the most memory being used is by Xorg with 0.8% MEM. `gnome-settings` is using 0.3%, and a couple of others are using 0.1%. These percentages don't add up to ~50%. How can I find out what is using ~50% of the memory, and why am I not seeing this memory usage in top/htop? The output of `free -mt`:                            total       used       free     shared    buffers     cached     Mem:         11907      10660       1246          0        650       3379     -/+ buffers/cache:       6629       5277     Swap:         3999         26       3973     Total:       15907      10686       5220      **EDIT** : As requested... **vmstat 1 5**               procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----      r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st      0  0  26640 312180 695976 4229988    0    0     4    34    0    1  1  1 96  2  0         0  0  26640 312032 695976 4230016    0    0     0     0  157  191  0  0 100  0  0        0  0  26640 312156 695976 4230016    0    0     0     0  158  270  0  0 100  0  0        0  0  26640 312156 695976 4230016    0    0     0     0  128  189  0  0 100  0  0        0  0  26640 312156 695976 4230016    0    0     0     0  212  308  0  0 100  0  0        **cat /proc/meminfo**               MemTotal:       12192876 kB     MemFree:          311644 kB     Buffers:          695984 kB     Cached:          4230016 kB     SwapCached:         7684 kB     Active:          1378792 kB     Inactive:        3656424 kB     Active(anon):       2192 kB     Inactive(anon):   108500 kB     Active(file):    1376600 kB     Inactive(file):  3547924 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:       4095992 kB     SwapFree:        4069352 kB     Dirty:                28 kB     Writeback:             0 kB     AnonPages:        102412 kB     Mapped:            52116 kB     Shmem:              1456 kB     Slab:            5584084 kB     SReclaimable:    4402760 kB     SUnreclaim:      1181324 kB     KernelStack:        3176 kB     PageTables:        17852 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:    10192428 kB     Committed_AS:     678004 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      185496 kB     VmallocChunk:   34359540220 kB     HardwareCorrupted:     0 kB     AnonHugePages:     28672 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:     5177316 kB     DirectMap2M:     7403520 kB     DirectMap1G:           0 kB


title: Install a basic CentOS VM on Fedora 19 with libvirt

text: I would like to install a CentOS 6.5 virtual machine on my machine, only with command line tools and basic networking capabilities, i.e a way to have http and ssh connections between the host (Fedora 19) and the CentOS guest. Being still quite noobish to the nix world, I experienced some trouble. I first did an unsuccessful attempt to install virtualbox. I then found this page on the fedorapoject.org's wiki titled: Getting started with virtualization. I followed the instructions, installed the packages needed (libvirt ...), and enabled virtualization in my BIOS. I installed my VM from the iso CentOS-6.5-x86_64-minimal.iso (with `virt-install --prompt` ) While the installation went all right, if I halt the VM I absolutely don't know how to restart it. The webpage I used apparently doesn't mention it, and having a look at virsh or virt-manager manual was not yielding help for me (but maybe because I don't know how to read it properly) the `virsh list` doesn't show anything but an empty list. i tried to find the machine I created using `find / -name name_of_vm_as_prompted_during_virt- install` and found nothing besides, while my guest is running, no network interface is there (except lo), despite the wiki stating that there should be a basic networking interface created by default that would allow me to have connection between guest and host. However on my host I have               virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500             inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255             ether 8e:3d:7c:b3:44:bf  txqueuelen 0  (Ethernet)      which, I guess, should be encouraging. My knowledge on VM is quite limited and so is my understanding of networking. My questions :   1. How to access my created but closed VM   2. How to set up the basic network capabilities   3. since I have 2 questions, should I split them into two separate threads ?


title: Install wifi modem buffalo airstation g54

text: I borrowed a wifi modem from a friend - buffalo airstation g54 ![enter image description here](http://i.stack.imgur.com/Xa8RU.jpg). I don't know anything about the installation, I just would like to use the wifi. I don't have an installation cd. I have found some guides on the web, but all of them are for windows machines. I am on Linux - Ubuntu. Could you please guide me on this? What kind of information do you/I need?


title: "error: implicit declaration of function ‘vfs_readlink’" while installing VMware Tools

text: Been trying to reinstall vmware tools for my Fedora 20 VMware Fusion 6.0.4 Box for some time on my OSX Mavericks host now. After the Fedora update it was necessary so I could access Drop Box from the host and easily resize the window. But now I keep on getting these errors and retrying after installing all does not seem to work. See here the final part with warnings and errors causing this failure:               make     gcc     kernel headers of the running kernel               Searching for GCC...     Detected GCC binary at "/bin/gcc".     The path "/bin/gcc" appears to be a valid path to the gcc binary.     Would you like to change it? [no]           Searching for a valid kernel header path...     Detected the kernel headers at      "/lib/modules/3.15.5-200.fc20.i686/build/include".     The path "/lib/modules/3.15.5-200.fc20.i686/build/include" appears to be a      valid path to the 3.15.5-200.fc20.i686 kernel headers.     Would you like to change it? [no]           Using 2.6.x kernel build system.     make: Entering directory `/tmp/modconfig-F7dG4u/vmhgfs-only'     /bin/make -C /lib/modules/3.15.5-200.fc20.i686/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \       MODULEBUILDDIR= modules     make[1]: Entering directory `/usr/src/kernels/3.15.5-200.fc20.i686'       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/message.o     In file included from /tmp/modconfig-F7dG4u/vmhgfs-only/backdoor.h:30:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/message.c:54:     /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]         #define DEPRECATED(_fix) do {} while (0)      ^     In file included from include/linux/kernel.h:13:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/kernelStubs.h:36,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/message.c:45:     include/linux/printk.h:92:0: note: this is the location of the previous definition      #define DEPRECATED "[Deprecated]: "      ^       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/dir.o     In file included from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfs.h:40:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsProto.h:37,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/dir.c:37:     /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]         #define DEPRECATED(_fix) do {} while (0)      ^     In file included from include/linux/kernel.h:13:0,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/percpu.h:44,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/preempt.h:5,                      from include/linux/preempt.h:18,                      from include/linux/spinlock.h:50,                      from include/linux/seqlock.h:35,                      from include/linux/time.h:5,                      from include/linux/stat.h:18,                      from include/linux/module.h:10,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/dir.c:29:     include/linux/printk.h:92:0: note: this is the location of the previous definition      #define DEPRECATED "[Deprecated]: "      ^       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/rpcout.o     In file included from /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vmware.h:39:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/rpcout.c:43:     /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]         #define DEPRECATED(_fix) do {} while (0)      ^     In file included from include/linux/kernel.h:13:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/kernelStubs.h:36,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/rpcout.c:33:     include/linux/printk.h:92:0: note: this is the location of the previous definition      #define DEPRECATED "[Deprecated]: "      ^       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsUtil.o     In file included from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfs.h:40:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsUtil.h:55,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsUtil.c:33:     /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]         #define DEPRECATED(_fix) do {} while (0)      ^     In file included from include/linux/kernel.h:13:0,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/percpu.h:44,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/preempt.h:5,                      from include/linux/preempt.h:18,                      from include/linux/spinlock.h:50,                      from include/linux/seqlock.h:35,                      from include/linux/time.h:5,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsUtil.h:32,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsUtil.c:33:     include/linux/printk.h:92:0: note: this is the location of the previous definition      #define DEPRECATED "[Deprecated]: "      ^       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/cpName.o       CC [M]  /tmp/modconfig-F7dG4u/vmhgfs-only/link.o     In file included from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfs.h:40:0,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/hgfsProto.h:37,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/module.h:39,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/link.c:32:     /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/vm_assert.h:259:0: warning: "DEPRECATED" redefined [enabled by default]         #define DEPRECATED(_fix) do {} while (0)      ^     In file included from include/linux/kernel.h:13:0,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/percpu.h:44,                      from /usr/src/kernels/3.15.5-200.fc20.i686/arch/x86/include/asm/preempt.h:5,                      from include/linux/preempt.h:18,                      from include/linux/spinlock.h:50,                      from include/linux/wait.h:8,                      from include/linux/fs.h:6,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/./shared/compat_fs.h:22,                      from /tmp/modconfig-F7dG4u/vmhgfs-only/link.c:29:     include/linux/printk.h:92:0: note: this is the location of the previous definition      #define DEPRECATED "[Deprecated]: "      ^     /tmp/modconfig-F7dG4u/vmhgfs-only/link.c: In function ‘HgfsReadlink’:     /tmp/modconfig-F7dG4u/vmhgfs-only/link.c:186:10: error: implicit declaration of function ‘vfs_readlink’ [-Werror=implicit-function-declaration]               error = vfs_readlink(dentry, buffer, buflen, fileName);               ^     cc1: some warnings being treated as errors     make[2]: *** [/tmp/modconfig-F7dG4u/vmhgfs-only/link.o] Error 1     make[1]: *** [_module_/tmp/modconfig-F7dG4u/vmhgfs-only] Error 2     make[1]: Leaving directory `/usr/src/kernels/3.15.5-200.fc20.i686'     make: *** [vmhgfs.ko] Error 2     make: Leaving directory `/tmp/modconfig-F7dG4u/vmhgfs-only'          The filesystem driver (vmhgfs module) is used only for the shared folder      feature. The rest of the software provided by VMware Tools is designed to work      independently of this feature.          If you wish to have the shared folders feature, you can install the driver by      running vmware-config-tools.pl again after making sure that gcc, binutils, make     and the kernel sources for your running kernel are installed on your machine.      These packages are available on your distribution's installation CD.      I can finish the setup, but it does not really install things properly - shared folder is not mounted (folder is shown with no contents ) - and I also get this final warning               Found VMware Tools CDROM mounted at /run/media/jfrumau/VMware Tools. Ejecting      device /dev/sr0 ...     /sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file      Any ideas around this issue - vmhgfs module related it seems - so the shared folder gets mounted again and all works?


title: samba4: odd username mapping?

text: I'm using samba4 as a dc with sssd to talk to a separate LDAP server. When I try to login to a win7 machine that's added as a domain member samba is stripping off the domain name and substituting the samba domain instead. Errors that I see in log.samba:               [2014/07/18 06:46:28.177400,  3] ../source4/auth/ntlm/auth.c:270(auth_check_password_send)         auth_check_password_send: Checking password for unmapped user [ldapdom]\[user]@[win7host]         auth_check_password_send: mapped user is: [sambadom]\[user]@[win7host]         [2014/07/18 06:46:28.178098,  3] ../source4/auth/ntlm/auth_sam.c:61(authsam_search_account)       sam_search_user: Couldn't find user [user] in samdb, under DC=dom,DC=server,DC=edu        [2014/07/18 06:46:28.178184,  2] ../source4/auth/ntlm/auth.c:420(auth_check_password_recv)       auth_check_password_recv: sam_ignoredomain authentication for user [sambadom\user]         FAILED with error NT_STATUS_NO_SUCH_USER      I can't tell if I need some sort of username mapping or a change to either the smb.conf or sssd.conf. Username mapping would seem odd since I essentially want it to map the original value to itself. CentOS 6.4 x64   Samba4 4.1.9   sssd


title: Help With Simple Script - Absolute, Relative Paths

text: I'm trying to execute a mono application, without requiring the user to type in 'mono filename'. It's just one line of code:               mono ./Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9      It works great, so long as I call it from the correct directory. But if my current directory isn't exactly where the script is - it fails because the ./Bin is relative to the current directory. I want it to be relative to the location of the script. I found that I was able to get the location of the script using               echo dirname "$(readlink -f "$0")"/Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9      That displays correctly on the screen; but I can't figure out how to put it into my first script such that mono executes that value. I'm very new to this, but when I try to look up what to do, I keep seeing tutorials for a particular shell...but I need a solution that will work regardless of what shell the user might be running. I know that I'm using 'tcsh'. Can anyone help me? I just want to run 'mono' + 'dirname "$(readlink -f "$0")"/Bin/jobshop.exe $1 $2 $3 $4 $5 $6 $7 $8 $9' But I can't seem to get it right.


title: how to disallow user to change process group

text: Is it possible to restrict a process from changing it's process group? For example, user `nobody` seems to be able to call `setpgid(0, 0)` which sets process group of current process to pid of that process. (`setpgid(0, non- zero-number)` is denied, however).


title: Needed: A simple way to remotely monitor a process on my server

text: I have a cloud-based server running a Java process (a POP/SMTP server called davmail, details don't really matter). What is the simplest way to monitor the status of that Java process remotely? I need to know if and when it goes down. I could just leave an ssh session open and tail the log, but is there something more elegant? Maybe I need to install a webserver and run some monitoring software on the same server. Or maybe there is a client program I can run on my local machine (a Mac) that can be alerted by some cron job on the server whenever the Java process stops?


title: What determines the maximum file size in ext2 file system

text: I was reading the Kernel Documentation where it says > There are various limits imposed by the on-disk layout of ext2. Other limits > are imposed by the current implementation of the kernel code. Many of the > limits are determined at the time the filesystem is first created, and > depend upon the block size chosen. The ratio of inodes to data blocks is > fixed at filesystem creation time, so the only way to increase the number of > inodes is to increase the size of the filesystem. For 4Kb block size, the file size is 2048GB. I have also read that during data block allocation it uses direct, double or triple indirection to data blocks. Whether it is the main factor ?


title: While there is C++ why most of Linux programs are written in C?

text: Why most of linux programs are written in C? Why they are not written with C++ which is newer than C?


title: (G)VIM uses a different $PATH than my system

text: Because Ubuntu provides no up-to-date packages for TeXLive, I installed it manually. However, some programs need TeXLive as dependency. So what I did is I installed the TeXLive package from the Ubuntu repositories on top of that, which is the 2009 version. I then changed my $PATH to contain the manually installed 2011 version, so programs still always point to and use the most recent TeXLive version. So far this worked fine. But here is the snap: When I switched to VIM for editing my LaTeX files, I noticed after a too much of a headache that VIM "sees" only TeXLive2009! See this screenshot, left is VIM, right a terminal: ![LaTeX Version in VIM](http://i.stack.imgur.com/JT77s.png) I then checked what $PATH VIM is using, and as it turns out, it is using a different one, that does NOT point to TeXLive 2011. See this screenshot: ![Path in VIM and Terminal](http://i.stack.imgur.com/O3Ry3.png) VIM:               :! echo $PATH     /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      Terminal:               echo $PATH     /usr/local/texlive/2011/bin/x86_64-linux:/usr/local/texlive/2011/bin/x86_64-linux:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      Do you have any idea how to fix this, so my LaTeX plugins can use TeXLive 2011, maybe by making VIM use the same $PATH? Any help would be GREATLY appreciated!


title: What is the difference in these two bash environments?

text: I notice that with `bash` scripts, some people use a different shebang to the one that I'm used to putting at the top of my own. Can someone simplify the difference between these two? I use the `#!/bin/bash` one all the time.               #!/bin/bash     #!/usr/bin/env bash


title: Enlightenment (E17) not opening settings windows or click menu

text: I cannot open any settings windows and cannot access the menu be clicking on an empty part of the desktop on enlightenment installed on Arch. What could be the problem? If it helps with finding the issue I'm running GDM for a desktop manager.


title: Is there an in-memory compressed swap facility (like Compcache) for FreeBSD?

text: Is there anything like CompCache for FreeBSD?


title: RHEL6 not registering correctly when using PXE boot via Cobbler

text: When I create a RHEL6 server using the DVD media, it works fine. However, we want to do PXE installs. We import the RHEL6 DVD to cobbler by doing the following:               $ sudo mount -o loop,ro rhel6-dvd.iso /media     $ sudo cobbler import --path=/media/ --name=rhel-6 --arch=x86_64      The install goes through fine. However, it seems that the registration isn't completed correctly. Here is the output:               The system has been registered with id: (snipped ID)      Installed Product Current Status:      With a regular install, I'd get a list of products. When I do `yum repolist`, I don't get any of the RHN repos:               # yum repolist     Loaded plugins: product-id, security, subscription-manager     Updating certificate-based repositories.     repo id          repo name                                                status     epel             Extra Packages for Enterprise Linux 6 - x86_64           8,312     repolist: 8,312      Any idea why it is not registering correctly via `cobbler` but working fine when using DVDs?


title: httpd memory usage very high

text: I host a wordpress site on my server which has 2GB mem, I have used some cache plugin, but when I type `ps -eo "%C : %p : %z : %a" | sort -k5 -nr` in SSH, I see the httpd memory usage is very high.               15.7 :  3131 : 4732740 : /usr/local/mysql/bin/mysqld      0.5 :  3356 : 515860 : /usr/sbin/httpd      0.6 :  3363 : 509308 : /usr/sbin/httpd      0.6 :  3333 : 509308 : /usr/sbin/httpd      0.5 :  3367 : 509308 : /usr/sbin/httpd      0.5 :  3361 : 509308 : /usr/sbin/httpd      0.5 :  3358 : 509308 : /usr/sbin/httpd      0.5 :  3338 : 509308 : /usr/sbin/httpd      0.4 :  3366 : 509308 : /usr/sbin/httpd      0.3 :  3370 : 509308 : /usr/sbin/httpd      0.3 :  3359 : 509308 : /usr/sbin/httpd      0.0 :  3193 : 410980 : /usr/sbin/httpd      ...      The server always dead. I have set memory in `php.ini` like this:               memory_limit = 768M     memory = 20M      Thanks for read.


title: Using xdg-open for accessing network with normal explorer

text: I'm working with small network and I want to start network explorer from a terminal. When I tried to type `xdg-open network:///server` it opened google chrome and did nothing. I also tried to type `smb://server` but it hasn't helped me. I really need to run it from terminal. Does anybody know how can I do it?


title: input, evdev alternatives?

text: Simply put what are some other input subsystems? P.S. (a little context) Is there a popular alternative? (I'm looking at an HP- UX and have no idea how its taking care of this, because there is no /dev/input/event*) and based on the wiki Evdev is "closely related input driver for the X.Org Server" - can evdev exist without X.Org?


title: Does replacing Windows with Fedora still work in Windows 7 or do I need to do Dual Boot?

text: For the last 5 years, my procedure for setting up a Linux box has been to get the CDs (RH9, then FC11), boot the CD and just install Linux. I do not wish to have dual boot; I want it to just run Linux. Is this procedure still practical or does it no longer work? I was planning to do this with Fedora 14 on a new Windows 7 machine.


title: Sysrq keeps taking screen shots

text: I have enabled SysRq in the kernel like this:               $su     #echo 1 > /proc/sys/kernel/sysrq       and confirmed that it worked. `Fn-F1` is my SysRq key, but every time I press `Alt-Fn-F1` and any other letter that should go here like `t` it doesn't work. It just takes a screenshot. Even pressing `r` takes a screenshot. It this common? How do I get around this? I'm using Fedora 16


title: How to dualboot Win7 and Chrome-OS on Netbook

text: I have tested Google Chrome OS (aka Chromium OS) using a USB pen drive, or more precisely Chrome OS Lime by Hexxeh. Since I like it I would like to install it along side of my pre-installed Windows 7, however, I can not see any installation entry within the system..! My _guess_ is that one could do this by simply   1. Fix a partition    2. Make the partition it boot-able somehow    3. Copy the content of the USB-stick to the partition.   4. Add the partition to the boot loader using e.g. EasyBCD.exe.


title: How can I get a username prompt on Mint 16's login screen?

text: I changed my main user's ID from 1000 to 999 and now it no longer shows on the login screen. I expected it not to show, but I also expected the login screen (the default that ships with MATE/Mint 16) to be "smart enough" to show a box where you can manually type in a username if there are no users over 1000 to list. It isn't. Is there a way to change to a different login theme that will allow a username to be entered (from the command line, because I can't log in graphically!)? Is there a way to make the login screen show a username prompt? Maybe some hidden hotkey combination? I can use CTRL+ALT+F2 and login and run `startx`, but the DE response is brutally slow, and it doesn't have the login screen chooser on the menu when MATE is started that way.


title: GNU texinfo directory search method?

text: Does `info` (GNU texinfo 4.13) have a default search path for finding a `dir` file? Is it `/usr/share/info`? Even though I don't have an `INFOPATH` variable set in my environment, it seems to use the `dir` file in the path above. Relatedly, I have a script that sets up a directory with an alternate info directory structure. It does set a valid `INFOPATH` environment variable but `info` seems not to use it as invocation simply gives a blank screen without any menu items. Any guidance on how `info` progresses in searching the path?


title: Ubuntu Bash - Changing permissions to user files for automating Apache VirtualHost creation

text: **Moved here fromAskUbuntu** I currently have a small Ubuntu Server 12.04 machine (test environment) with about 3 non-root users created. Each user has their own `public_html` directory under their `home`...thereby allowing them to deploy multiple apps as named virtual hosts. Each user belongs to the Apache `www-data` group, set up as follows:               sudo usermod -a -G www-data [username]     sudo chown -R [username]:www-data /home/[username]/public_html     sudo chmod 2750 /home/[username]/public_html      Now as the root user, I am in the process of creating a bash script that will automate the creation of the folders for the VirtualHost under a prompted user's `public_html` as well as creating an associated entry in `/etc/apache2/sites-available/`. The script (run with `sudo`) will prompt for the user (`$uzer`) and the desired virtual host name (`$vhost`). So far after running a few checks I eventually get to the following...               mkdir -vp /home/$uzer/public_html/$vhost     mkdir -vp /home/$uzer/public_html/$vhost/www     mkdir -vp /home/$uzer/public_html/$vhost/logs     mkdir -vp /home/$uzer/public_html/$vhost/backups      I need to change the ownership of these newly created folders, so I'm unsure whether I should be doing the following:               chown -vR $uzer:www-data /home/$uzer/public_html/$vhost     chmod 2750 /home/$uzer/public_html/$vhost      My questions:   * Is my folder structure correct/ideal?    * I know I've used recursive (`-R`) option, but should I be repeating the same for `$vhost/www`, `$vhost/logs` and `$vhost/backups`?    * Am I correct in thinking that the chmod above is probably redundant?   * Is there a way I can run the `mkdir` commands as the user `$uzer`? I am a bit of a Linux server noob, but have learned a lot in the last few months - this is probably the first shell script I've attempted to write and I still haven't fully mastered Linux permissions.


title: pkg-config --libs --cflags not return anything for libgoogle-perftools-dev

text: user2702245 said > `pkg-config --clibs --flags <package>` is good enough to provide linker and > include information. I tried to find out such information about libgoogle-perftools-dev I installed from software center in Ubuntu 12.04.               $ pkg-config --libs --cflags libgoogle-perftools-dev     Package libgoogle-perftools-dev was not found in the pkg-config search path.     Perhaps you should add the directory containing `libgoogle-perftools-dev.pc'     to the PKG_CONFIG_PATH environment variable     No package 'libgoogle-perftools-dev' found      Not found for `libgoogle-perftools`, `libgoogle`, or `perftools` either. So I wonder how to find the correct name of libgoogle-perftools-dev so that `pkg-config --libs --cflags` can return something? Thanks.


title: How to configure sip trunk with different host details in Asterisk

text: I've read every forum on here, asterisk.org and google about this matter and still can't get it right. Here are the the SIP details. SIP Domain sip.provider.com:5060 Outbound Proxy sip10.provider.com:5090 User Name 1386269xxxx Password 123456789 Authorization ID 123456789 (Auth ID and Password are the same) As i said i tried to google it but all the tutorials show example without different host names and auth id. I do not know how to describe it in sip.conf. Also have to use this sip trunk to inbound and outbound calling both. And these tutorials are saying type=peer. So i am puzzled because i think it shoud be type=friend. Please help.


title: Search for pattern across multiple files and replace a sub-part in all occurences

text: I am helping a friend with her thesis written in LaTeX and I need a quick solution for a "search and replace". Using a terminal in Linux, how can I find the following pattern:               \caption{*\cite{*}}      and replace `\cite` with `\protect\cite` I was using Kate. Using its search feature I initially found more than 2000 hits and by refining my search I narrowed it down to some 300 hits. However I need to narrow it down further because I do not want to replace all `\cite`. I only want to replace `\cite` if it occurs within `\caption{}`


title: Do I need to setup my ZFS (using FreeBSD 10) for foreign-language files (e.g. filenames in Japanese/Thai/etc language)?

text: I am in the process of setting up a ZFS file server. I am planning to store all sorts of files in it. I have several hundred music tracks that are in Japanese/Korean native character. I want the file server to retain this native character naming. Do I need to setup my ZFS pool with utf8only and/or normalization options? e.g. copy japanese songs into file server (via mounted shared folder in Windows). If I view the files on my file server in Windows Explorer, they must be displayed in their native characters. Thanks a lot.


title: What does this Linux kernel trace mean?

text: I’m running a linux server at home which is mostly a file and e-mail server and a digital video recorder. All the data goes on an ext4 partition on a software raid-6. Every now and then (sometimes twice a day, sometimes twice a month) the whole server locks up. Sometimes I have a kernel report in the syslog which I cannot understand:               ------------[ cut here ]------------     kernel BUG at fs/ext4/inode.c:2118!     invalid opcode: 0000 [#1] SMP     last sysfs file: /sys/devices/virtual/net/ppp0/uevent     CPU 0     Modules linked in: ppp_async crc_ccitt nvidia(P) fcpci(P) scsi_wait_scan          Pid: 27841, comm: mythbackend Tainted: P            2.6.39-gentoo-r3 #2 System manufacturer System Product Name/M2N-E     RIP: 0010:[<ffffffff8116f580>]  [<ffffffff8116f580>] mpage_da_submit_io+0x268/0x3bf     RSP: 0018:ffff88004262bba8  EFLAGS: 00010286     RAX: ffffea000048b650 RBX: ffffea000051d118 RCX: 0000000000000000     RDX: 0000000000000000 RSI: ffff880000826890 RDI: 0000000000005d38     RBP: ffff88004262bcf8 R08: 000000000d654538 R09: 0100000000002820     R10: 0000000000005d0d R11: 0000000000000000 R12: ffff88004262bde8     R13: ffff88004262bd28 R14: ffff88005ef46150 R15: 0000000000005d37     FS:  00007fbeb053f700(0000) GS:ffff88007fc00000(0000) knlGS:00000000f74aa8e0     CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b     CR2: 00007fdcb7a36000 CR3: 000000006b721000 CR4: 00000000000006f0     DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000     DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400     Process mythbackend (pid: 27841, threadinfo ffff88004262a000, task ffff88007fb83330)     Stack:      ffff88007b193b88 ffff88004262bc98 ffff88004741c138 000004ac00001424      ffff88004262bc28 0000000000005d70 ffff88005ef46298 00000000811a337f      0000000000005d70 000000010000000e ffff88004262bc30 0000100000000000     Call Trace:      [<ffffffff811731df>] mpage_da_map_and_submit+0x2c6/0x2dc      [<ffffffff8117390a>] ext4_da_writepages+0x2d4/0x465      [<ffffffff810aafd6>] do_writepages+0x1c/0x26      [<ffffffff810a3bc0>] __filemap_fdatawrite_range+0x4b/0x4d      [<ffffffff810a3bea>] filemap_write_and_wait_range+0x28/0x51      [<ffffffff810fcba1>] vfs_fsync_range+0x30/0x75      [<ffffffff810fcc3b>] vfs_fsync+0x17/0x19      [<ffffffff810fcc66>] do_fsync+0x29/0x3e      [<ffffffff810fcc89>] sys_fdatasync+0xe/0x12      [<ffffffff8155f4fb>] system_call_fastpath+0x16/0x1b     Code: c1 00 02 00 00 74 09 f0 80 60 01 fd 4c 89 40 18 4c 8b 08 41 f7 c1 00 10 00 00 75 09 4c 8b 08 41 80 e1 20 74 0a 4c 39 40 18 74 04 <0f> 0b eb fe 41 f6 45 12 80 74 05 f0 80 48 02 80 f0 80 60 01 ef     RIP  [<ffffffff8116f580>] mpage_da_submit_io+0x268/0x3bf      RSP <ffff88004262bba8>     ---[ end trace c228cd85b8ef2f99 ]---


title: How do I invoke this most basic usage of csplit?

text: For a while I've wanted to learn how to use `csplit`, so tonight I tried practicing. I created a file with some text, and where I wanted to split the text, I wrote two colons (::) surrounded by two newlines, so that they formed separate double-spaced paragraphs from the rest of the text. Then I invoked `csplit` thus:               $csplit filename /::/      I thought I had failed when I saw that the only thing printed to standard output was some numbers. But when I looked at the directory listing I realized I had partly succeeded. One bunch of text had been cut off from the rest, the top bit. I just needed `csplit` to notice the other places where I had put two colons. But I couldn't figure out how to do that. I thought it might be               $csplit filename /::/*/      but alas, that did not work. Persuant to an answer below, I also tried               me@localhost:~/folder$ csplit story3.bkp /::/'{*}'      but I got               csplit: /::/{*}: integer expected after delimiter      so then i tried adding a space after /::/ -- which worked!


title: Replace a substring of filenames in a directory

text: There exists a directory, which includes several levels of sub-directories. Under these directories, there are a set of files whose names include a common word, e.g, `.cc`. How can I replace the `.cc` in the names of these files with `.cpp`?


title: Is there something like easy ubuntu for Fedora 18 (to install common non-free software)

text: I have just installed fedora 18 on my laptop. It is my home machine, so I will be using it for multimedia and similar things. Having come from Linux Mint, I realize thee is a lot of non-free stuff missing. Drivers for ATI graphics, Skype, and such like. I remember in the early days of Ubuntu there was a package easyubuntu which downloaded and installed a number of useful but non-free packages and drivers. Looking about I see Fedora had fedora-frog. I tried this but it says it is only for fedora 10 and 11. Is there any modern equivalent of this for Fedora 18?


title: Decode Flags for Kill Command

text: I am new to Shell Scripting. I saw this Command on a Book for Linux shell Scripting               $ kill -HUP 1234 >killout.txt 2>killerr.txt      I know what the command does, but i am not able to understand the flags **-HUP** please shed some light on it. I did a manual page search for the **kill** command but could not find any answers.


title: Bash - file, arrays and output

text: I have a file that contains employees names, departments and the cities the employee is in, something like:               John     IT     Chicago     Joshua     accounting     New York     Marcy     CEO     Los Angeles     ...       I have to transform this file to this format:               John?IT?Chicago     Joshua?accounting?New York     Marcy?CEO?Los Angeles      using the question mark as a field delimiter I am a newbie in Bash, but I have done this bash script so far:               fname="mix.txt"     exec<$fname          index=0     while read line ; do             ARRAYLINES[$index]="$line"             index=$(($index+1))     done < $fname          NUMBERLINES=$(grep -c "" $fname)     NUMBERLOOP=$(($NUMBERLINES/3))               count=0          for i in $(eval echo {1..$NUMBERLOOP})     do       one=$(($count+1))       two=$(($count+2))            LINE0=${ARRAYLINES[$count]}       LINE1=${ARRAYLINES[$one]}       LINE2=${ARRAYLINES[$two]}       ((count + 3))            FINAL="$LINE0?$LINE1?$LINE2"       echo $FINAL >> final.txt     done      The final file has the correct number of lines, but all lines are equal to the first employee data, like               John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago     John?IT?Chicago      any clues? thanks


title: USB Hubs and Linux

text: I have found over the course of 3 different distros that USB hubs simply don't work "out of the box". Is there any advice out there that can help me get my USB hub working in Crunchbang?


title: Standard I/O File Descriptors

text: I am new to Shell SCripting I code this               $ ls -l 1> stdout.txt      and I get the output as desired,               1> stdout.txt      redirects the output from standard output to the file stdout.txt. I don't see any such file existing on disk. What kind of file system supports such files, is it **ramfs**? Does this have any similarity to the **procfs** and **sysfs**?


title: How universal is the -L (dereference symlink) switch of the 'ls' command?

text: I have some software that, among other things, needs to:   * Assess a file's rwxrwxrwx permissions;   * Work under every possible flavor of Unix and Linux you can find in the wild. Currently, it does that running the `ls -l` command. If the file is a symlink, I have to get the permissions of the target file. The `-L` switch works nicely for that. The question: Are there flavors of Unix in which I run the risk of that switch not being available? If so, which ones? (If they're rare enough and old enough, I might just be able to ignore the problem.)


title: How to execute this particular shell command from Python?

text: OK, so, I have this non-functional shell script, which I am rewriting piece by piece in python, except I am getting an "unexpected "|" error" from the shell (see below):               #/bin/sh     LINES=`cat $@ | wc -l`          for i in `seq 1 $lines`; do          head -n $i $@ | tail -n 1 | text2wave -o temp.wav     sox "otherstuff.wav" "temp.wav" "silence.wav" "output.wav"     mv output.wav otherstuff.wav     rm -rf temp.wav          done      Which isn't really feasible in practice. But if I know the number of lines in a file, I can run it on a particular file to TTS the entire file and insert 10 seconds of silence between each line, because I don't have to say               LINES=`cat $@ | wc -l`      In the interest of flow control, and a way of incorporating the line count into a script I can use everywhere, am going to use Python to do this job. So far I have this fragment, also non-functional:               import linecache, os          for i in range(linelength):         lineone = linecache.getline(filename, i)         os.system("echo " + lineone + "|" + "festival --tts")      which gives this error in the `IPython` interpreter:               d 68.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 67.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 52.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 42.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 71.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 51.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 19.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 18.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 16.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 15.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 1.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 16.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 14.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     a 96.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     a 95.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     a 35.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     a 25.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 74.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 83.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     a 9.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 9.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 97.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 99.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 76.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 77.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 89.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 99.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     b 94.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 54.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     d 66.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 81.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512     c 61.     sh: 2: Syntax error: "|" unexpected     Out[60]: 512      and which replicates               for i in `seq 1 $lines`; do          head -n $i $@ | tail -n 1 | text2wave -o temp.wav      but is handier for testing everything, because it simply reads it out (`festival` and `text2wave` are part of the same package, one reads things out and the other writes files)... now, the number of lines being already retrieved and stored in `linelength` (I didn't have a problem getting python to do that): If it were simply               for i in range(linelength):         lineone = linecache.getline(filename, i)         os.system("echo somestuffnotaline | festival --tts")      then festival would say "somEhstuffnotaLINE", but I would not be as happy as I would if it would say, "c 62" -- "d 74" -- etc, those being the contents of each line in the files I am processing.


title: How to install non-outdated nvidia drivers using apt-get?

text: I tried using `apt-get install nvidia-current` after installation   I got `280.13` version, which is not the latest version(`290.10`).   so how can i force `apt-get` to download the latest driver? Edit: I'm on Linux Mint 12 and it was just released, so I think it is possible to get   the latest driver.


title: How to set the default domain for a new Roundcube webmail user?

text: New Roundcube identities get a '@localhost' domain part for their Email address. That is kind of useless. I would rather have Roundcube take the Apache HTTP host (minus a possible 'www.'), since my users will use 'their' associated domain for getting to the Roundcube interface. How can I configure this?


title: create md5 hash from a recursive file listing when some paths have spaces

text: I need to create an md5 hash of every directory and file inside of one main directory. The only thing that is keeping me from success is figuring out a way around files with a space in the path. I am using find for the recursive listing (I have read that find is the best way of doing this):               c5-26-1# find /root/newdir     /root/newdir     /root/newdir/1     /root/newdir/2     /root/newdir/3     /root/newdir/4     /root/newdir/5     /root/newdir/newdir2     /root/newdir/newdir2/1     /root/newdir/newdir2/2     /root/newdir/new     /root/newdir/dir     /root/newdir/new dir      When I try this with md5 I get two different outcomes, neither of which work:               c5-26-1# md5 $(find /root/newdir) # same outcome using for loop     MD5 (/root/newdir) = bc79a580f6c932937f6fcd454747db72     MD5 (/root/newdir/1) = 94ca98295946310ce88e185ea57486d5     MD5 (/root/newdir/2) = 8432051f64459be5a5e73dc2abd91795     MD5 (/root/newdir/3) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/4) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/5) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/newdir2) = 722165901468b9596dbdddfe118759fb     MD5 (/root/newdir/newdir2/1) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/newdir2/2) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/new) = 89d042c5f9d6ba485a654b543685ea86     MD5 (/root/newdir/dir) = 148538718feba14839f5d1072854c5f4     MD5 (/root/newdir/new) = 89d042c5f9d6ba485a654b543685ea86     MD5 (dir) = 148538718feba14839f5d1072854c5f4      or               c5-26-1# find -X /root/newdir | xargs md5     find: /root/newdir/new dir: illegal path     MD5 (/root/newdir) = bc79a580f6c932937f6fcd454747db72     MD5 (/root/newdir/1) = 94ca98295946310ce88e185ea57486d5     MD5 (/root/newdir/2) = 8432051f64459be5a5e73dc2abd91795     MD5 (/root/newdir/3) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/4) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/5) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/newdir2) = 722165901468b9596dbdddfe118759fb     MD5 (/root/newdir/newdir2/1) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/newdir2/2) = d41d8cd98f00b204e9800998ecf8427e     MD5 (/root/newdir/new) = 89d042c5f9d6ba485a654b543685ea86     MD5 (/root/newdir/dir) = 148538718feba14839f5d1072854c5f4      How do I account for directories with spaces?


title: Rename mailboxes in mutt

text: I'm using mutt with mutt-patched to manage 5 different Gmail accounts. For each of this accounts, I have INBOX as a mailbox with the `mailboxes +INBOX` configuration statement for each one. Then, I have 5 different uglies `INBOX` options to choose in my left column. Is there a way to rename that mailboxes screen names to get visually information about, for example, wich account belongs each one?


title: How can I direct input from two keypads to two respective terminals on one computer?

text: I want to connect two usb keypads to the same computer (Linux). Then I want to open 2 consoles #1 and #2 and execute one process on each one of them. Then I want to receive input from keypad #1 on console #1 and input from keypad #2 on console #2, that is, each keypad submits input to a specific process. How can this be achieved? Assume code is written in C. Thanks!


title: Oracle Linux 6.1 guest on Virtualbox 4.1 can't connect to network

text: I just installed VirtualBox 4.1 on my Windows system, and then added a Solaris 11 Express guest and an Oracle Linux 6.1 guest. Both installs went smoothly. But while the Solaris 11 guest has network access, the Oracle Linux box can't connect to the network. Both guests are using the same default network settings (NAT). I'm at a loss -- not sure what I need to configure on the OL6.1 side. To test basic network connectivity, I tried: `ping www.google.com`. No problems with the Solaris guest. On the OL6.1 guest:                   # ping www.google.com         ping: unknown host www.google.com         # ping 209.85.175.99         connect: Network is unreachable      Is there some sort of network setup that's required on OL6.1 that wasn't required on Solaris11? Thanks in advance. output from `ifconfig -a`:                   # ifconfig -a         eth0    Link encap:Ethernet  HWaddr  08:00:27:8E:A1:42                 inet6 addr: fe80::a00:27ff:fe8e:a142/64 Scope:Link                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                 RX packets:0 errors:0 dropped:0 overruns:0 frame:0                 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0                 collisions:0 txqueuelen:1000                 RX bytes:0 (0.0 b) TX bytes:328 (328.0 b)              lo      Link encap: Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0                 inet6addr: ::1/128 Scope:Host                 UP LOOPBACK RUNNING MTU:16436 Metric:1                 RX packets:0 errors:0 dropped:0 overruns:0 frame:0                 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0                 collisions:0 txqueuelen: 0                 RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


title: Extra-bytes error when unzipping a file

text: When I enter `unzip ../founation-latest.zip`, it outputs this: > warning [../foundation-latest.zip]: 248 extra bytes at beginning or within > zipfile (attempting to process anyway) The file is 138KB. It unzips correctly, but why am I getting this error?


title: Why are user account on remote server called shell account

text: Why are user accounts on a remote server called `shell account` , `remote account` sounds like a more intuitive name what is the reason behind this very unintuitive name ???


title: Why does this script show all files in the directory and not just PDF files?

text: I wrote the script below to find the number of PDF files in a given directory. However, it instead shows all the files in the directory:               #!bin/bash     message="."     message1="*.pdf"          ls -al $message $message1       What's wrong with the script?


title: Is there an easy way to check which program wrote to /var/log/messages?

text: Is there an easy way to check which program wrote to which file? I'd like to check which program wrote an error to /var/log/messages for example.


title: How to change metadata on an installed rpm

text: I need to modify information for an rpm which is already installed. E.g.               rpm -qi sip-section-call-1.0.19-1.noarch       Name        : sip-section-call               Relocations: (not relocatable)       Version     : 1.0.19                              Vendor: Self       Release     : 1                               Build Date: Thu 08 Sep 2011 02:47:43 PM CEST         Install Date: Mon 28 Nov 2011 03:31:09 PM CET        Build Host: ari.eris.com                        Group       : ari/JavaEE               Source RPM: sip-section-call-1.0.19-1.src.rpm       Size        : 3929998                         License: Commercial         Signature   : DSA/SHA1, Tue 01 Nov 2011 01:25:59 PM CET, Key ID bdd82316c28e369d       Packager    : ari       Summary     : ari com Engine sip Service       Description :       Provides session id's for applications.        Here, I need to modify the Description to some other value   How do I do it?


title: Why doesn't *nix keep track of file creation time?

text: I know about `ctime` and `mtime` and that their behavior is platform dependent. As I understand it, *nix does _not_ have any way of keeping track of file creation time. Is this a historical accident? If it's a technically difficult problem, what makes it so?


title: what is the difference between "chmod 775" and "chmod 2755"?

text: **Question** What is the difference between "chmod 775" and "chmod 2755" ?


title: Prevent wildcard expansion on find

text: Is there a way to prevent wildcard expansion on the `find` command so that the following would work?               find . -iname "foo [bar]"      As pointed out here, I tried running `set -f`, `set -o noglob` and `setopt noglob` just before `find` but it didn't work. It's a `bash` script and I'm using Ubuntu 10.04. I know I could just escape the wildcard characters but I fear I might leave one out.


title: OpenWrt ssh host identification with dyndns

text: If i ssh to my remote OpenWrt router ["via DynDNS"]   1. I get the message              @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @        2. Ok, i delete the old line in `~/.ssh/known_hosts`, add the new one   3. But my password wasn't accepted (even though I copy+pasted the good password)   4. But: if someone reboots the remote router it says:              @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @        5. Ok, again, I delete the line in `~/.ssh/known_hosts`, add the new one [the old one??], and presto! I can log in! Why? Is this because a dyndns update failed, and I'm trying to log in to the wrong IP? And if the router is rebooted, the dyndns IP will be updated, so that the IP is correct, and I can log in? Is that why it says “host identification failed”?   It happened for the 3rd time... I don't know what's exactly is going on.


title: Where is CONFIG_COMPAT_VDSO in make menuconfig?

text: I'm trying to compile a Linux Kernel to run light and paravirtualized on XenServer 5.6 fp1. I'm using the guide given here: http://www.mad- hacking.net/documentation/linux/deployment/xen/pv-guest-basics.xml But I'm stumped when I reached the option `CONFIG_COMPAT_VDSO`. Where is it exactly in `make menuconfig`? The site indicated that the options is in the _Processor type and features_ group, but I don't see it:               [*] Tickless System (Dynamic Ticks)                                       [*] High Resolution Timer Support                                         [*] Symmetric multi-processing support                                    [ ] Support for extended (non-PC) x86 platforms                           [ ] Single-depth WCHAN output                                             [*] Paravirtualized guest support  --->                                   [*] Disable Bootmem code (NEW)                                            [ ] Memtest (NEW)                                                             Processor family (Core 2/newer Xeon)  --->                            (2) Maximum number of CPUs                                                [ ] SMT (Hyperthreading) scheduler support                                [ ] Multi-core scheduler support                                              Preemption Model (No Forced Preemption (Server))  --->                [ ] Reroute for broken boot IRQs                                          [ ] Machine Check / overheating reporting                                 < > Dell laptop support (NEW)                                             < > /dev/cpu/microcode - microcode support                                <M> /dev/cpu/*/msr - Model-specific register support                      <M> /dev/cpu/*/cpuid - CPU information support                            [ ] Numa Memory Allocation and Scheduler Support                              Memory model (Sparse Memory)  --->                                    [*] Sparse Memory virtual memmap (NEW)                                    [*] Allow for memory hot-add                                              [*]   Allow for memory hot remove                                         [ ] Allow for memory compaction                                           [*] Page migration                                                        [*] Enable KSM for page merging                                           (65536) Low address space to protect from user allocation (NEW)           [ ] Check for low memory corruption                                       [ ] Reserve low 64K of RAM on AMI/Phoenix BIOSen                          -*- MTRR (Memory Type Range Register) support                             [ ]   MTRR cleanup support                                                [*] Enable seccomp to safely compute untrusted bytecode (NEW)             [*] Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)         Timer frequency (100 HZ)  --->                                        [ ] kexec system call                                                     [ ] kernel crash dumps                                                    [*] Build a relocatable kernel (NEW)                                      -*- Support for hot-pluggable CPUs                                        [ ] Built-in kernel command line (NEW)       FYI, I'm configuring **Gentoo's Kernel v2.6.36-hardened-r9**


title: Transparent local proxy to many proxies

text: In Firefox is add-on FoxyProxy, which makes possible use many proxy with filtering URLs. I need it for any browser, but in many of them it is only possible to set one proxy server. I need a transparent local proxy, which may filters URLs and forwards traffic to other proxies. I've heard about Squid, but I haven't found information about it. It is possible to set it in Linux (and how)?


title: How can I run a script immediately after connecting via SSH?

text: _I started to ask this question but answered it while I had it open. I'm going to post this question, follow it up with my solution and leave it open to other potential solutions._ **`<`backstory`>`** I'm a tmux and vim user. I like remote vim work as I don't have to worry about Ubuntu development machines kirking out when a flash movie gives me a kernel panic. Running tmux means that open files are waiting for me after I reboot and I can carry on from where I left off. I've had problems with vim running in a tmux session when I connect like so:               ssh example.com -t 'tmux attach'      UTF-8 issues crop up that don't crop up when shelling in normally and just attaching to a tmux session manually. **`<`/backstory`>`** So I want a reusable method of starting something on ssh login, that doesn't affect any of the other things I have configured in my `.zshrc` (or your `.bashrc` if you still use bash) that may be required for my development environment, that doesn't appear when I'm occasionally working locally on the very said machine.


title: Why does Crontab give me an error with my PHP script when running it from the terminal does not?

text: I'm having some problems with running the Crontab with PHP files. I have this same php scripts running in the Crontab for more than 6 months but some days ago mysteriously they stopped to execute the code correctly. The Crontab works but the script produces an error. The other interesting thing is that the same script runs without errors in the SSH Terminal. What should be the problem here? Is there a way to configure the Crontab to run with the same configuration of the SSH Terminal?


title: Drawing a state machine from logs

text: I have logs in the following format:               03/22/2011 14:45:06;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35707.arien.ics.muni.cz state from EXITING-RETURNSTD to EXITING-STAGEOUT (5-51)     03/22/2011 14:45:06;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35709.arien.ics.muni.cz state from RUNNING-PRERUN to RUNNING-RUNNING (4-42)     03/22/2011 14:45:07;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35708.arien.ics.muni.cz state from RUNNING-RUNNING to EXITING-EXITING (5-50)     03/22/2011 14:45:07;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35708.arien.ics.muni.cz state from EXITING-EXITING to EXITING-RETURNSTD (5-70)     03/22/2011 14:45:07;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35708.arien.ics.muni.cz state from EXITING-RETURNSTD to EXITING-STAGEOUT (5-51)     03/22/2011 14:45:08;0001;PBS_Server;Svr;PBS_Server;svr_setjobstate: setting job 35709.arien.ics.muni.cz state from RUNNING-RUNNING to EXITING-EXITING (5-50)      Now, I would like to graphically reconstruct the state machine, but I'm kind of hesitating on how to approach this problem. Cutting out the transitions shouldn't be a problem, but I'm not sure how to reconstruct a graphical representation from them.


title: How do I get gnome to use the same keymap for control as normal?

text: I'm using a relatively new centos system with Gnome. I have set the keyboard to dvorak, which was really easy and straightforward. However, for some reason, the control keys are still qwerty. I didn't have this problem with older Gnomes. ETA: This is only in terminal. emacs works fine.


title: Move preserves ownership of source files not allowing writes

text: Kindly Consider:               $ id # Me     uid=100(user1) gid=200(group1) groups=200(group1)          $ ls -l tnsnames.ora # So user1 has only read permission on below file.     -rw-rw-r-- 1 oracle dba 411024 Jul 28  2010 tnsnames.ora          $ cp tnsnames.ora tnsnames.ora_bak          $ cat tnsnames.ora_bak > tnsnames.ora # No write access     -bash: tnsnames.ora: Permission denied          $ cp -p tnsnames.ora tnsnames.ora_copy # Copy file and preserve mode, ownership, timestamps. Requires sudo to succeed completely.          $ ls -l tnsnames.ora_copy # Mode and timestamps preserved; ownership not preserved.     -rw-rw-r-- 1 user1 group1 411024 Jul 28  2010 tnsnames.ora_copy          $ mv tnsnames.ora tnsnames.ora_move          $ ls -l tnsnames.ora_move # Move preserves mode, ownership, timestamps.     -rw-rw-r-- 1 oracle dba 411024 Jul 28  2010 tnsnames.ora_move          $      **_Update_**               $ ls -l # As pointed out by @Gilles, the source (which is also the destination here) directory has r-x mode which allows mv to work.     drwxrwxrwx  3 oracle dba  4096 Aug 11 20:38 oracle      * * *   1. How can the `mv` command move the file and preserve mode, ownership, timestamps while we cannot do the same with `cp` ...?   2. Also if you do not have write access to a file, how is it possible to **_change_** the location (metadata) of the file using `mv`; or we can look at it the other way... where `mv` will first make a copy of the file, then how does it get the rights to set the owner/group on the copied file and delete the source file it does not have write permissions on..  * * * OS/Bash/Utility Version information:               $ echo $SHELL     /bin/bash     $ bash --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     ...     $ uname -a     Linux server1 2.6.18-371.8.1.el5 #1 SMP Fri Mar 28 05:53:58 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux     $ cp --version     cp (GNU coreutils) 5.97     ...     $ mv --version     mv (GNU coreutils) 5.97     ...


title: Which are best repo for Cent OS 5.7?

text: Which are best repo for Cent OS 5.7?   Should I install apt-get and use other deb packages on Cent OS? I mainly used Ubuntu which is really easy to update any packages.


title: Bash script that reads filenames from a pipe or from command line args?

text: I want my script to read a bunch of filenames (which may have spaces) given either as a glob or from STDIN and do stuff with them. I've been able to read either way separately, but not combine them. This reads globs from the command line:               for filename in "$@"; do         process_file "$filename"     done      And this reads from STDIN:               IFS=$'\n' read -d '' -r -a filenames     for filename in "${filenames[@]}"; do         process_file "$filename"     done      What I really want is to read from either one into an array so I don't have to duplicate my entire `for filename in...` loop twice. Sorry if this is obvious, I'm new to BASH. EDIT: I think the best thing would be to read from args if they're given, and otherwise wait for `STDIN`. How would I do that? EDIT: OK, the problem isn't what I thought it was. The problem is that process_file also asks for user input. Is there are way to read from `STDIN` until EOF, store that, and then start asking for input again?


title: variables in crontab

text: On our linux server we have a lot of entries. Many entries look like this:               15 13 * * 3 /very/long/path/to/binary/run.sh ...      These entries would be easier to maintain if I could write:               15 13 * * 3 $FPATH/run.sh      Where could I write this mapping:               FPATH=/very/long/path/to/binary


title: What does the vm.swappiness parameter really control?

text: Per the kernel documentation:               This control is used to define how aggressive the kernel will swap     memory pages.  Higher values will increase aggressiveness, lower values     decrease the amount of swap.      However this is kind of vague. I'm trying to figure out exactly what the parameter ultimately controls. I know it adjusts how aggressively the kernel tries to swap out pages, but what decision making process in the kernel code does it affect? Does it adjust how long ago a page must have been accessed before the kernel swaps it out? If so what does the default value of 60 represent? And how much is changed by a increment/decrement of 1 (a formula would be nice)?   Or does it swap out pages based on their access frequency?   Or something else?


What's the easiest way to find an unused local port? Currently I'm using something similar to this:               port=$RANDOM     quit=0          while [ "$quit" -ne 1 ]; do       netstat -a | grep $port >> /dev/null       if [ $? -gt 0 ]; then         quit=1       else         port=`expr $port + 1`       fi     done      It feels awfully roundabout, so I'm wondering if there's a more simple path such as a builtin that I've missed.


title: Are there command line tool(s) to convert video to WebM format in Debian Squeeze?

text: I would like to convert some videos to WebM format using Debian Squeeze. I prefer **command line tool(s)** although gui applications are also welcome. Video formats to convert from would most probably be .avi, .mp4 or .mkv but support for converting all known video formats would be nice. The ability to convert from video CD/DVD to WebM would also be cool.


title: How to make a permanent variable

text: In terminal:               VAR="Extremely long and often used command"     echo $VAR      Output: > Extremely long and often used command So far it works fine, but after restarting a terminal my variable doesn't exist. How to fix it?


title: Webserver establishing new outgoing connections from port 443

text: I've been trying to configure the firewall on a webserver running Apache using iptables commands. I took the approach of blocking all outgoing connections, except for those that are required. Everything seems to be working fine, although in the firewall logs I see some blocked outgoing connections with the source port of 443:               IPTables-Dropped: IN= OUT=eth0 SRC={SERVERIP} DST={DESTIP} LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=36863 DF PROTO=TCP SPT=443 DPT=37096 WINDOW=0 RES=0x00 RST URGP=0      In my firewall configuration file, I use the following rule:               iptables -A OUTPUT -p tcp --sport 443 -m state --state ESTABLISHED,RELATED -j ACCEPT      The fact that the packets are being dropped, suggests that the connection from port 443 has to be a NEW connection, which I want to block since I don't see the reason why my server should connect to any other machine this way. The destination IPs change and look like IPs of ordinary clients, based on their location and whois information. What am I missing here? Is this expected behavior that is somehow dictated by the HTTPS connection or are those connections suspect? Should I ACCEPT NEW connections as well? TLDR; The webserver seems to be trying to establish NEW connections from port 443 to various clients, as indicated by the firewall log. Should this be happening? Should I allow this traffic? What could be its source? EDIT: We're running Ubuntu Server 12.04               apache2 -v     Server version: Apache/2.2.22 (Ubuntu)     Server built:   Jul 12 2013 13:37:10          iptables -V     iptables v1.4.12          iptables -L -v     Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination       814 86082 ACCEPT     all  --  lo     any     anywhere             anywhere     2382K   99M ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED         2   108 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:ssh      1404 77906 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:https       286 15356 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:http         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:domain dpts:1024:65535 state ESTABLISHED         0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spt:domain dpts:1024:65535 state ESTABLISHED         1    83 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spts:1024:65535 dpt:domain state NEW,ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:domain dpt:domain state NEW,ESTABLISHED         0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-reply state RELATED,ESTABLISHED        47  3892 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-request state NEW,RELATED,ESTABLISHED        94 28900 LOGGING    all  --  any    any     anywhere             anywhere          Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     all  --  any    lo      anywhere             anywhere         0     0 ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED          Chain OUTPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination       527 34635 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spts:1024:65535 dpt:domain state NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spts:1024:65535 dpt:domain state NEW,ESTABLISHED       407 60108 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:domain dpts:1024:65535 state ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:domain dpt:domain state ESTABLISHED         0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh state NEW,ESTABLISHED      1634  206K ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:https state NEW,ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:https state NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http state NEW,ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp dpt:http state NEW,ESTABLISHED     25185   42M ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spt:https state NEW,RELATED,ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:https state NEW,RELATED,ESTABLISHED      1198  260K ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spt:http state NEW,RELATED,ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:http state NEW,RELATED,ESTABLISHED     4891K  358M ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp spt:ssh state ESTABLISHED         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere             udp spt:ssh state ESTABLISHED         0     0 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-request state NEW,RELATED,ESTABLISHED        47  3892 ACCEPT     icmp --  any    any     anywhere             anywhere             icmp echo-reply state RELATED,ESTABLISHED        69  2831 LOGGING    all  --  any    any     anywhere             anywhere          Chain LOGGING (2 references)      pkts bytes target     prot opt in     out     source               destination        89 16387 LOG        all  --  any    any     anywhere             anywhere             limit: avg 15/min burst 5 LOG level warning prefix "IPTables-Dropped: "       163 31731 DROP       all  --  any    any     anywhere             anywhere


title: What's the purpose of the randomart image for user (not host) SSH keys?

text: The `ssh-keygen` generates the following output:               The key fingerprint is:     dd:e7:25:b3:e2:5b:d9:f0:25:28:9d:50:a2:c9:44:97 user@machine     The key's randomart image is:     +--[ RSA 2048]----+     |       .o o..    |     |       o +Eo     |     |        + .      |     |         . + o   |     |        S o = * o|     |           . o @.|     |            . = o|     |           . o   |     |            o.   |     +-----------------+      What is the purpose of this image, does it provide any value for the user? Note this is a client (user) key, not a host key.