Why are incoming packets on a TAP interface seen with tcpdump but not with iptables?

A program injects packets on a Linux TAP interface (these packets are coming from a virtual machine). Specifically, these are DHCP requests (so they're UDP). I can see the packets with `tcpdump` but not with `iptables`, and they don't reach the local DHCP server either. Why not, and how do I fix that? **Update** : I tried injecting IP packets directed to the address of the `tap0` interface. I see the ARP requests coming in from the VM in `tcpdump -i tap0`, but the network layer does not reply. If I send ARP requests to the VM, it sees them and replies to the host (and the replies show up in `tcpdump` but are otherwise lost). Another observation: `ifconfig tap0` shows that the TX dropped packet count is incremented for each packet that's injected onto the host. Why TX?               # ifconfig tap0     …               TX packets:0 errors:0 dropped:958 overruns:0 carrier:0               collisions:0 txqueuelen:500               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      * * * _The long story:_ On a Linux host (running Ubuntu 10.04), I'm running a virtual machine which amongst other things emulates an Ethernet card. It does so by communicating with a helper program that's in charge of injecting and capturing Ethernet packets onto the hosts's network stack. The virtual machine is an ARM chip emulator, and the helper program is called `nicserver`; all I know about it is what is found in the ARM documentation. I want to establish an Ethernet link between the VM and the host, and above that I want an IP link. The VM obtains its IP address over DHCP. I do not want any communication between the VM and the rest of the world, only with the host, so I created a virtual network interface `tap0` with               tunctl -u gilles     ifconfig tap0 192.168.56.1 netmask 255.255.255.0 up     nicserver -p 7801 -a tap0 &      Now I boot the VM, and I can see it's sending DHCP requests with `tcpdump -n -i tap0 -vv` (the DHCP client doesn't time out, I'm just showing one sample request here):               tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size 96 bytes     18:29:23.941574 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 576)         0.0.0.0.68 > 255.255.255.255.67: [no cksum] BOOTP/DHCP, Request from 02:52:56:47:50:03, length 548, xid 0x238a7979, secs 46, Flags [none] (0x0000)               Client-Ethernet-Address 02:52:56:47:50:03 [|bootp]      I've set up Dnsmasq on the host to serve the requests, but it's not seeing any incoming request. The Dnsmasq server doesn't even see the incoming requests (I straced it). So I tried observing the packets with Iptables. (All the filter/INPUT rules are shown; there are no mangle or nat rules).               Chain INPUT (policy ACCEPT 2366K packets, 5334M bytes)      pkts bytes target     prot opt in     out     source               destination        119 39176 LOG        udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:67 LOG flags 4 level 4 prefix `[DHCP request] '       119 39176 DROP       udp  --  eth1   *       0.0.0.0/0            0.0.0.0/0           udp dpt:67         2   490 LOG        udp  --  tap0   *       0.0.0.0/0            0.0.0.0/0           LOG flags 4 level 4 prefix `[in=tap0] '        26  6370 ACCEPT     udp  --  tap0   *       0.0.0.0/0            0.0.0.0/0            0     0 ACCEPT     all  --  tap0   *       0.0.0.0/0            0.0.0.0/0         3864  457K ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0         All these incoming DHCP requests are on `eth1` (and I'm careful not to ignore these so as not to anger my colleagues and my network admin). Those UDP packets on `tap0` come from the local Samba server. The DHCP request packets that I see with tcpdump do not appear to go through the packet filter! Why do I see incoming broadcast packets on `tap0` with `tcpdump` but not with `iptables` (nor with programs listening on the machine)? And what do I need to fix so that these packets are seen, as they would be if they were coming on an Ethernet interface?


What is the difference between modify and change in stat command context?

The `stat` command's manual page says: > >        %x     Time of last access >        %y     Time of last modification >        %z     Time of last change >   I am unable to understand what is the difference between _modify_ and _change_. What I understand both are synonyms (English is not my mother tongue), but their output is different. I tried following command                stat --printf="Change %z\nAccess %x\nModify %y\n" p.txt      Now when I open p.txt, access time is changed, I go into insert mode, edit the file, modify and change time remains same. > Change 2010-10-06 12:48:39.286252389 +0500   >  Access 2010-10-06 12:49:14. **962243456** +0500   >  Modify 2010-10-06 12:48:39.234498878 +0500 When I write the changes to file `:w`, modify and change, both change but give different values. > Change 2010-10-06 12:51:21. **949082169** +0500   >  Access 2010-10-06 12:51:21.908246082 +0500   >  Modify 2010-10-06 12:51:21. **908246082** +0500 So what is the meaning of modify and change in this context? Time of modification and change give time of which event?   Thanks


Bind locally installed library

I have no root-acces on a machine and i'm trying to install a library called GiNaC locally in my home folder. I use this tutorial http://www.ginac.de/tutorial/Configuration.html#Configuration. At the end there is an example (dont need to disable the shared-library and i dont need a specific compiler). Unfortunatly if I do this               export CPPFLAGS="$(CPPFLAGS) -I$/home/xxx/include"     ./configure      this is the result...               ...     checking for g++... g++     checking whether the C++ compiler works... no     configure: error: in `/home/redies/ginac-1.6.2':     configure: error: C++ compiler cannot create executables     See `config.log' for more details      In config.log there is the line               CPPFLAGS='CPPFLAGS: command not found -I$/home/xxx/include'      Any ideas?


Why does my vim-7.3 compile fail to include clientserver?

I am trying to compile vim-7.3 will all features enabled. I ran configure with               $ ./configure --with-features=huge --enable-gui --enable-cscope     $ make ; make install      When I check the version, it shows several features are still not installed. > Huge version without GUI. Features included (+) or not (-): +arabic +autocmd > -balloon_eval **-browse** ++builtin_terms +byte_offset +cindent > **-clientserver -clipboard** +cmdline_compl +cmdline_hist +cmdline_info > +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con > +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search > +farsi +file_in_path **....** Now according to vimdoc   > N _+browse_   >  N _+clientserver_ It says > Thus if a feature is marked with "N", it is included in the normal, big and > huge versions of Vim. `features.h` also says > +huge all possible features enabled. According to the above mentioned two resources, `huge` means all features are enabled. Even if not all, then at least `+clientserver` and `+browse` has to be enabled in `huge` compilation mode. But my experience says otherwise. Huge compilation fails to include browse and clientserver feature.   1. Why is it so? Is my understanding of the document is incorrect?     2. How to enable clientserver feature?     3. How to enable gui?     4. Is it possible to enable **all** features simply? I tired huge as `features.h` suggested it will enable all possible features, but it didn't work. Thanks for your time. # Edit: Problem solved! Thanks to all of you guys for your priceless help.   I checked, `vim73/src/auto/config.log`, it was clear that lots of dependencies are missing. Gert post gave an idea which packages are required. I used:               $ yum -yv install libXt.i686 libXt-devel.i686 \     libXpm.i686 libXpm-devel.i686 \     libX11.i686 libX11-common.noarch libX11-devel.i686 \     ghc-cairo-devel.i686  cairo.i686   \     libgnomeui-devel.i686 \     ncurses.i686 ncurses-devel.i686  ncurses-libs.i686 ncurses-static.i686 \     ghc-gtk-devel.i686 gtk+-devel.i686 \     gtk2.i686  gtk2-devel.i686 \     atk-devel.i686 atk.i686 \     libbonoboui.i686 libbonoboui-devel.i686       Some of the packages were already installed, others were not. After that:               $ ./configure --with-features=huge --enable-cscope --enable-gui=auto     $ make ; make install      Now my vim has all the packages associated with `huge`. > Huge version with GTK2 GUI. Features included (+) or not (-):   >  +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset > +cindent   >  **+clientserver** +clipboard +cmdline_compl +cmdline_hist +cmdline_info > +comments   >  +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff   >  +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi   >  **...** Thanks


How are file permissions calculated?

Using `chmod` I could set the permissions for a file, but if the parent ( `..` ) directory had conflicting permissions, what would happen? And if I create a new file, using `touch` or something similiar, how are the initial permissions calculated? Are permissions inherited it from `..`? And why can't I do anything in directory when I removed the `executable` permission flag?               $ mkdir temp;     $ chmod -x temp;     $ touch temp/a;     $ ls temp;     touch: cannot touch `temp/a': Permission denied


Linux find Wifi Networks trotocol(a/b/g/n) version of all available access points

I do use `iwlist wlan0 scanning` and it gives me a fair amount of data, but one part is missing. It is protocol version. By protocol I mean (a/b/g/n). It would be very good to have these commands in standard distro. I am using OpenWRT.


Create a File with Touch on a specific Directory

I want a create a file with a specific extension(.done). I am using the command touch. Something Like:               touch `basename $UNZIPFILE`".done"       It's creating the file but in current directory. I want to create this file in a specific directory. Is there a option to provide the directory ? I checked : http://ss64.com/bash/touch.html , but could not figure out. I can think of one option is before this command I can do a `cd requiredDIR` Is there any other way, I can specify the Directory on the same command, so that I dont have to change the Directory?


How to `tee` dropping all CR lines only in the file but not stdout?

When using e.g. `rsync`, I'd like to `tee` its output such that I can both view the current progress live, and have a log for later. Using just piping `| tee logfile` the logfile will contain many lines à la               0 files...<CR>     100 files...<CR>     200 files...<CR>      Where the carriage-return `<CR>` is used to have the live output replace the current line. For the `stdout` part of `tee` this is exactly the desired behavior, but is there any way to have the logfile drop anything between a `<CR>` and the last `<LF>`? (I'm not asking for a `rsync` specific answer, that's just the example!) Maybe some `sed`-piping in between?


How could I make multiple symbolic links for multiple directories, conveniently

lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v122 -> /home/files/video122     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v123 -> /home/files/video123     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v124 -> /home/files/video124     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v125 -> /home/files/video125     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v126 -> /home/files/video126     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v127 -> /home/files/video127     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v128 -> /home/files/video128     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v129 -> /home/files/video129     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v130 -> /home/files/video130     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v131 -> /home/files/video131     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v132 -> /home/files/video132     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v133 -> /home/files/video133     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v134 -> /home/files/video134     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v135 -> /home/files/video135     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v136 -> /home/files/video136     lrwxrwxrwx  1 deploy users    20  1월 23 18:15 v137 -> /home/files/video137      These are symbolic links.   If new `video138 ~ video150` volumes are mounted, I have to make `links v138~v150` of that.   Could you imagine a bash magic? (I tried to use `brace expansion` but couldn't make it work.)   It would be much better if the magic script can create the symlinks automatically, with detecting the volumes' mount.


How to power off a system but still keep it available on the network

I'm looking into installing a file server on my network, for serving data and backups. I want this machine to be available at all times, but I would rather not keep it on all the time (as to conserve power). Is it possible to set things up so that the thing automatically suspends (or powers off) after some time and then automatically powers back on when I try to connect to it (using some wake-up on LAN magic, without having to send explicit WOL packets)?


Could you share a link to a good catalogue of Linux distros to choose?

> **Possible Duplicate:**   >  How do you choose a distribution? I'd like to see a list of all the Linux distros by their mission (like generic, firewall, mail server, free-only, enterprise, virtual machines host, virtual machine guest, audio production, etc.) with basic description and analytics (like first release date, package management system, development activity, people behind the distro (like core team size or, for example "Canonical corporation" for Ubuntu) release cycle description, popularity, etc.). Where can I find such a catalogue? I've tried distrowatch.com, but couldn't find any classification there. I'd like to be able, for example, to see "all the distros meant specially for a firewall (or a LAMP server) deployment", or "all the distros available as LiveCDs" etc.


How does fcron knows whether the job was run?

I recently migrated from vixie-cron to fcron on my laptop. I have a question: how does fcron knows if a particular job was run in given period of time? As a file can change during running, what constitute a different job? if I change for example from running daily to weekly, will it be re-run?


Accounts attacked

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


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

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)?


suid-root doesn't have effect

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?


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

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?


Pacman Full system upgrade ask for replacing packages

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 ?


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

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?


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

`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"


GTK: Specify application foreground and background color on command line

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).


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

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.


Shortcut key for scrolling inside a terminal

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.


Reformat terminal output and save to file

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.


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

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?


Should I assign gid explicitly when I create a group?

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?


How to export variables from a file?

`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?


echoing symbols in terminal/bash

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


root can only login with bash restricted mode

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" ...


Testing Scripts

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?


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

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`?


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

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"?


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

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.


Setting user environment variable permanently, outside shell?

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?


Linux Kernel Firewire Feature: Use Unclear

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?


OpenVPN not showing easy-rsa

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


cabal dies on NixOS in KVM

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.)


Can (and how) KVM use NTFS storage?

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 ...)


Verify if a hard drive is encrypted on Linux

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?


Gnome: Show full path in Nautilus

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)


Moving latest files from one directory to another

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


Launch a GTK3 aplication without customized gtk settings?

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?


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

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?


Pause music while screen is locked

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"


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

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?


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

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`.


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

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.


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

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.


What is using memory?

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


Install a basic CentOS VM on Fedora 19 with libvirt

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 ?


Install wifi modem buffalo airstation g54

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?


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

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?


samba4: odd username mapping?

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


Help With Simple Script - Absolute, Relative Paths

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.


how to disallow user to change process group

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).


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

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?


What determines the maximum file size in ext2 file system

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 ?


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

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


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

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!


What is the difference in these two bash environments?

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


Enlightenment (E17) not opening settings windows or click menu

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.


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

Is there anything like CompCache for FreeBSD?


RHEL6 not registering correctly when using PXE boot via Cobbler

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?


httpd memory usage very high

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.


Using xdg-open for accessing network with normal explorer

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?


input, evdev alternatives?

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?


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

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.


Sysrq keeps taking screen shots

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


How to dualboot Win7 and Chrome-OS on Netbook

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.


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

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.


GNU texinfo directory search method?

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?


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

**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.


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

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.


How to configure sip trunk with different host details in Asterisk

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.


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

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{}`


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

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.


What does this Linux kernel trace mean?

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 ]---


How do I invoke this most basic usage of csplit?

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!


Replace a substring of filenames in a directory

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`?


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

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?


Decode Flags for Kill Command

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.


Bash - file, arrays and output

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


USB Hubs and Linux

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?


Standard I/O File Descriptors

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**?


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

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.)


How to execute this particular shell command from Python?

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.


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

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.


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

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?


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

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?


Rename mailboxes in mutt

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?


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

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!


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

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)


Extra-bytes error when unzipping a file

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?


Why are user account on remote server called shell account

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 ???


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

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?


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

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.


How to change metadata on an installed rpm

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?


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

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?


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

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


Prevent wildcard expansion on find

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.


OpenWrt ssh host identification with dyndns

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.


Where is CONFIG_COMPAT_VDSO in make menuconfig?

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**


Transparent local proxy to many proxies

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)?


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

_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.


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

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?


Drawing a state machine from logs

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.


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

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.