Unable to login to Linux box running Xfce using LXDM login manager

I am running a Linux box with the `LXDM` login manager and Xfce as my desktop environment. Every time I login, this is the screen I get: ![enter image description here](http://i.stack.imgur.com/mh0Nh.png) If I enter the right password, the system logs me in without any problems. But if I enter the wrong password, after a few seconds, this is what I get: ![enter image description here](http://i.stack.imgur.com/78GEG.png) Because of this, I end up rebooting the whole machine so that I can get the input box to enter the correct password. Could someone please tell me how I might solve this issue? Or at least point me in the right direction?


Which header defines the macro that specifies the machine architecture?

_Shorter version of question:_ Which C header contains the macro that corresponds to the machine architecture of the system (e.g., `__x86_64__`, `__ia64__`, `__mips__`?) _Longer version of question:_ I'd like to run the ganglia monitoring tools on a Tilera-based system that runs Linux. Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called machine_type_func that returns the machine architecture. The body of this function is determined at compile-time, it looks like this:               g_val_t     machine_type_func ( void )     {        g_val_t val;          #ifdef __i386__        snprintf(val.str, MAX_G_STRING_SIZE, "x86");     #endif     #ifdef __x86_64__        snprintf(val.str, MAX_G_STRING_SIZE, "x86_64");     #endif     ...        return val;     }      I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in.


Vim markers and macros

Is there a way to make a macro operate up to a marker? I know if I do `5@a` my macro will operate on 5 lines. Example:               set marker with `mc`     record a macro with `qa`     ... now what?      Obviously `'c@a` just moves the cursor to the marker at c. I've tried buffers, `"b'c`, but that just goes to the marker. I'm probably missing something very basic or just looking in the wrong places.


Is there a maximum size to the bash history file?

Can I increase the size of the command history in bash? Note that I use a Red Hat Linux computer in the undergraduate astrophysics department here (so I don't get that many privileges).


Disable /net ghosting for autofs5

I recently have been trying out Arch Linux. It seems that their autofs has a usability bug, although I confess that I'm new enough to Arch that I may be missing something horribly obvious. I want autofs to automagically mount hosts under `/net` like it has always done. Traditionally it used `/etc/auto.net` to accomplish this, however it seems that they've done away with this and now you simply use the following line:               /net -hosts --timeout=60      Fine and dandy, most things seem to work. However, under Arch it seems that ghosting is enabled by default. This is a bad thing, because it uses my hosts file which only contains aliases of my local host (which is NOT running an NFS server, mind you). As a result, I get all kinds of errors about being unable to mount these hosts _every time_ I run an `ls` in `/net`. Notice: I'm not using `\--ghost`, and yet it enables it by default. Arch confirms this on their wiki. This is extremely annoying, how do I _disable_ ghosting? Google has failed me horribly, any insight is appreciated. Thanks.


How to enable WIFI on VMWare Fedora 12? (It's detecting and working fine on Windows 7)

I am new to Linux. I have Fedora 12 running on my VMware. I am unable to see any options to enable WIFI connection on Fedora. When I am accessing Internet through WIFI and its working perfectly fine on Windows 7 (on which VMware is running on). Am I missing something here? Can someone help me out with this!


How to define a `bc` function for later use?

I've always found `bc` kind of mysterious and intriguing. It was one of _the_ original Unix programs. And it's a programming language unto itself. So I gladly take any chance I can find to use it. Since bc doesn't seem to include a factorial function, I want to define one like so:               define fact(x) {       if (x>1) {         return (x * fact(x-1))       }       return (1)          }      But... I can't then reuse that, can I? I'd want to be able to do something like               me@home$ bc <<< "1/fact(937)"


What does ./ mean?

I'm having a hard time getting what `./` does. In the Linux Essentials books, it asks me in an exercise to delete a file named `-file`. After googling, I found that I need to do `rm ./-file` but I don't get why!


Upstart: How to run a "stop" before stopping other services?

I recently found out about the upstart "service starter" that Ubuntu is using and that is (apparently) the future to start/stop jobs in Linux. It's pretty new to me (I was used to the old SysV system of putting scripts in `/etc/rc[X].d/`) and I don't know if it's possible to stop a service (call the service with the "`stop`" parameter, although the parameter doesn't seem to matter that much anymore) before other services are stopped. I want to run a small script that informs a remote server that the machine is shutting down. I need to run that script before the `dbus` and the `network` services are taken down. Is there any way of doing it with Upstart? Or... better said, what is the way of doing that through Upstart `.conf` files? (I'm sure there's a way, I just don't know it)


ssh-agent not starting in OpenSuSE desktop

It seems that ssh-agent is not starting on my OpenSuSE system. When I run `pgrep -fl ssh-agent`, the result is blank. On my Linux Mint laptop, I get `1785 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session- manager`. How do I fix this? Can anyone with OpenSuSE check to see if it's not started up by default, or if I maybe messed something up? ### things tried... I've tried adding the following to `.xinitrc`,               if test -S "$SSH_AUTH_SOCK" -a -x "$SSH_ASKPASS"; then           ssh-add < /dev/null     fi      and my `.xsession` file contains,               ssh-agent {       ssh-add &       startkde     }      but neither of these things seems to do anything. Thanks in advance!!


Is there some way to make alias expansion work inside if...fi on Bash?

Check this script:               #!/bin/bash     if true;then         alias WeirdTest='uptime';shopt -s expand_aliases         WeirdTest     fi     WeirdTest      The first time `WeirdTest` is executed it says "command not found".


phpmyadmin in linux installation

I am trying to install **Request Tracker** tool in my **RHEL 5.6** machine.I am following the instructions as mentioned in this link. However, I am facing couple of issues. The first issue is in the below step. I have some dependency issues for php files.               # yum install  rpm* nmap expect vsftpd net-snmp* ntp* subversion subversion-devel      mysql mysql-server mysql-devel screen perl-Crypt- PasswdMD5 graphviz php-xml      php-cli php-mhash php-ldap php-devel php-pdo php-imap php-readline      php-ncurses php-soap php-snmp php-common php-mcrypt php-odbc php-mbstring      php-gd php-bcmath php php-xmlrpc php-pear php-mysql php-dba mod_perl-devel      mod_auth_mysql mod_perl mod_authz_ldap gd gd-devel gd-progs gcc*      -- exclude=gcc-java* -- exclude=gcc4-java phpmyadmin mod_fcgid perl-GD      perl-GnuPG-Interface perl-GraphViz perl-YAM       So, I tried to do the below command.               yum install php      When I do the above command, I received the below message.               Package matching php-5.1.6-40.el5_9.i386 already installed. Checking for update.     Nothing to do      So, as per the tutorial link, I needed **phpmyadmin**. So, I used the below command. It gave me the below output.               Error: Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-5.el5.i386 (epel)     Error: Missing Dependency: php-common = 5.1.6-40.el5_9 is needed by package php-gd-5.1.6-40.el5_9.i386 (rhel-i386-server-5)      If I try to install the missing dependencies, **php-common** using yum command, I receive the below message.               Package matching php-common-5.1.6-40.el5_9.i386 already installed. Checking for update.      If I try to install the missing dependency, **php-api** using yum command, I receive the below message.               php53-common-5.3.3-21.el5.i386 from rhel-i386-server-5 has depsolving problems       --> php53-common conflicts with php-common      How can I install the phpmyadmin so that I can continue with the installation of Request tracker tool?


Install another PHP version. Fedora 17

How can I install another PHP version? I have php 5.4.5 for now, but I need the version 5.3.15 running too. How can I perform this on Fedora 17? Without using a Virtual Machine?


Is there any web browser that uses keybinding apart from uzbl?

I have just found out about uzbl but for some reason it crashes with segmentation fault when I log into gmail (Arch). I don't have the time nor the knowledge of dealing with this segmentation fault so I have thought about using another browser of that type. Are there any? Thanks.


Should I put application into /usr/local or /usr/local/share?

What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share. For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be               /usr/local/scala-2.9.1       or               /usr/local/share/scala-2.9.1      Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs. **Important:** I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.


Linker error: /usr/bin/ld: cannot find -lgcc_s

I am trying to compile `symlinks` (tar.gz-file), which is a very small tool with one line for compilation:               gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c      which gives the error               ....         /usr/bin/ld: cannot find -lgcc_s     /usr/bin/ld: cannot find -lgcc_s     collect2: ld returned 1 exit status      The output of               /sbin/ldconfig -p | grep libgcc      is               libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1      and trying to include the mentioned directory directly               gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/  -O2 -N -s -o symlinks symlinks.c      produces the same error. Three questions:   1. Why does it not work with the first command, as the lib seems to be in the search path   2. Why does including the path itself does not help   3. How to fix this?


A shell-like environment for binary processing

This question came to me a couple of times before, now in response to the question Loop through binary data chunks from stdin in Bash Answers given in http://stackoverflow.com/questions/993434/what-language-is-to-binary-as-perl- is-to-text were also not satisfactory. I'm looking for a scripting environment suited specifically to handle I/O with binary files. I know I can use one of the fully-fledged programming languages (c/Python/...) but they have an enormous initialization and coding overhead (allocation and fread/fwrite in c, bitstrings in Python...) not to mention they are less suited for scripting (calling other applications from it). Perl is no better with its `unpack` functions, string-oriented operation and goofy syntax. Something like `od`, but as a language. What I expect:   1. set or change endianness with a single switch/command.   2. simple specification of requested type (something like extending bash `read var` with `int32 var`, `float var` etc.).   3. handling of binary through pipes, skipping of specified number of bytes.   4. standard scripting flow control (for/if/...) that we are used to. I'd like to process raw data (photography, scientific data, unknown and poorly documented formats) with the same ease and insight that you get when inspecting ASCII files. I'm using `c` now, but it's not optimal for ad-hoc scripting, and can't be interactive. Does anyone know a tool like that? No clicky GUI software, please, it needs to work over ssh, from other scripts and so on. "Does not exist" is an acceptable, but depressing answer.


Different between `ulimit -e` and `renice`?

I would like to run a backup script in low CPU and disk I/O. Is there any different between this:               #!/bin/bash          ulimit -e 19     ionice -c3 -p $$      and this:               #!/bin/bash          ionice -c3 -p $$     renice -n 19 -p $$


present users a login prompt? /bin/login? getty?

I have a service that execs a command when a user connects to it through a socket, and redirects everything it receives to the executed program. It works ok with shells like bash, giving the user a remote shell. Instead of forking bash or sh, I'd like to run something that asks for user and password, like `/bin/login` Is that the correct command to run? Isn't there anything that a non-root service could use to do the same? I thinks `getty` calls `/bin/login`, but can I just run it as a user? I guess I could install telnetd and redirect to `telnet localhost` but I'd rather not run a telnet server.


Why are rules not combining in an ssh config file?

It seems like the following would work as expected, i.e., that the second rule, having a hostname that matches the first rule, would apply it.               Host *.hostname.com      User myuser      IdentityFile ~/.ssh/myidentity          Host blah      HostName complicated.hostname.com      However typing `ssh blah` only applies the second rule (and not the user or identity file of the first one). I have two questions:   1. Why is this happening?   2. Is it possible to (simply) do what I am trying to do?


Home folder structure in Ubuntu 12.04.1?

Long story short, i just accidentally deleted my entire home folder. Thankfully it seems like the hidden files are still there. I'm not sure, but aren't all of the folders within the home folder (Desktop, Downloads and whatever else is in there) empty by default? If that is the case, could some super nice person just name all of the files located in the home folder so that i can rebuild it? Thanks a bunch in advance


Return value of commands when using stdin?

Imaging I am executing the following command:               echo "root:mypass" | chpasswd      How can I get the return code / error code returned by chpasswd? Is that possible in this case at all? I tried               RET = `echo "root:mypass" | chpasswd`      but this gives me only "command not found"?


Persistent folder missing from home folder, despite correct password and no errors

Tails 1.0 on stick 1. Password entered correctly on login screen for persistent storage (otherwise it would complain.) Booting from another (older) Tails stick, stick 2, can unlock and mount stick 1's persistent storage just fine and see all files. So why when I boot from stick 1 and enter the password correctly, does the Persistent folder not appear in the home folder (not in file browser GUI nor `sudo ls -a ~/`)? There's no error or anything, so why might it be missing?


Cant detach/ kill xm console on node server

please advice, why I cant attach console from xm command? > [root@vm ~]# xm console vm104   >  Another console has already been attached to guest


Monitoring interface changes with udev, especially if a route is set

Is there a way to monitor interface up/downs, especially to check if a route is setup or removed, with udev?


Issue with degraded raid5 after power outage

I have a raid5 that consists of 8 disks. After a power outage mdadm tells me that the raid is degraded. Here is the output:               /dev/md0:             Version : 0.90       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)        Raid Devices : 8       Total Devices : 7     Preferred Minor : 0         Persistence : Superblock is persistent              Update Time : Thu Aug  2 18:42:05 2012               State : clean, degraded      Active Devices : 7     Working Devices : 7      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 64K                     UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a              Events : 0.9189750              Number   Major   Minor   RaidDevice State            0       8        0        0      active sync   /dev/sda            1       8       16        1      active sync   /dev/sdb            2       8       96        2      active sync   /dev/sdg            3       8      112        3      active sync   /dev/sdh            4       8       32        4      active sync   /dev/sdc            5       8       48        5      active sync   /dev/sdd            6       8       64        6      active sync   /dev/sde            7       0        0        7      removed      So /dev/sdf is missing. So I tried to get some infos about this drive. smartctl does not report any issues and `fdisk -l` lists it as expected. Lastly I tried `mdadm -E /dev/sdf` and I get this output:               /dev/sdf:               Magic : a92b4efc             Version : 0.90.00                UUID : 09dd4536:a6153f6b:f1f4aaa9:53aab85a       Creation Time : Sat Jul 10 09:08:28 2010          Raid Level : raid5       Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)          Array Size : 13674601472 (13041.12 GiB 14002.79 GB)        Raid Devices : 8       Total Devices : 8     Preferred Minor : 0              Update Time : Wed Mar 28 17:19:58 2012               State : clean      Active Devices : 8     Working Devices : 8      Failed Devices : 0       Spare Devices : 0            Checksum : afeeecc7 - correct              Events : 9081618                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     7       8      112        7      active sync   /dev/sdh             0     0       8        0        0      active sync   /dev/sda        1     1       8       16        1      active sync   /dev/sdb        2     2       8       32        2      active sync   /dev/sdc        3     3       8       48        3      active sync   /dev/sdd        4     4       8       64        4      active sync   /dev/sde        5     5       8       80        5      active sync   /dev/sdf        6     6       8       96        6      active sync   /dev/sdg        7     7       8      112        7      active sync   /dev/sdh      What is the issue here? Should I replace `sdf` or is this repairable? **Update** I also had look at `dmesg` and I get this:               [    9.289086] md: kicking non-fresh sdf from array!     [    9.289090] md: unbind<sdf>     [    9.296541] md: export_rdev(sdf)


Backtrack mp3 problem

I've installed Backtrack but I can't figure out how to play mp3files. I've installed ubuntu-restricted-extras,lame, libmp3lame but still won't work(I have Rhythmbox player, I've also tried Amarok). Any ideas?


Apply item replacement inside enumerate in Perl regex?

Data               7. Masi is the same as     \begin{enumerate}     A     B     ABC ha lorem     \end{enumerate}          1. ABC is     \begin{enumerate}     P     B     Lorem maam     \end{enumerate}      which I want to be               7. Masi is the same as     \begin{enumerate}     \item A     \item B     \item ABC ha lorem     \end{enumerate}          1. ABC is     \begin{enumerate}     \item P     \item B     \item Lorem maam     \end{enumerate}      My startup regex is based on this answer > >     perl -000pe >     s/\n/\n\\begin{enumerate}\n [A-Za-z1-9]* \end{enumerate}/ >     ... [problem here!] >     masi.tex >   where   * -000 : activate Perl's paragraph mode, this causes "lines" to be defined by two consecutive newlines (\n\n), so that each of your questions is treated as a single line.   * -pe : read each line of the input file and print it (-p) after applying the script passed as -e. I want to replace the beginning of each new line inside the match with `\item`. My pseudocode for **problem here code** > s/\n/\item /g to apply things inside enumerate environment. How


Why is cd not a program?

I've always wondered why `cd` isn't a program, but never managed to find the answer. Anyone know why this is the case?


where is `cd` located?

In a bash sub shell I get the following error when running cd               sudo: cd: command not found      This is expected because I don't have a path. Usually to work around this I just provide the full path like so: (/usr/local/bin/foo) Much to my surprise, `cd` does not appear to be in any of the normal places.               which cd     whereis cd     ls /bin | grep cd      By comparison, `ls` is right where I would expect.               which ls     /bin/ls      Where is the `cd` command located? And why is different from all the other commands? **Update** Another interesting tidbit, cd does not show up in `hash`               hash     0   /bin/ls     2   /usr/bin/find     2   /sbin/ip     1   /usr/bin/updatedb     1   /usr/bin/apt-get


What happens when we type a simple command on shell?

I have a simple doubt on execution of a simple command. As per my understanding, when we type a command such as `ls` on interactive shell,   1. Shell interpretes the command.   2. Shell creates a child process and excecutes the command on the child process.   3. Shell waits for the child process's completion. If my understanding is correct, a simple command we typed on shell prompt is executed on a child process and the command' result does not affect current shell's enviroment. If so, what about built-in commands like `cd`? If `cd` is executed on a child process and can not affect current shell's enviroment, how the current shell's working directory can be changed?


Allow non-root unmodifiable sofware to bind to ports 80 & 443

The company I'm in uses the Java Secure Application Manager to "secure" non- internal connections their webmail and electronic collaboration software. Aside from using expired certificates, and missing the permissions JAR File Manifest Attributes, the sofware runs fine, except it needs to bind to ports 80 and 443, which means to run it, i need to be running the Icedtea plugin in Firefox running as root. Is there anyway i can let this application access to those ports without needing to run it as root. (For security reasons).


Debian - How to find out if a package is multiarchified? Dependency changes as bug report

I'm using Debian Wheezy 64bit and wine is only existing in a 32bit version. So I added multiarch support. But when I want to install winetricks it's dependencies are `depends on wine | wine-unstable` and not `depends on wine | wine-unstable | wine:i386` So, aptitude suggests to install the dummy 64bit package or to not install winetricks... which doesn't make a lot of sense :) So, I wonder if I have to report a bug because winetricks' dependencies are wrong. For me it seems like that, but I would expect that bug report already to be written. How do I find out if a package has already been multiarchified? Will this issue be solved by only adding the `| wine:i386` in the package informations? Shall I write a bug report in such cases?


Update Linux 10 Mint Julia to 13 Maya

Everytime I try to `apt-get update` it comes up with the following: > Err http://archive.ubuntu.com Precise/main amd64 Packages   >  404 Not Found [IP: 91.189.91.14 80]   >  Err http://archive.ubuntu.com Precise/restricted amd64 Packages   >  404 Not Found [IP: 91.189.91.14 80] What am I doing wrong?


Debian 6: media keys in gnome-settings-daemon don't work

I am running a minimal Debian 6 x86_64 setup with `pulseaudio`, `alsa` and `gnome-settings-daemon`. Whenever I press a media key, `gnome-settings-daemon` spits the following out to `stderr`:               ** (gnome-settings-daemon:4205): CRITICAL **: acme_volume_get_volume: assertion             `acme_volume_open(self)' failed      How can I avoid this issue?


Sorting by one column then the

Say i have a output file with following:               010513  08:04   ROUTER1   192.168.1.1   68.130.5.10  HIT(1)     010513  08:04   ROUTER1   172.168.1.1   28.130.5.10  HIT(1)     010513  08:04   ROUTER1   122.168.1.1   168.130.5.10  HIT(1)     010513  08:04   ROUTER1   192.168.1.1   18.130.5.10  HIT(1)     010513  08:04   ROUTER1   152.168.1.1   58.130.5.10  HIT(1)     010513  08:04   ROUTER1   142.168.1.1   10.130.5.10  HIT(1)      I'm trying to sort with the 4th column followed by 5th and having highlighted colors would work too as my true output file has about 20 columns. Tried using various grep | sort commands and having difficulty getting this to work without running my result file a few times. I dont script so I am sure there is one out there but thought I would ask if there are a combo command/variables I can try.


Removing second colon

Trying to create a simple script that lists mass mailing by the queue number that appears in /var/log/maillog. I'm starting off with this:               [root@ditirdlns01 ~]# lsMails(){ grep -i "$1-bounces@xxx.edu" /var/log/maillog | cut -f1-2,4 -d: ;}     [root@ditirdlns01 ~]#      Which yields:               [root@ditirdlns01 ~]# lsMails systems     Jul  1 15:12: AF649479A     Jul  1 15:14: 024682F59     Jul  1 15:14: 067A447B9     Jul  1 15:14: 0A3EA479A     Jul  1 15:14: 0DCBE5010     Jul  1 15:21: 97DAB2F59     Jul  1 15:24: D1D9B2F59      Which is perfectly alright except I want to get rid of the second colon (which in the log is what separates the minute from second, obviously. I actually don't want the second to be visible to users so cropping it out works for me). I tried piping it through sed looking for a colon preceded by a number with a space afterwards but I get identical results as before:               [root@ditirdlns01 ~]# lsMails(){ grep -i "$1-bounces@xxx.edu" /var/log/maillog | cut -f1-2,4 -d: | sed 's/([0-9]):\s+/ /g';}     [root@ditirdlns01 ~]# lsMails systems     Jul  1 15:12: AF649479A     Jul  1 15:14: 024682F59     Jul  1 15:14: 067A447B9     Jul  1 15:14: 0A3EA479A     Jul  1 15:14: 0DCBE5010     Jul  1 15:21: 97DAB2F59     Jul  1 15:24: D1D9B2F59      My specific question is: Why is `([0-9])` not matching a digit without including it in the result?


/etc/ld.so.conf doesn't contain /usr/lib

I am using `pkg-config` to help supply the correct libs during c++ compilation. As I understand it, it searches in directories supplied by `/etc/ld.so.conf`. My `ld.so.conf` references the following lib locations via an include directive pointing to `/etc/ld.so.conf.d/*.conf`:               /usr/local/lib     /lib/x86_64-linux-gnu     /usr/lib/x86_64-linux-gnu      Problem is the library I need is under `/usr/lib` by default. Can I just add in this path to `/etc/ld.so.conf` myself or move the library or what is the recommended practice?


How can I cat the contents of files found using find into a single file?

I managed to shoot myself where it hurts (really bad) by reformatting a partition that held valuable data. Of course it was not intentional, but it happened. However, I managed to use `testdisk` and `photorec` to recover most of the data. So now I have all that data distributed over almost 25,000 directories. Most of the files are .txt files, while the rest are image files. There are more than 300 .txt files in each directory. I can `grep` or use `find` to extract certain strings from the .txt files and output them to a file. For example, here's a line that I've used to verify that my data is in the recovered files:               find ./recup*/ -name '*.txt' -print | xargs grep -i "searchPattern"      I can output "searchPattern" to a file, but that just gives me that pattern. Here's what I really would like to accomplish: Go through all the files and look for a specific string. If that string is found in a file, cat ALL the contents of that file to an output file. If the pattern is found in more than one file, append the contents of subsequent files to that output file. Note that I just don't want to output the pattern I'm searching for, but ALL the contents of the file in which the patterns is found. I think this is doable, but I just don't know how to grab all the contents of a file after grepping a specific pattern from it.


Forward Only Email Server

I have a custom domain (I'll use the real domains cause I'm desperate at this point :) ) www.grantorino.io, and I want to forward all email addresses sent to yehiasalam@grantorino.io to yehia.asalam@gmail.com. I followed the logical steps but I can't seem to get it right. This is what I did so far:   1. Map the MX record to the grantorino server, ![dig](http://i.stack.imgur.com/PeF5l.png) a dig command shows that the mx have no problems, and that mail.grantorino.io maps correctly to my server.   2. Next step is allowing port 25 on the firewall settings, so it's now open to accept TCP connections from port 25![Webmin Firewall Settings](http://i.stack.imgur.com/Jds1P.png)   3. Make Sendmail forward any mails from yehiasalam@grantorino.io to yehia.asalam@gmail.com. I started with allowing the virtuser feature, an excerpt from sendmail.mc FEATURE('virtusertable', 'hash -o /etc/mail/virtusertable.db')dnl   4. The virtusertable I added yehiasalam@grantorino.io yehia.asalam@gmail.com and compiled using `makemap hasg virtusertable.db < virtusertable`   1. Also in the access file I added  Connect:grantorino.io RELAY and compiled using `makemap hash access < access.db`   1. Finally in the sendmail.c I changed the DEAMON_OPTIONS line to  DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp')dnl Thats pretty much it. I'm not sure whether I should do something more. The problem right now is that I'm not getting any emails forwarded. This is the tail of maillog, after a couple of minutes of sending an email to yehiasalam@grantorino.io. As you can see I'm not getting any activity at all. Please advise.![enter image description here](http://i.stack.imgur.com/gcsVi.png)


Skype does not appear in panel (elementaryOS 0.2)

I had removed skype panel icon with this method : http://askubuntu.com/questions/7479/how-can-i-remove-the-skype-panel-icon-in- ubuntu-12-04-and-earlier/118979#118979 It worked fine, and I was using skype-wrapper to have skype in my messaging menu.. Then skype-wrapper has stopped working and I wanted to have my skype icon back.. I have reinstalled sni-qt (I never removed it but anyway I did reinstall it.) and I have reinstalled skype too (following this link :http://askubuntu.com/questions/68616/i-installed-sni-qt-and-there-is-no- indicator-for-skype-how-do-i-fix-this) but it didn't do anything.. (I will add that I don't need to whitelist it in dconf editor because I'm using elementaryOS Luna 2.0 and doesn't have a whitelist but a blacklist (which I have checked)) What package sould I add or update ? I tried to update QT libraries unsuccessfully.. Cheers! ElementaryOS 2.0 Luna, based on Ubuntu 12.04


Installing Elementary Isis beta

How can I install Elementary OS Isis Beta? I tried to made a bootable stick using the latest iso builds but for some reason I cannot login. Having elementary OS installed on my machine, how can I update every day to the latest build? I want to update to elementary OS Isis and to be up-to-date even it is unstable.


How do I delete a partial package in OpenBSD

While upgrading, I tried to add a package that was already there and due to some error, a partial package got created - partial-gnutls. When I try to delete this partial package, I get these errors:               File /usr/local/share/locale/cs/LC_MESSAGES/pkg.qX9SMkCPZb does not exist                                                                 File /usr/local/share/locale/de/LC_MESSAGES/pkg.Dfpr8PbT3X does not exist                                                                 File /usr/local/share/locale/en@boldquot/LC_MESSAGES/pkg.wIH7fQJbhK does not exist                                                        File /usr/local/share/locale/en@quot/LC_MESSAGES/pkg.c8llMmPSGl does not exist                                                            Read failed: Input/output error at /usr/libdata/perl5/OpenBSD/md5.pm line 59                I checked the source code. It is some coe that adds a file into some data structure (most probably, it is finding out which files to delete) and it fails to do so because the file is no longer there. How do I get rid of this partial package?


What does this syntax mean "${i%.avi}.mp4"

> **Possible Duplicate:**   >  How do ${0##*/} and ${0%/*} work? I have encountered this type of syntax somewhere on the web :               for i in *.avi     do          ffmpeg -i "$i" "${i%.avi}.mp4"     done      how does this `"${i%.avi}.mp4"` and how can I use it ?


Selecting the right GRUB

I've just installed Backtrack on my harddrive (got one), i also got Fedora and Windows 7. However, now i get the Backtrack-GRUB instead of my Fedora GRUB. How do i change that? I got a sda5 containing my Fedora GRUB so it should be easy to 'rewire' - i don't know how tho.


What OS should I install on old Sun Blade 1000 / Sun Blade 2000 workstations, and how should I do it?

I was given some nice old Sun UNIX workstations, Sun Blade 1000 and Sun Blade 2000. These are UltraSparc machines running Solaris 8 (which, with regard to all questions below, is useless because the former owner could not provide me with any passwords). I'd like to get them running again, and because I don't like computers on "static display", would prefer having some typical software on them. So,   1. what OS and application software would you suggest? I'm not too interested in 100% "historical" accuracy, but would like something that lends itself to demonstrating a "typical UNIX workstation". Bonus points if the OS you suggest can still be used to compile some useful modern software from source (like Chromium) without having to create an entire build environment from scratch.   2. How do I even boot these machines from a CD? Searching around some forums gives me the impression that I need a special Sun keyboard in order to press "Stop-A" during boot... can this be done on a regular PC-style keyboard?


Changing the date format of auth.log

I was looking to change the date format in which `auth.log` logs information. I could not find a way to do it. Is there a method to do this? My system uses rsyslog.


Tracking my shell path in Emacs

Not a long time ago, I found the following precious snippet that allows Emacs to track my current directory on any `ansi-term` buffer. More specifically, if I `cd <some/path>` from within a terminal inside Emacs, and I then press `C-x C-f`, Emacs will run `find-file` from `<some/path>` directly, which is very, very handy.               if [ -n "$INSIDE_EMACS" ]; then       chpwd() { print -P "\033AnSiTc %d" }       print -P "\033AnSiTu %n"       print -P "\033AnSiTc %d"     fi      However, the above trick doesn't work if I `ssh` to a remote machine from the shell. Ideally in this case, if I press `C-x C-f` Emacs should recognize that I have sshed to some machine, and use tramp to run `find-file` on the corresponding machine and remote path. This takes me to the following two questions:   1. How and why does the snippet above work?    2. How can I extend it so that it can also track my remote paths after I ssh into another machine?


Linux kernel development for multi core architecture

I am working on a project adapting system software like the Linux kernel. I read one paper titled "Experience on Comparison of Operating Systems Scalability on the Multi-core Architecture" that tells how to detect bottlenecks using benchmarking. I am following their experimental approach and am able to generate a profiling report using the profile tool, but I am not able to detect bottlenecks from this profiling report. Basically, I am not able to explore the no-vmlinux part, and I am not able to find those functions related to bottlenecks. Also I am not able to use `lockstat.txt` as there is no file in `/proc/sys/kernel/lock_stat`.


What is the difference between ./script and . ./script?

> **Possible Duplicate:**   >  Using ‘.’ to execute files in bash I was trying to figure out how to export my environmental via script instead of changing my .bashrc file. I found this old useful post that said: > Variables can only be exported to subordinate processes, you can't pass them > back up to the parent. If you really want your script to affect the parent > shell's environment, run the script as >   >   >     . ./yourprogram >   I just want to know what the difference is between `. ./script` and `./script`? When I look at it, they booth mean to me, run the script from the current directory?


Difference between ". myscript" and "./myscript"

I am confused by "one only dot - space - shell script name" (like `. myshellscript`) and "path to shell script" (like `./myshellscript`) commands. What for they are? I noticed the command `. myshellscript` executes shell script even with -rw-rw-r--. But `./myshellscript` doesn't. So I am confused.


Batch renaming files

I have a directory full of images:               image0001.png     image0002.png     image0003.png     ...      And I would like a one-liner to rename them to (say).               0001.png     0002.png     0003.png     ...      How do I do this?


Batch renaming of files

I have a directory full of images:               DSCN4749.JPG     DSCN4750.JPG     DSCN4892.JPG     ...      And I would like a one-liner to rename them to (say).               dscn4749.jpg     dscn4750.jpg     dscn4892.jpg     ...      How do I do this? Alternatives/extenstions/caveats   * I want to recurse   * The directory contains a mix of file types I only want to rename DSCN*.JPG files.   * bash solution   * perl solution   * zsh solution   * I want a new directory tree with hard links existing files.   * I want to change name more than just a case change eg dscn5555.JPG to 05555.jpg ...


Bash Globbing Variable Substitution?

> **Possible Duplicate:**   >  Batch renaming files I want to rename files using their existing name as a base for the new one. So if I can `ls` these files with               ls blue*+(.png)      I'd want to rename them something like               mv blue$(*)+(.png) $(1).png      except that doesn't work obviously. Is there syntax for these kind of variables in bash globbing or is there an easier way?


Append to the name of each file in directory

How to append “.backup” to the name of each file in your current directory?


batch rename file names including spaces and patterns

I would like to rename a bunch of files which are named in a general form of, `text1 text2 [firstname.lastname] text3 ... textn.ext` I want to remove the text `[firstname.lastname]` from the name of a file. To simplify the task, assume that `[firstname.lastname]` is a fixed first and last name for all the files. I use Ubuntu 12.04, and I tried the following command, `$ find . -name "*.ext" -print | xargs sed -i 's/[firstname.lastname]//g'` but it doesn't work.


How to remove a specific string from file name

I have a report running in UNIX and creating a file named `xxxx_ddmmyy_hhmm_zzzzzz.txt`. I need to remove the `zzzzzz` from the file name. How do I do it?


batch rename a few files

> **Possible Duplicate:**   >  Batch renaming files I have some files that I wish to rename in a single command. The files are names thus. I want the E S Posthumus bit removed from the names and also the 01, 02 ...etc at the start of each file. How do I remove that?


Phusion Passenger not working with Apache while installing redmine

I am trying to install redmine (which is a ruby app ) in my arch system. But I am not able to fire up the app as it gives me the error for phusion passenger. ![enter image description here](http://i.stack.imgur.com/as0Ko.jpg)


Which is the real PATH variable

On my office computer it seems like I've have two PATH variables. > $path : This is delimited by " " (Space) > > $PATH : This is delimited by ":" (Colon) Though when I update one, the other one gets updated as well. Is this the normal behavior in Linux or is there something wierd going on in my machine? Should I keep them both, or delete one of them? **Edit:** I'm using csh, I found this because some of my colleagues were updating the "path" variable, while others did it with "PATH". Though I deleted all occurences of updating "PATH" in my .cshrc, it still appears when I try to echo them.


Redirect SSH user server side

I know that I can create shortcuts for specific users/servers on the client side via `~/.ssh/config` or `/etc/ssh/ssh_config`, but I would like to do something similar but on the server side. That is, when I issue on the client:                ssh pub@name.server.top      I am actually chrooted to               /home/jon/pub      on `name.server.top` where I will use sftp. In `/etc/ssh/sshd_config` I have seen examples as the following:               Subsystem sftp internal-sftp     Match user pub         ChrootDirectory %h         ForceCommand internal-sftp         AllowTcpForwarding no      Will also the following work?                   ChrootDirectory /home/jon/pub      Is it possible to create the `pub` as a sort of virtual user? That is, the remote user logs as `pub` and his public key is in `/home/jon/.ssh/authorized_keys`, so without the hassle of creating a separate `/home/pub/.ssh/authorized_keys` or the `/home/pub` directory at all.


Find files in multiple directories taken from list in a file?

FreeBSD 9.2 RELEASE p2      I have a file `dirs.txt`. In this file is a new line separated directory list like so:               /etc     /home     /home/goods/      I need to first find in all directory's files which have names like "good" or contain string "(NODES_'TASK')" and then copy all these files into the directory `/tmp`. I think must be something like:               $ find $fromDirs.txt -type f -name 'good' | \         grep -lr '\(NODES_\'TASK\'\)' $fromDirs.txt | > /tmp


How can I wrap text at a certain column size?

I know that I can use something like `cat test.txt | pr -w 80` to wrap lines to 80 characters wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems What's the best way to force a text file with long lines to be wrapped at a certain width? Bonus points if you can keep it from breaking words.


How can I use variables when doing a sed?

I want to do:               cat update_via_sed.sh | sed 's/old_name/new_name/' > new_update_via_sed.sh      in my program. But I want to use variables, e.g.               old_run='old_name_952'     new_run='old_name_953'      I have tried using them but the substitution doesn't happen (no error). I have tried:               cat update_via_sed.sh | sed 's/old_run/new_run/'     cat update_via_sed.sh | sed 's/$old_run/$new_run/'     cat update_via_sed.sh | sed 's/${old_run}/${new_run}/'


How to make sense of an iptables chain configuration

This is about how to make sense of the _chains_ found in the `iptables` default configuration on a typical home router running OpenWrt (a stripped down Linux for router devices), but which ultimately may not be specific to that particular system. Let's focus on the `INPUT` main chain here, and disregard `FORWARD` and `OUTPUT` from the same _table_, as well as `PREROUTING` and `POSTROUTING` from the `nat` table. Doing an `iptables -L -t filter` shows a large number of rules. I have rearranged the output below to make it less intimidating, and in an attempt to pinpoint the parts that hamper my understanding. There are three built-in chains in the `filter` table, which appear at the top of the output. (I specified `-v` because I find it less confusing.)               Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination      1260  133K ACCEPT     all  --  any    any     anywhere             anywhere            ctstate RELATED,ESTABLISHED         8   544 ACCEPT     all  --  lo     any     anywhere             anywhere       787 41632 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN     13012 1249K input_rule  all  --  any    any     anywhere             anywhere     13012 1249K input      all  --  any    any     anywhere             anywhere          Chain FORWARD … # not considering this chain here     Chain OUTPUT …  # not considering either      As you can see, I snipped the chains referenced from `FORWARD` and `OUTPUT` in order to focus on `INPUT`. (I could have chosen any of the other two as they are built up in a similiar manner.) `INPUT` has a policy of `ACCEPT`, and it specifies five rules. The first three ones are clear to me. First, accept stuff that is "established" or "related". (For example, accept the response from an HTTP or DNS request I made.) Seconds, accept everything going to the loopback device (`127.0.0.1`). (This may only come from localhost itself, and I do want that to work. Wouldn't make sense otherwise.) Third, have a synflood protection. (Which protects against a certain kind of attack.)               Chain syn_flood (1 references)      pkts bytes target     prot opt in     out     source               destination       787 41632 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50         0     0 DROP       all  --  any    any     anywhere             anywhere      But then, there are two rules branching into two chains called `input` and `input_rule`, and the question is, why are there two of them, and which one are you supposed to use for what? Let's drill down the jump stack of those rules.               Chain input_rule (1 references)      pkts bytes target     prot opt in     out     source               destination      There's nothing in here yet. It is meant for me to add rules. But what kind of rules?               Chain input (1 references)      pkts bytes target     prot opt in     out     source               destination      6315  482K zone_lan   all  --  br-lan any     anywhere             anywhere      6697  767K zone_wan   all  --  pppoe-wan any     anywhere             anywhere      Okay, this one does have stuff, jumping further down into LAN and WAN, which makes sense for a home router.               Chain zone_lan (1 references)      pkts bytes target     prot opt in     out     source               destination      6315  482K input_lan  all  --  any    any     anywhere             anywhere      6315  482K zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere          Chain zone_wan (1 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc         0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request      6697  767K input_wan  all  --  any    any     anywhere             anywhere      6697  767K zone_wan_REJECT  all  --  any    any     anywhere             anywhere      As you can see, each one of those rules jumps further down the stack to more user-defined rules.               Chain input_lan (1 references)      pkts bytes target     prot opt in     out     source               destination          Chain zone_lan_ACCEPT (2 references)      pkts bytes target     prot opt in     out     source               destination         4  1322 ACCEPT     all  --  any    br-lan  anywhere             anywhere      6315  482K ACCEPT     all  --  br-lan any     anywhere             anywhere      What is the purpose of `input_lan`? The other one is probably to accept packets, but it makes me wonder … the policy for `INPUT` is `ACCEPT`, so why repeat `ACCEPT` here? Now, input from WAN. If you scroll up you can see that some UDP and ICMP stuff is accepted. This is for DHCP and, basically, `ping`. That much is clear. What is less clear, again, is the partially empty stuff following those rules:               Chain input_wan (1 references)      pkts bytes target     prot opt in     out     source               destination      Same question as for `input_lan`.               Chain zone_wan_REJECT (2 references)      pkts bytes target     prot opt in     out     source               destination         0     0 reject     all  --  any    pppoe-wan  anywhere             anywhere      6697  767K reject     all  --  pppoe-wan any     anywhere             anywhere      Okay, that is input from WAN (not established or related), and yes, we probably want to reject it, and now there are two kinds of rejection here, one closing the socket (`tcp-reset`) for TCP connection attempts, and another one via ICMP reply (`icmp-port-unreachable`) for ICMP messages (think `ping`).               Chain reject (5 references)      pkts bytes target     prot opt in     out     source               destination       595 31817 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset      4858  582K REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable      This last one is a catch-all. So nothing will get accepted here. Finally, here's a list of other chains found in the `filter` table that aren't referenced from the built-in `INPUT` chain in the `net` table. Just for completeness, and to see that they seem to have analogous constructs.               # other chains, not reached from the INPUT chain, so truncated and moved here     Chain forward (1 references)     Chain forwarding_lan (1 references)     Chain forwarding_rule (1 references)     Chain forwarding_wan (1 references)     Chain nat_reflection_fwd (1 references)     Chain output (1 references)     Chain output_rule (1 references)     Chain reject (5 references)     Chain zone_lan_DROP (0 references)     Chain zone_lan_REJECT (1 references)     Chain zone_lan_forward (1 references)     Chain zone_wan_ACCEPT (2 references)     Chain zone_wan_DROP (0 references)     Chain zone_wan_forward (1 references)      So, well. Sorry for this long post. There were a couple questions along the way. I don't know how to put this in an easier or shorter way. This `iptables` configuration is not exactly easy to grasp because there are unclear details spread about here and there. Hope you can clarify this and explain the underlying rationale. Thanks for your attention.


How do I add a screenshot for my package?

I created a repository with `reprepro` and it is working fine, but I would like to add the "images" to the packages when they are displayed with some package manager such as synaptic. At first, i was having problems with change-logs too, but when asking for a change-log the following message is displayed `URI was: http://foo/pool/main/7/7zrecover/7zrecover_2.6_all.changelog` So I understood that I needed to create that URL in order to call the change- log. I did it and it worked. I wanted to use the same method to call the image of the package, but when the error is displayed the URL is not shown so I don't have any idea of what URL is being requested. I've also been doing Internet researches but I just get dumb stuff or packages! Open synaptic and select any package. Then you will see that in the package description there are two buttons "Get Screenshoot" and "Get Changelog". I would like to make work the "Get Screenshoot" button of my packages.


Difference between POSIX, Single UNIX Specification, and Open Group Base Specifications?

What are the differences between POSIX, the Single UNIX Specification, and the Open Group Base Specifications? I think their purpose is for determining if an OS is Unix?


Who's got the other end of this unix socketpair?

**I want to determine what process has the other end of a unix socket, that was created with`socketpair()`.** I have a program `parent` which creates a `socketpair(AF_UNIX, SOCK_STREAM, 0, fds)`, and `fork()`s. The parent process closes `fds[1]` and keeps `fds[0]` to communicate. The child does the opposite, `close(fds[0]); s=fds[1]`. Then the child `exec()`s another program, `child1`. The two can communicate back and forth via this socketpair. Now, let's say I know who `parent` is, but I want to figure out who `child1` is. How do I do this? There are several tools at my disposal, but none can tell me which process is on the other end of the socket. ### lsof `lsof -c progname` lists the open files for all processes named `progname`. When I execute `lsof -c parent -c child1` I see the following (unrelated entries removed):               jonathon@jrr-suse113:/proc/net> lsof -c server -c child     COMMAND   PID     USER   FD   TYPE     DEVICE SIZE/OFF   NODE NAME     server  12923 jonathon    0u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    1u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    2u   CHR      136,3      0t0      6 /dev/pts/3     server  12923 jonathon    3u  unix 0xf67b8440      0t0  32721 socket     child   12924 jonathon    0u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    1u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    2u   CHR      136,3      0t0      6 /dev/pts/3     child   12924 jonathon    3u  unix 0xf42ff4c0      0t0  32722 socket      So I see the file descriptors for stdin/out/err, as well as my socket (which has been `dup2`'d to #3 for the child as well). Additionally, we see the socket device numbers in hex, and node (inode). Yet there is nothing that tells me these two are connected (which they definitely are.) ### /proc/xxx/fd This simply shows me the open file descriptors and what they point to. No surprises here.               jonathon@jrr-suse113:/> ls -l /proc/`pidof server`/fd     total 0     lrwx------ 1 jonathon users 64 2011-07-08 17:58 0 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 1 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 2 -> /dev/pts/3     lrwx------ 1 jonathon users 64 2011-07-08 17:58 3 -> socket:[32721]      ### /proc/net/unix This also doesn't show me anything that `lsof` doesn't (probably because these are where it gets its information.)               Num       RefCount Protocol Flags    Type St Inode Path     f42ff4c0: 00000003 00000000 00000000 0001 03 32722     f67b8440: 00000003 00000000 00000000 0001 03 32721      So basically, I can see the two sockets, and everything about them, but cannot tell that they are connected. Before you ask why I want to see this, consider the case where there are 40 different children processes running. I am trying to then determine which FD in the parent is communicating with which child process.


fwui.log error while running this script

I run this bash script in order to put all the files with the following format dated today in the same folder. for example here I want `2012-12-17_083213` to be my folder and then inside it I have the `.log` and `.log_stats` and etc with this name inside it? But I am not able to get the script working. For example, if I try everything up until `dir=$(echo $i | awk '{split($1,a,"_"); print a[1]}');`   And then to test it, I did echo $dir, and that displays the following:   `fwui.log`   I searched and understood its about locks in the db but how to solve it? This is the script:               #!/bin/bash       tosend=""       for i in *.log; do              dir=$(echo $i | awk '{split($1,a,"_"); print a[1]}');           if [ ! -d $dir ]; then               mkdir $dir;           fi;           cp $i $dir;           tosend="$tosend\n$dir"       done       for i in $(echo -e $tosend | uniq);do           echo Compressing $i           tar -zcvf $i.tar.gz $i           scp $i.tar.gz user@server       done        and this is the file formats:               2012-12-17_083213_1.log       2012-12-17_083213_1.log_stats       2012-12-17_083213_1.logaccount_ptr         2012-12-17_083213_1.loginitial_ptr       2012-12-17_083213_1.logptr       2012-12-17_093049_2.log       2012-12-17_093049_2.log_stats       2012-12-17_093049_2.logaccount_ptr       2012-12-17_093049_2.loginitial_ptr       2012-12-17_093049_2.logptr


How to define similar bash function at once

I have these functions in `~/.bashrc`:               function guard() {         if [ -e 'Gemfile' ]; then         bundle exec guard "$@"         else         command guard "$@"         fi     }     function rspec() {         if [ -e 'Gemfile' ]; then         bundle exec rspec "$@"         else         command rspec "$@"         fi     }     function rake() {         if [ -e 'Gemfile' ]; then             bundle exec rake "$@"         else             command rake "$@"         fi     }      As you see these functions are very similar. I want to define these 3 functions at once. Is there a way to make it? _environment_               bash --version     GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)


How install xfce >= 4.10 from backports repository in debian

I am working in Debian 7 64bits with xfce 4.8 ![enter image description here](http://i.stack.imgur.com/bhaxG.jpg) But in backports repository I found xfce 4.10.1 ![enter image description here](http://i.stack.imgur.com/fgb4F.jpg) and I added this line in my sources.list:               deb http://ftp.debian.org/debian/ wheezy-backports main contrib non-free      but when I upgrade I do not see that can be updated. ![enter image description here](http://i.stack.imgur.com/NDPDH.jpg) Then, how I can upgrade xfce 4.8 to 4.10 cleanly with backports? without tricks like adding repo of debian 8 testing or others. Greetings.


Startx failing in FreeBSD

I've install gnome2, xorg, and xinit (should xorg have done that for me?), and startx yields: "xinit: unable to run server "/usr/local/bin/X": No such file or directory" I checked in the directory, and startx, xpath, and xinit are all there Am I still missing dependencies? If so, which ones? Both the gnome2 and x11 installations took a lifetime and a half so I thought they got everything...


Not able to install GRUB (grub legacy) on flash drive!

I'm following this tutorial of Dedoimedo to install GRUB on USB flash drive. Though this tutorial doesn't talk of installing in pen drive but I though it can be used here even.                      [ Minimal BASH-like line editing is supported.   For              the   first   word,  TAB  lists  possible  command              completions.  Anywhere else TAB lists the possible              completions of a device/filename. ]          grub> find /grub/stage1      (hd0,4)          grub> root (hd0,4)          grub> setup (hd1)      Checking if "/boot/grub/stage1" exists... no      Checking if "/grub/stage1" exists... yes      Checking if "/grub/stage2" exists... yes      Checking if "/grub/e2fs_stage1_5" exists... yes      Running "embed /grub/e2fs_stage1_5 (hd1)"...  21 sectors are embedded.     succeeded      Running "install /grub/stage1 d (hd1) (hd1)1+21 p (hd0,4)/grub/stage2 /grub/me     nu.lst"... succeeded     Done.          grub>       Still I don't see anything in the flash drive. Also when I rebooted my laptop setting USB flash drive to boot, it didn't boot from my USB. Please throw some light on this. [I have seen sites (pendrivelinux.com) http://www.pendrivelinux.com/install- grub2-on-usb-from-ubuntu-linux/ where it talks on installing on USB but I want to know why my method isn't working]


Emacs sync w/ Google Calendar and Contacts?

Is there a way to use Emacs to sync with Google Calendar and Google Contacts, ideally keeping a local copy so I can access them offline?


How to understand what's taking up space?

I'm looking for a linux alternative to WinDirStat. I would like to know what is taking up space on my hard drives. A program that works on console and doesn't require a UI is preferred .


Init script partially launches java app

I have a java application that I manage to execute by hand. The application normally opens several ports for local communications (7180 => 7183). Port 7182 serves as a web console and allows me to quickly check that everything went fine.               java -cp $ARCHIVES -Djava.security.policy=$POLICY -Dconfigfile=$CONFIG_FILE $CLASS      As soon as I put this in an init script, the ports are not open but the app somehow manages to start with the following message: 'Dead or echo port not responding'. Here is the start-stop-daemon line in my init script:               start-stop-daemon --start --chuid thomas --quiet --make-pidfile --pidfile $PIDFILE --exec $DAEMON -- \         $DAEMON_ARGS \      What difference between manual execution and scripted execution could explain that the app is half started? * * * As an additionnal information, the application is SIPS Office Server (payment solution).


How can I see moved lines in a file comparison with vimdiff / diff?

Moved lines are frequently annotated as deletes and adds but they can be shown as moved-from and moved-to instead. Like in this screenshot of Notepad++. ![Notepad++ diff'ing moved lines](http://i.stack.imgur.com/jF26O.png)


How can I get distribution name and version number in a simple shell script?

I'm working on a simple bash script that should be able to run on Ubuntu and CentOS distributions (support for Debian and Fedora/RHEL would be a plus) and I need to know the name and version of the distribution the script is running (in order to trigger specific actions, for instance the creation of repositories). So far what I've got is this:               OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]')     ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/')     VERSION=$(awk '/DISTRIB_RELEASE=/' /etc/*-release | sed 's/DISTRIB_RELEASE=//' | sed 's/[.]0/./')          if [ -z "$OS" ]; then         OS=$(awk '{print $1}' /etc/*-release | tr '[:upper:]' '[:lower:]')     fi          if [ -z "$VERSION" ]; then         VERSION=$(awk '{print $3}' /etc/*-release)     fi          echo $OS     echo $ARCH     echo $VERSION      This _seems_ to work, returning `ubuntu` or `centos` (I haven't tried others) as the release name however, I have a feeling that there must be an easier, more reliable way of finding this out... No? It doesn't work for RedHat. /etc/redhat-release contains : Redhat Linux Entreprise release 5.5 So, the version is not the third word, you'd better use :               OS_MAJOR_VERSION=`sed -rn 's/.*([0-9])\.[0-9].*/\1/p' /etc/redhat-release`     OS_MINOR_VERSION=`sed -rn 's/.*[0-9].([0-9]).*/\1/p' /etc/redhat-release`     echo "RedHat/CentOS $OS_MAJOR_VERSION.$OS_MINOR_VERSION"


find action not working for specific search

I'm trying to use the `find` command to list the size of a certain set of files but am getting no output. The command I use is:               find POD -type f -name *.mp3 -or -name *.ogg -ls      Which produces no output. While:               find POD -type f -name *.mp3 -or -name *.ogg      does produce output, I've also tried the actions:               -printf "%p %k KB\n"     -exec ls -ls '{}' \;     -print0      but all of these give no output. When I use any of these actions with a different expression e.g.:               find . -maxdepth 1 -type f -printf "%p %k KB\n"      I also get the expected output. Does anybody have any idea what the problem is? I'm running:               Linux irimi 3.10.37-1-MANJARO #1 SMP Mon Apr 14 20:56:29 UTC 2014 x86_64 GNU/Linux      aka an up to date Manjaro linux distribution. The shell I use is: `/bin/bash` version `4.3.8(1)-release`. The content of my `SHELLOPTS` environment variable is:               braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor      my `BASHOPTS` environment variable is:               cdspell:checkwinsize:cmdhist:complete_fullquote:dotglob:expand_aliases:extglob:extquote:force_fignore:histappend:hostcomplete:interactive_comments:nocaseglob:progcomp:promptvars:sourcepath      Again any help on trying to debug this would be very much appreciated.


What do the flags in /proc/cpuinfo mean?

How can I tell whether my processor has a particular feature? (64-bit instruction set, hardware-assisted virtualization, cryptographic accelerators, etc.) I know that the file `/proc/cpuinfo` contains this information, in the `flags` line, but what do all these cryptic abbreviations mean? For example, given the following extract from `/proc/cpuinfo`, do I have a 64-bit CPU? Do I have hardware virtualization?               model name      : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz     …     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority


256 color in real console

I have in my .bashrc               export TERM=xterm-256color      but this cause blinking all colored text (ls --color, in vim etc.) in real console (CTRL + ALT + F1) . So is there any possibility to recognize in which console I am (real or virtual) so I can export TERM variable with valid value? [EDIT] I found alternative solution only: for vim user (in .vimrc)               set t_Co=256      or for xterm in .Xdefaults (after that xrdb -load .Xdefaults)               XTerm*termName:         xterm-256color      or for screen (.screenrc)               term screen-256color


How to force Thunar to remember sort order for different folders?

I want all the files in my Downloads folder to be sorted by modification date, but all other folders, and files in other partitions to be sorted by name. How can I make Thunar to remember the sort order for different folders?


How to install parted?

root@host [/]# parted     -bash: parted: command not found      I am using CentOS. Looks like I simply have to yum it first or something. How would I do so?


Centos 6.3 on Oracle VirtualBox 4.3.6 GUI flickering after startup

My CentOS 6.3 installation in Oracle Virtual Box 4.3.6 was working fine until this morning when the UI would not startup properly and started flickering. ![image 1](http://s30.postimg.org/9f3z18jup/Cent_OS63.png) In the UI there is a white box (3x2 size) that flickers (was not able to capture it) continuously. I am able to login to the system using ssh using IP from another machine and I see all files are intact... not sure why the UI is not materializing properly. I even changed display memory in VirtualBox settings to 128MB but to no avail. Please help me to resolve this. I dont want to re-install the Centos again (setting up system again is quite a step). The below is the VirtualBox's log:               00:01:01.045427 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0723) created successfully     00:01:01.079417 Changing the VM state from 'RESUMING' to 'RUNNING'.     00:01:02.559869 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes     00:01:03.828410 Changing the VM state from 'RUNNING' to 'SUSPENDING'.     00:01:03.857120 PDMR3Suspend: after    28 ms, 1 loops: 1 async tasks - ahci/0     00:01:03.888235 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0781) created successfully     00:01:03.979697 PDMR3Suspend: 151 237 774 ns run time     00:01:03.979715 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.     00:01:05.724688 Changing the VM state from 'SUSPENDED' to 'RESUMING'.     00:01:05.725398 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0723) created successfully     00:01:05.760108 Changing the VM state from 'RESUMING' to 'RUNNING'.     00:01:09.391589 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes     00:01:40.621357 Changing the VM state from 'RUNNING' to 'SUSPENDING'.     00:01:40.623377 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0781) created successfully     00:01:40.664968 PDMR3Suspend: 43 513 184 ns run time     00:01:40.664986 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.     00:01:43.567279 Changing the VM state from 'SUSPENDED' to 'RESUMING'.     00:01:43.567908 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0723) created successfully     00:01:43.601704 Changing the VM state from 'RESUMING' to 'RUNNING'.     00:01:44.142130 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes      .. more...               00:46:49.034055 AIOMgr: Endpoint for file 'E:\VirtualBox\VDI\CentOS63.vdi' (flags 000c0723) created successfully     00:46:49.067998 Changing the VM state from 'RESUMING' to 'RUNNING'.     00:46:49.354161 AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes     00:48:27.339663 Guest Additions capability report: (0x4 -> 0x0) seamless: no, hostWindowMapping: no, graphics: no     00:48:27.348469 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=0000000000000000 w=720 h=400 bpp=0 cbLine=0x0, flags=0x1     00:48:41.643962 OHCI: USB Reset     00:48:41.774693 Entering S5 power state (power down)     00:48:41.774768 Changing the VM state from 'RUNNING' to 'POWERING_OFF'.


Reusing a variable

I was breaking my head for a day still not successful. I have this script:               #!/bin/ksh          fname=$1          for batchname in $(grep -i "Processing batch" $fname | cut -d "'" -f2)     do     Batch_state=`grep -c -i "Batch '$batchname' was successful" $fname`     if [[ "$Batch_state"  -ge 1 ]];then     {     S_Time=`awk '/[0-9]_[0-9].*successful/{getline;getline;getline;print}' $fname | awk '{print $2}'`     E_Time=`awk '/[0-9]_[0-9].*successful/{getline;getline;getline;getline;print}' $fname | awk '{print $2}'`     echo -e $batchname"\t"$S_Time"\t"$E_Time     }     else     {     echo $batchname encountered an error     }     fi     done      Output this code is producing:               02_1231324      14:29:04 15:29:11   14:32:19 15:33:11     79_3097935      14:29:04 15:29:11   14:32:19 15:33:11      Desired Output:               02_1231324      14:29:04    14:32:19     79_3097935      15:29:11    15:33:11       Sample Input:               2013/06/11 14:29:04 <0999> (725102)     Creating batch '02_1231324.0'...     2013/06/11 14:29:04 <0999> (725102)     Batch '02_1231324' was successful     2013/06/11 14:29:04 <0999> (725102)     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 14:29:04 <0999> (725102)  Processing batch '02_1231324'     2013/06/11 14:32:19 <0999> (725102)     Total in batch: 160 documents using 4 KBytes     2013/06/11 15:29:11 <0999> (725102)     Creating batch '79_3097935.0'...     2013/06/11 15:29:11 <0999> (725102)     Batch '79_3097935' was successful     2013/06/11 15:29:11 <0999> (725102)     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 15:29:11 <0999> (725102)  Processing batch '79_3097935'     2013/06/11 15:33:11 <0999> (725102)     Total in batch: 160 documents using 4 KBytes     TMR:Child ZERO, 160 Docs 320 Pgs 3874 KByts Tot 0.42 WAL 0.10 WALIO 0.15 IO 0.03 secs     2013/06/11 13:26:57 <0999> (725102)  Processing batch '12_2013162201'     2013/06/11 13:26:57 <0999> (725102)     Total in batch: 160 documents using 4 KBytes      So, what is wrong with my script? How can I get the desired output?


\uFFFD character in directory name

I have a lot of directories with a \uFFFD (65533) character in it. The problem is that I can't really access this directory because of this character. For example I got a directory with the name: `Foo�o` (� == `\uFFFD`)   1. `ls Foo�o` is not working (so `tab` is always showing the only possible file but it will never complete it 'cause it's not working)   2. `ls Foo*` is working The problem is that I can't use the 2. way because there might be other directories starting with the same characters. So the actual question is if there's a way to escape a character like this. So I'm searching for a working version of this: `ls Foo\uFFFDo` <= not working


Space left on Linux RAM/TMP,FS

Recently I have come to believe a number of unusual occurrences that have happened while running a Parted Magic Live CD, are the result of running out of space on the RAM based filesystem, namely:   * Folder contents disappearing, only to reappear later   * `Mount-gtk` not showing single mounted drive/not allowing unmount (While bash `mount` commands function normally)   * Firefox freezing, then seemingly freezing the GUI.   * My Firefox session recovering as if the browser crashes at each clean close   * Loosing last x minutes of Firefox session history   * Sound/clipboard redirection intermittently not working in `rdesktop`   * `Conky` crashing periodically ...Not despite the SpaceFM warning of no space to store state data **AND** some of these problems disappearing only after moving some files off the filesystem. Problem being, I am not sure how to (at least) keep an eye on the "space" left of the filesystem (Note: There is no entry for the `/` partition in the output of `df`, `fdisk -l` or `mount`), let alone (assuming I am right that the filesystem space not being relative to the system memory, that I had been monitoring with `conky`) how to go about increasing the sizing ?at boot time? Help? P.S Thought it most appropriate to tag this question with parted-magic, ramfs (or tmpfs... Not sure how to identify which one is in use) and low-disk-space like tags, but alas there doesn't appear to be any of them. If the community doesn't want to create one/all, please feel free to suggest other tags that others feel are appropriate.


Automatically printing images with added captions

I have a lot of scanned images and images/photos I'm working on with multiple versions. When I print them (using various programs), all I get is the image and, often, it's difficult to tell which image came from which file. This is particularly frustrating with my (27K) photos when I have a print and want another copy and can't find it. (The photos are in KPhotoAlbum, so I can find the minority that I have actually tagged correctly.) What I would like is a utility that would print a bunch of images (e.g. doit *.jpg) and include an automatic (program generated) caption (hopefully configurable) with something like the full path of the file in it. gnome- photo-printer would be perfect if it had an option to print the full paths of the images with them. I need this while projects are in progress and for cleaning up afterwards. This is not for "final" images. It would be cool (and economical) if I could also specify the print size of the image because, often, smaller "thumbnail" images may be enough for organizing/cleaning up and they would save a bunch of time, paper, and ink/toner. I know I could manually create a document with an embedded picture in something like LO writer, but that would be totally manual (at least with my level of expertise) and thus very slow. It would be particularly nice to have the caption "outside" the picture so it would not interfere with the content and so I could control the background and font colors for readability. * * * I figured out (in principle) how to build something like this in bash using convert a couple of times along with composite (both from ImageMagick), but it's fairly convoluted and I'm hoping for something simpler.


Problems installing Arch Linux: cannot mount the installation media

> **Possible Duplicate:**   >  mounting problem during installation of archlinux on dell xps one I am trying to install Arch Linux on my Acer Aspire 4830tg, but I keep running into problems. I am trying to install Arch off a USB stick and I got the iso image using Bittorrent. I am also trying to install it alongside of Windows 8 (which is already installed). When I boot into Arch linux I get this error               :: Mounting '/dev/disk/by-label/ARCH_201212' to 'run/archiso/bootmnt'     Waiting 30 seconds for device /dev/disk/by-label/ARCH_201212 ...     ERROR: '/dev/disk/by-label/ARCH_201212' device did not show up after 30 seconds...     Falling back to interactive prompt     You can try to fix the problem manually, log out when you are finished     sh: can't access tty; job control turned off      So I know that it will work if I run it on a virtual machine but whenever I try to install it on my laptop I keep getting this error.


Why can't a normal user `chown` a file?

Why is the `chown` command root-only? Why can't non-root users use chown to give away files they own?


file owner not able to renounce the ownership to root? But root can!

I logged in as username 'ravbholua' I created a file `bb` as below:               ravbholua@ravi:~/Pictures$ echo>bb     ravbholua@ravi:~/Pictures$ ll     total 12     drwxr-xr-x  2 ravbholua sudo 4096 Oct 13 11:18 ./     drwxr-xr-x 23 root      sudo 4096 Oct 13 11:03 ../     -rw-r--r--  1 ravbholua sudo    1 Oct 13 11:18 bb     ravbholua@ravi:~/Pictures$      Please note the owner of `bb` is me (ravbholua). But I am not able to renounce the ownership to root.               ravbholua@ravi:~/Pictures$ chown root bb     chown: changing ownership of 'bb': Operation not permitted     ravbholua@ravi:~/Pictures$       But root can change the ownership of my file.               ravbholua@ravi:~/Pictures$ ll     total 12     drwxr-xr-x  2 ravbholua sudo 4096 Oct 13 11:18 ./     drwxr-xr-x 23 root      sudo 4096 Oct 13 11:03 ../     -rw-r--r--  1 root      sudo    1 Oct 13 11:18 bb     ravbholua@ravi:~/Pictures$      I am working on Ubuntu13.04 Earlier when I had worked on Fedora9, there the file owner was able to change the ownership. I think linux Operating System allows the file owner to do so.


can not chown a file from my $user to another $user

I am on slackware64 v14.0 and I have file that belongs to me:               -rwxrwxr-x+   1 nass  shares    137934 Mar  7 00:06 myfile.csv*      I am a member of the "shares" group. The folder that contains `myfile` looks like this               drwxrwsr-x+  12 nass shares 4096 Mar 12 04:54 winmx/      I now want to give ownership of this file to another user of this pc. The other user is also a member of the shares group. However,               chown otheruser myfile.csv         does not do the trick. I get a               chown: changing ownership of 'myfile.csv': Operation not permitted      I had recently asked a similar question about `gid`, but this is not the same problem. How can I solve this ?


Find all folders in a directory with the same content

In Ubuntu, is there any to find duplicate folders in a directory (i. e., folders with the same content)? I think there are already some command-line tools available for finding duplicate files (such as fdupes), but I want to find duplicate folders instead. That is, find folders which match in terms of the contents of the files they contain (though the filenames and other metadata might differ).


Find a file in the path without "which"?

I am (somehow) able to run a script:               $ assemble.sh file     ... [output]      But `which` can't find it:               $ which assemble.sh     which: no assemble.sh in (/s/std/bin:/usr/afsws/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/bin:/usr/bin:/usr/stat/bin:/usr/X11R6/bin:.        1. How is this possible?   2. How can I find where this file is? I'm using bash.


Reconfiguring GNOME keyring daemon

I have a really strange problem when using GNOME keyring daemon. I had an old SSH key which I've now retired and started using a new, stronger keyfile. However, every time I attempt to SSH into one of my servers, SSH tells me               Agent admitted failure to sign using the key.     Permission denied (publickey).     fatal: The remote end hung up unexpectedly      I'm pretty sure that the keyring daemon is trying to use my old key for some strange reason. How can I reconfigure the keyring daemon to delete any knowledge of my old key?


Emulating a file

I have certain application that opens a file with given path (presumably with `fopen` or derivative), reads the file, possibly writes to it and closes it. I have no control over this application other than specifying the path. What I am trying to do is 'emulate' a file within the local filesystem to pass it to the application. That is, I want the file to appear as an ordinary file in the filesystem, however the streams are redirected to another application that handles them correctly and outputs appropriate data. Essentially, I want to create a pseudo-device, except that it is not a device at all. Is this doable at all? How would I approach this problem?


Monitor all login attempts

Few weeks ago I thought it would be a good idea to write a script to send me an email whenever some user logs in into my server. So I came with a perfectly working script `notifyLogin.sh`, then I decided to call it from each user's `.bash_login` script. But I discovered that someone could log in in my server using `ssh` `-t` switch to select an available shell. For example:               ssh user@myserver -t sh      This way, `.bash_login` does not execute, neither does `/etc/profile`. Is there any way to call `notifyLogin.sh` independent of shell type at log in? (It should always work)


IP of localhost

How does a Linux instance determine its IP address? That is, not the 127.0.0.1. Is this stored in file or does ifconfig somehow calculate it at every invocation? I managed to solve it just to show I made an effort, but it is not anything I'd put in a serious application:               sudo ifconfig | head -n 2 | tail -n 1 | tr -s " " | tr " " ":" | cut -d":" -f 4


Closing lid on Crunchbang

I'm running Crunchbang on a laptop. I can't seem to find an option to toggle if the laptop goes to sleep when the lid closes. There are certain times where I want to put the laptop away or close it but still have it do some crunching on some long running task. Is there a place to toggle this option?


Moving folders used wrong syntax and lost them

I thought I was being smart trying to move a folder to one level up by going:               mv folder .newfolder and neglecting to even put:               mv folder .newfolder/folder and anyway it didn't put up an error but the folders have vanished. Where could they be I wonder?


Arch Linux makepkg failed on compressing package

I just reinstalled Arch Linux 2010.05 on VPS, and               sudo pacman -Syu       But when I try to install anything from AUR, makepkg failed on               ==> Tidying install...       -> Purging unwanted files...       -> Compressing man and info pages...       -> Stripping unneeded symbols from binaries and libraries...     ==> Creating package...       -> Generating .PKGINFO file...       -> Compressing package...     bsdtar: FIEMAP failed: Invalid argument     bsdtar: FIEMAP failed: Invalid argument     bsdtar: FIEMAP failed: Invalid argument     ==> Leaving fakeroot environment.


Why FOSS 3d performs so badly, compared to proprietary. Trying to understand

I know this is not the best question, I'm just trying to understand what needs improvement. I just read a Phoronix article, which compared the FOSS radeon drivers a 5 years old FGLRX catalyst. As you would expect FGLRX was multiple times faster, even the feature set was not completely implemented. The big question, not answered in the article, was why? I noticed FGLRX brings its own libGL, does Nvidia do this also? I know hardware registers are not always completely known, and yadda yadda... I still suspect that mesa is not a strong performer. What needs to be done to reach remotely close to catalyst speed? What projects need help? Which ones need to be completely ditched?


Trying to run oprofile on ubuntu kernel but cannot find vmlinux file

I am trying to run oprofile on my ubuntu host but cannot find the vmlinux file. The set up sfor oprofile needs this file: As given here : http://oprofile.sourceforge.net/doc/overview.html#getting- started               opcontrol --vmlinux=/boot/vmlinux-`uname -r`      What should I do so that I can profile the ubuntu kernel. I am using 2.6.32-34-generic-pae (uname -r)


`cp` permission denied when copy a file owned by `root`

I have a folder `udp_folder2`               d------r-T 41 root           root     4096 Apr 26 21:17 udp_folder2      when I'm with user other than `root`, I can't `cp -r` it into a new folder it says: Permission denied why? and how can I copy it with a user other than `root`


How to find Nautilus wastebasket in the file system

It looks like I can get to the waste-basket through nautilus, but when I look at the location given by properties, I see "trash:///". But I can't "cd trash:///". Where is the waste-basket? And in general, if I can find a file in nautilus, how do I get there from terminal? I've had some similar issues in the past with mounted media as well, so a general answer would be greatly appreciated. In case it is relevant, I'm using PinguyOS.


What are alternative tools for searching files in full content?

I realized that most of the text related tools I use, grep/egrep/awk/sed are line-oriented.   I guess that is a simplified approach to search in files but I was wondering if there is another set of tools operating on file level that I am not aware. So are there other tools that search over the full contents of a file without using the line mode?


How to run a fresh version of AIX in a Virtual Machine with a Linux host?

I need to learn about AIX, and I only have a laptop with Fedora 14/VirtualBox on it. Is there any chance that I could run an AIX guest in my VirtualBox? My laptop has an Intel(R) Core(TM)2 Duo CPU T7100 @ 1.80GHz, and I read that it only runs on RISC architecture. So there's no way I can run it on my laptop?


Search for a Value only in one column w.o using awk, sed, or perl

I have a file that looks like this :               Marketing  Ranjit Singh   FULLEagles       Dean Johnson        Marketing  Ken Whillans   FULLEagles       Karen Thompson      Sales      Peter RobertsonPARTGolden TigersRich Gardener       President  Sandeep Jain   CONTWimps        Ken Whillans        Operations John Thompson  PARTHawks        Cher                Operations Cher           CONTVegans       Karen Patel         Sales      John Jacobs    FULLHawks        Davinder Singh      Finance    Dean Johnson   FULLVegans       Sandeep Jain        EngineeringKaren Thompson PARTVegans       John Thompson       IT         Rich Gardener  FULLGolden TigersPeter Robertson     IT         Karen Patel    FULLWimps        Ranjit Singh         I want to use a grep command to search for "John" in the 2nd column w.o searching the last column, but for every "John" in the 2nd column, I want the output of the last column. The end result should look like this :                      John Thompson                   Cher                       John Jacobs                     Davinder Singh             Dean Johnson                    Sandeep Jain


Script that uses MySQL query to automatically remove output

I have this query that outputs updates older than 7 days from a database. How would I make a script that takes the MySQL statement and puts it into a script to be executed by cron.               echo "select name, reported_at from nodes where reported_at < curdate() -7;" |     mysql dashboard      Sample output:               name    reported_at     xadf.edu    2012-03-21 14:39:02     xadf.edu    2012-03-22 15:30:01     adsfsadf.edu    2012-03-14 14:40:02     ekdahlj.edu 2012-03-23 03:40:04     adfasdf.net 2012-03-21 14:42:02     eqrsdr.edu  2012-03-15 14:42:02     qwerwfva.edu    2012-03-13 14:42:03     qerqwer.edu 2012-03-23 14:40:01     adfasde.edu 2012-03-05 17:42:03     bsfdgs.edu  2012-03-23 15:20:01     adfadsf.edu 2012-03-23 14:43:01


Wordpress won't recognize the MySQL database

I want to install Wordpress on Archlinux but I have this error: > Your PHP installation appears to be missing the MySQL extension which is > required by WordPress. I un-commented this line in `/etc/php/php.ini`:               ; ... or under UNIX:     ;         extension=msql.so     ;      but this error is not fixed. how can I fix this error?


Please explain the output of the ls -all command

This is one of the many similar lines from the output from ls -all               lrwxrwxrwx  1 subhrcho dba   25 Dec  6 01:36 beam-server.jpr -> .ade_path/beam-server.jpr      What does the above signify ? I am specially interested in `.ade_path` ? What does the dot(.) signify here ?


Can I safely read a file that is appended to by another process?

If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A? I'm using Ubuntu Linux 12.04 if that's important. * * * Background information: I want to continuously backup a PostgreSQL cluster. PostgreSQL provides WAL archiving for that. It works by having the database call a script that copies a completed WAL file to some backup location. I want another process to regularly copy the backed up WAL files to another server. If a WAL file is currently being copied by the database, can the second process still read the file without running into some EOF condition before the file is copied as a whole? In other words: Can I do the following with no synchronization between A and B?               A                                   B     cp pg_xlog/some_wal_file /backup/   scp /backup/* user@remote-machine:/backups/


IPtables on ubuntu 12.04

I've problem with iptables on ubuntu 12.4. I type `ufw status`, it show result `Status: inactive` but I type `iptbles -L -nv`, it still shows many rules, and these rules are running. I can't understand.


Linux distributions for ARM processors

Are there any Linux distributions (Other than Backtrack and Android) available for ARM processors? specifically ARM 11 (SE Xperia X8)


Reserve memory for a program

Is it at all possible to set aside say 50MB of memory so that in an emergency where something uses all my memory or loads the CPU I could open a terminal, find the offending process, and kill it?


Argument list too long for ls

I get the following error when trying to `ls *.txt | wc -l` a directory that contains many files:               -bash: /bin/ls: Argument list too long      Does the threshold of this "Argument list" dependent on distro or computer's spec? Usually, I'd pipe the result of such big result to some other commands (`wc -l` for example), so I'm not concerned with limits of the terminal.


bash script not being run by cron

I have a very simple bash script that runs flawlessly when I do               ./removeOldBackup.sh      or               sh /home/myusername/backup/removeOldBackup.sh      but when I add it to crontab like               * * * * * sh /home/myusername/backup/removeOldBackup.sh      or               * * * * * /bin/sh /home/myusername/backup/removeOldBackup.sh      it never works... This is my script:               #!/bin/sh          find . -name 'files_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete     find . -name 'files_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete          find . -name 'database_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete     find . -name 'database_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete      This is my script permissions:               -rwxr-xr-x 1 root root 295 Jul 25 10:07 /home/myusername/backup/removeOldBackup.sh      Crontab is added for user root. This is what I find in `/var/log/syslog`:               Jul 25 10:11:01 myservername /USR/SBIN/CRON[7583]: (root) CMD (sh /home/myusername/backup/removeOldBackup.sh)      So again, when I run the script manually, my backup files get removed correctly. When it is run by cron, they never get removed. I'm using debian-6.0-x86_64.


something is terribly wrong with pkg-config

I've been having a harrowing time lately just trying to get several C programs compiled because I can't find where the libraries are located and pkg-config seems to be out of order. I installed GNU GSL like this:               wget ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz     tar xvzf gsl-*gz     cd gsl-1.15     ./configure     make     sudo make install      Apparently it installed in `/usr/local/lib` which is a non-standard place? (1) What is a standard place? (2) How would I get it to install there? And I can't manage to compile a simple program that uses this library:               $ gcc gsl_erf.c -o gsl -I/usr/local/lib -L/usr/local/lib     /tmp/cc3WD9Zq.o: In function `main':     gsl_erf.c:(.text+0x24): undefined reference to `gsl_cdf_gaussian_P'     collect2: error: ld returned 1 exit status      Now, with pkg-config :               pkg-config --libs --cflags gslPackage gsl was not found in the pkg-config search path.     Perhaps you should add the directory containing `gsl.pc'     to the PKG_CONFIG_PATH environment variable     No package 'gsl' found      So I did add the directory:               PKG_CONFIG_PATH=/usr/local/lib/pkgconfig      But no luck yet! :( pkg-config still gives me the same message as above. (`Perhaps you sh ...`) This is a more general problem I face regularly when I have to compile some C program. I would love a general solution for:   1. Where and how do I install my C libs? (Perhaps the same place yum installs them?)   2. How do I correct/configure and use pkg-config * * * **Update** : I tried one of the answer's suggestions below and running the compiled program gives me this : `./gsl_app: error while loading shared libraries: libgsl.so.0: cannot open shared object`


What stuff can be safely removed for disk space sake?

I am using Scientific Linux. So is there any stuff that can be safely removed from disk except `/tmp`?


why is filesystem intensive script not faster on ram disk

I have a script which creates a lot of files and directories. The script does black box tests for a program which works with a lot of files and directories. The test count grew and the tests were taking too long (over 2 seconds). I thought I run the tests in a ram disk. I ran the test in `/dev/shm`. Strangely it did not run any faster. Average run time was about the same as on normal harddisk. I also tried in a fuse based ram disk written in perl. The website is gone but I found it in the internet archive. Average run time on the fuse ram disk is even slower. Perhaps because of the suboptimal implementation of the perl code. Here is a simplified version of my script:               #! /bin/sh          preparedir() {       mkdir foo       mkdir bar       touch bar/file       mkdir bar/baz       echo qux > bar/baz/file     }          dostuff() {       mkdir actual       (cd actual; preparedir)       find actual -type f -execdir cat '{}' \; > /dev/null       mkdir expected       (cd expected; preparedir)       diff -qr actual expected     }          dostuffoften() {       while read dirname; do         rm -rf $dirname         mkdir $dirname         (cd $dirname; dostuff)       done     }          seq 100 | dostuffoften      The real script does a bit more error checking and result collecting and a summary. The `find` is a dummy for the actual program I am testing. I wonder why my filesystem intensive script does not run faster on a memory backed filesystem. Is it because the linux kernel handles the filesystem cache so efficiently that it practically is a memory backed filesystem?


Why does this awk command not play as well with find as sed does?

I am very much a **newbie** at Unix/Linux command line stuff, and mostly get to where I'm going by copying, pasting, and modifying code I find on the internet. Just mentioning that in hopes people will keep answers simple and without assuming I know what's going on. I'm creating a **Bash shell script** to do some file manipulation on some HTML files. Among the many actions I do, I have this `sed` command which works great:               find $DIR -type f -name '*.html' -exec sed -i 's/.*<script type="text\/javascript" charset="utf-8" src="file.js"><\/script>.*/<script type="text\/javascript" charset="utf-8" src="file2.js"><\/script>/g' {} \;      It looks through every HTML file in the directory in question, and replaces one line of text. I wanted to do something similar where I replace multiple lines between two HTML coments. So I want to take this:               <!-- STARTREPLACE1 -->     Blah     Blah     Blah     <!-- ENDREPLACE1 -->      And change it to:               <!-- STARTREPLACE1 -->     A whole new world!     <!-- ENDREPLACE1 -->      I found this `awk` command which seems to work when I run it on one file:               awk '/<!-- STARTREPLACE1 -->/{p=1;print;print "A whole new world!"}/<!-- ENDREPLACE1 -->/{p=0}!p' justonefile.html      So I thought I could do the same `find` function I use with `sed` and apply that method here in order to run this `awk` command on every HTML file in the directory:               find $DIR -type f -name '*.html' -exec awk '/<!-- STARTREPLACE1 -->/{p=1;print;print "A whole new world!"}/<!-- ENDREPLACE1 -->/{p=0}!p'      But when I run it, it says:               find: `-exec' no such parameter      Is there a way I can get my awk command to run on all the HTML files? _**Bonus question:_** Can I also remove the two tags around the text I want to replace? So `<!-- STARTREPLACE1 -->` and `<!-- ENDREPLACE1 -->` are removed and I only end up with:               A whole new world!


Jingle CLI client / Jitsi replacement / VOIP

I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this program. Does anybody know of a CLI client that supports:   * VoIP   * Communication with people on XMPP accounts   * Text chat not necessary, I have IRC for that. And if you want to make my week:   * Full audio controls (Jack, or input/output device selection). The system is Ubuntu 11.04 Server.


openSUSE 12.1 x64: VNC presents "nobody's X11 desktop"

I activated VNC using Yast and it works but it only display's "nobody's X11 desktop". I use Apple Remote Desktop to connect and gave it username and password. I also tried with Chicken of the VNC which does not take a username but only a password and it cannot connect at all. Port number is always correct (5901). What's wrong?