"not a valid identifier" when I do "export $PATH"

When I run `export $PATH` in bash, I get the error `not a valid identifier`. Why? Here's my ~/.bashrc file               # ~/.bashrc: executed by bash(1) for non-login shells.     # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)     # for examples          # If not running interactively, don't do anything     case $- in         *i*) ;;           *) return;;     esac          # don't put duplicate lines or lines starting with space in the history.     # See bash(1) for more options     HISTCONTROL=ignoreboth          #VARIABLES     export JAVA_HOME=/home/thasaleni/software/jdk1.7.0_21     export MAVEN_HOME=/home/thasaleni/software/apache-maven-3.0.5     export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin          # append to the history file, don't overwrite it     shopt -s histappend          # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)     HISTSIZE=1000     HISTFILESIZE=2000          # check the window size after each command and, if necessary,     # update the values of LINES and COLUMNS.     shopt -s checkwinsize          # If set, the pattern "**" used in a pathname expansion context will     # match all files and zero or more directories and subdirectories.     #shopt -s globstar          # make less more friendly for non-text input files, see lesspipe(1)     [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"          # set variable identifying the chroot you work in (used in the prompt below)     if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then     debian_chroot=$(cat /etc/debian_chroot)     fi          # set a fancy prompt (non-color, unless we know we "want" color)     case "$TERM" in         xterm-color) color_prompt=yes;;     esac          # uncomment for a colored prompt, if the terminal has the capability; turned     # off by default to not distract the user: the focus in a terminal window     # should be on the output of commands, not on the prompt     #force_color_prompt=yes          if [ -n "$force_color_prompt" ]; then         if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then         # We have color support; assume it's compliant with Ecma-48         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such         # a case would tend to support setf rather than setaf.)         color_prompt=yes          else         color_prompt=         fi     fi          if [ "$color_prompt" = yes ]; then         PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\        [\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '     else         PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '     fi     unset color_prompt force_color_prompt          # If this is an xterm set the title to user@host:dir     case "$TERM" in     xterm*|rxvt*)         PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"         ;;       *)        ;;     esac          # enable color support of ls and also add handy aliases     if [ -x /usr/bin/dircolors ]; then     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"     alias ls='ls --color=auto'     #alias dir='dir --color=auto'     #alias vdir='vdir --color=auto'          alias grep='grep --color=auto'     alias fgrep='fgrep --color=auto'     alias egrep='egrep --color=auto'     fi          # some more ls aliases       alias ll='ls -alF'     alias la='ls -A'     alias l='ls -CF'          # Add an "alert" alias for long running commands.  Use like so:     #   sleep 10; alert     alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal ||     echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-    9]\+\s*//;s/[;&|]\s*alert$//'\'')"'          # Alias definitions.     # You may want to put all your additions into a separate file like     # ~/.bash_aliases, instead of adding them here directly.     # See /usr/share/doc/bash-doc/examples in the bash-doc package.          if [ -f ~/.bash_aliases ]; then         . ~/.bash_aliases     fi          # enable programmable completion features (you don't need to enable     # this, if it's already enabled in /etc/bash.bashrc and /etc/profile     # sources /etc/bash.bashrc).     if ! shopt -oq posix; then       if [ -f /usr/share/bash-completion/bash_completion ]; then         . /usr/share/bash-completion/bash_completion       elif [ -f /etc/bash_completion ]; then         . /etc/bash_completion       fi     fi


init: is it a user thread or a kernel thread?

init is the first task executed after kernel is loaded, right? Then who is its owner. also I can see [swapper/0] [swapper/1] ..... [swapper/7] having pid 0               PID    PPID  CPU   TASK    ST  %MEM     VSZ    RSS  COMM      0      0   0  c180b020  RU   0.0       0      0  [swapper/0]      0      2   1  f7550ca0  RU   0.0       0      0  [swapper/1]      0      2   2  f7554bc0  RU   0.0       0      0  [swapper/2]      0      2   3  f7570ca0  RU   0.0       0      0  [swapper/3]      0      2   4  f7574bc0  RU   0.0       0      0  [swapper/4]      0      2   5  f75c8ca0  RU   0.0       0      0  [swapper/5]      0      2   6  f75ccbc0  RU   0.0       0      0  [swapper/6]      0      2   7  f75f0ca0  RU   0.0       0      0  [swapper/7]      1      0   2  f7480000  IN   0.1    4676   2568  init      2      0   5  f7480ca0  IN   0.0       0      0  [kthreadd]


Is there an easy way to change bash suggestions?

I've noticed that some console commands (like sudo or xargs) are using different kind of suggestions when I press Tab (they suggest programs instead of files). Is there a way to mimic that kind of behavior for self written bash script?


wget grabbing empty files that actually exist

I have a script that's meant to download a certain number of files from a remote server. It only needs to do this every 24 hours, since they are JSON sources for a database on my server. The files are updated on the remote server around midnight GMT, and my script runs an hour after that to ensure they are properly updated already. The problem is that I consistently notice it fails to download at least twenty or more out of the 132 files, except it doesn't think it's failed at all (I see 200 OK). They are JSONs, so they are at most 8KB in size. In the wget logfile, I see this:               --2013-09-21 12:01:10--  http://services.runescape.com/m=itemdb_rs/api/graph/19227.json     Reusing existing connection to services.runescape.com:80.     HTTP request sent, awaiting response... 200 OK     Length: 0 [text/html]     Saving to: `./jsons/19227.json'           0K                                                        0.00 =0s          2013-09-21 12:01:10 (0.00 B/s) - `./jsons/19227.json' saved [0/0]      This doesn't make any sense. There's no rhyme or reason to the failures. I re- tried many times and each time it wrote 0-byte files at random, not failing on the same files each time. The frustrating part is there are no errors anywhere, so nothing gets caught in the error log... no-clobber doesn't matter in this case. The files are meant to be overwritten, as they become out-of-date every 24 hours, and even "good data" from the day before is "bad data" today. Is there anywhere I could improve my script to check filesize or whatever before downloading? I tried on my Mac at home and got the same exact result, even using "spider mode" to check if it exists first. The most frustrating part is if I were to paste the URL into a browser, it loads the whole JSON just as it should...I take it "retries" won't help as wget is not running into any HTTP errors anyway.


emacs copy and paste

How can I copy from emacs and paste into another instance of emacs or else where? If I do `C-space`, `M-w`, and then `C-y`, I can only paste in the open instance of Emacs. If I navigate to another Emacs window or outside of Emacs, `Crtl + v` does nothing or paste something I copied that wasn't in Emacs. I am looking for a solution the updates the init lisp script (`~/.emacs`). I don't want to switch programs. As of now, I have this in my `.emacs` but it doesn't seem to do the trick.               ;; Copy and paste between Emac instances                                               (setq x-select-enable-clipboard t)     (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)


Supress expansion of * in echo

I am working on a script which dynamically executes some queries on daily basis. These queries are coming from a table in the database. Here is the sample output of the query table:               +---------------+-------------------------------+---------+     | query_name    | query                         | userid  |     +---------------+-------------------------------+---------+     | All_User      | select * from users LIMIT 10; | jmatthe |     +---------------+-------------------------------+---------+      Now, I have to execute the query `select * from users LIMIT 10;` dynamically. I am reading each line of the output and storing the query from the output.               query_name=$(echo $query | cut -d\| -f1)     query_sql=$(echo $query | cut -d\| -f2)     query_user=$(echo $query | cut -d\| -f3)      Now here is where the problem arises. Because my line contains a `*` character in it, `echo $query` expands the `*` to replace it with the files in the current directory. So basically, my `query_sql` stores something like this.               select batchemail.sh query_output.txt from tbl_query      I want to preserve the `*` in the line so that I get the same in my `query_sql` variable. I want my `query_sql` variable to store the original data.               select * from tbl_query      Can anybody guide me on this?


Can I have a bridged interface without an IP?

I have 2 NICs: eth0 & eth1 on a host OS which runs some VMs (LXC) under it.   * The hosts **eth0** is connected to a private network and configured as the primary interface.    * The hosts **eth1** is connected to the DMZ.   * **Each VM has a static IP** that bridges to eth0 on the host.   * Some VMs, which need a public IP, have a 2nd virtual NIC bridged to the hosts eth1. **Question:**   * Can I remove the IP address on the hosts eth1 NIC? The host has absolutely no need for a public IP address, I only need to bridge the interface to selected guest VMs. It's the guest VM which will host a service on whatever public IP its assigned. Cursory attempts at removing the IP on the hosts eth1 have generated errors.


Split values rewriting key and value in newline

File1.txt               A   1   2   3      File2.txt               A   1     A   2     A   3      File 2 can be converted into File 1 using the following code (the first column is the primary key):               cat File2.txt| awk '{line="";for (i = 2; i <= NF; i++) line = line $i " "; table[$1]=table[$1] line;} END {for (key in table) print key "\t" table[key];}' > File1.txt      How can one go back from the format in File 1 to File 2 ?


How to Run a script on USB removal?

I want to execute the script on removal of usb drive. In that script I want to restart the server.   Is there any way to do the same ? I know I have to modify the rules in /etc/udev/rules.d/.


How do I compile source into the kernel?

I want to add and compile my custom application code into my kernel. How should I add my `.c` and `.o` files into my kernel 'bin' directory and compile them? I made a `hello.c` and `hello.o` file and I want to add them into my kernel such way that when kernel start this `hello.o` file runs. Do I need to edit some makefile?


Select PID by full command

I need to select the PID of a Java process. If I run something like this: `ps -C java -o pid=`, it will select all the Java processes. I am after a specific process where the command used to start is `./java -jar /path/to/my/jar.jar` If I try this: `ps -C "./java -jar /path/to/my/jar.jar" -opid=` it doesn't work because the selection is not right. Does anyone know how I can select the PID based on the startup command?


Why would the kernel drop packets?

I interrupted `tcpdump` with `Ctrl`+`C` and got this total summary:               579204 packets captured     579346 packets received by filter     142 packets dropped by kernel      What are the "packets dropped by kernel"? Why does that happen?


Build Transmission 2.84 .deb package with checkinstall

I'm trying to compile and make by myself some .deb packages to keep my Raspbian more up to date than the repository. Now I want to update Transmission to v 2.84. Here's what I've done:   1. Download the tarball from Transmission web site: https://www.transmissionbt.com/download/   2. Install checkinstall from Raspbian repository: `$sudo apt-get install checkinstall`   3. Extract source from tarball   4. `./configure` from transmission source directory   5. `checkinstall --install=no` from transmission source directory Now I've a armhf .deb, but if I install it with `dpkg -i transmission_2.84-1_armhf.deb` I have only a partial installation. The installation completes correctly but I don't have:   * Transmission configuration directory and files (should be `$HOME/.config/transmission-daemon`)   * Boot/startup script for daemon on `/etc/init.d`   * I don't really know if something else is missing... I want to generate a **COMPLETE .DEB package** with all the necessary files like official repositories .deb packages. I'd also like to do the same with some other applications, like `htop`. What should I do? **UPDATE** These are the steps I made to try to compile version 2.84 with debian directory taken from version 2.82:   1. download tarball with `wget https://transmission.cachefly.net/transmission-2.84.tar.xz`   2. extract archive on my source directory with `extract transmission-2.84.tar.xz` (extract() is a function in aliases, so it's equivalent to `tar xvJf ...`)   3. download debian folder of version 2.82 with `wget http://archive.raspbian.org/raspbian/pool/main/t/transmission/transmission_2.82-1.1.debian.tar.xz`   4. extract archive inside transmission 2.84 directory with `extract transmission_2.82-1.1.debian.tar.xz` that created a `debian` directory inside `transmission-2.84/` directory   5. `./configure` from `transmission-2.84/` directory   6. after successfully configure, `sudo checkinstall --install=no` from `transmission-2.84/` directory. `checkinstall` will execute `make` and `make install`. With option `\--install=no` it execute only `make` and then create a `.deb` package inside the `transmission-2.84/` directory   7. `dpkg -i transmission_2.84-1_armhf.deb` to install package   8. configure transmission settings on `~/.config/transmission-daemon/settings.json`   9. `sudo nano /etc/init.d/transmission-daemon` to create init.d boot script   10. `update-rc.d transmission-daemon defaults` to link the new script   11. `transmission-daemon` and `sudo service transmission-daemon start` to try to start transmission


Why does hostname -h return 255

"No news is good news", which, sticking with the normal convention should return 0. Why does               hostname -h       return 255, especially when, 255 by convention, is meant to mean "Exit status out of range"


Set Kernel Root to Same Partition as Boot

Running GRUB, I want to set the kernel root parameter to the same partition (or more generically, to a partition on the same device) as the disk with the bootloader. Initially, the install set the GRUB menu item to pass `/dev/XX` as the root parameter:               title XXXXX         root (hd#,#)         kernel /boot/vmlinuz-XXXX root=/dev/XX1 resume=/dev/XX2 splash=silent quiet showopts vga=0x###         initrd /boot/initrd-XXXX      I can change the `kernel` line to reference my disk's label, increasing its tolerance for appearing in various orders:                   kernel /boot/vmlinuz-XXXX root=LABEL=??? resume=LABEL=swap? splash=silent quiet showopts vga=0x###      I would like to change that line so that I can reference the boot partition, whether it's `/dev/sda2` or `/dev/hdb6`, or even better to reference only a partition number, which the kernel will interpret relative to the boot partition (`root (hd#,#)` in GRUB).


gnome-terminal won't launch because it crashes every time

gnome-terminal worked this morning, and I haven't installed any software or changed any OS configurations. Now every time I try to open a terminal window, I get an error dialog: The application gnome-terminal has crashed. However you don't have installed bug-buddy, the GNOME crash report tool..." I've tried installing bug-buddy unsuccessfully, but that's beside the point. I restarted and shut-down/started-up without luck. I've uninstalled and reinstalled gnome-terminal, and this didn't help either.


"Out of Memory" error while copying large files with pcmanfm

This is an older machine running a Debian-based distro with `lxde` and `pcmanfm` used as file manager. `pcmanfm` normally runs quite well, except when it comes to copying _very_ large files (e. g. `*.VOB`s from an uncompressed DVD). Well, actually I thought it would use my **swap** (set at 3.5 GB) but unfortunately swap would always show about **12 MB**.   So is `pcmanfm` _ignoring_ the swap file? Unfortunately, one of this machine's RAM modules showed errors and I had to remove it. So I'm currently down to only 1 GB of physical RAM :(. Still, this should not matter if swap was correctly addressed! Example from `syslog`:               [40398.719466] Out of memory: Kill process 21573 (compiz) score 2 or sacrifice child      Instead, processes that require most resources get killed by the kernel, coincidentally depending what it gets hold of next (usually `compiz`, `dbus` etc.) Is there a way to "tell" pcmanfm to use the swap space anyway?


Is there an easy way to not log a specific sshd event?

The monitoring tool of my hoster is making regular connections with ssh on port 22 to see or the service is up. This is cluttering my /var/log/messages with this kind of messages:               Dec 13 22:20:17  sshd[29487]: Did not receive identification string from 80.xx.xx.xx      Is there an easy way of muting this message "Did not receive identification string from" for that specific ip?


Replace exact word with another in shell with tr command

I want to replace a word with another word in a text file. file.txt :               alireza fallah      my code :               cat file.txt | tr ali ALI      but I get this :               ALI fALLAh      it replace all 'a's to 'A' , and 'l's to 'L' and 'i's to 'I' . is there any way to replace just 'ali' to 'ALI' ?


nfs-common installation fails

on newly installed Debian Wheezy machine, installation of `nfs-common` fails:               apt-get install nfs-common      Reading package lists... Done     Building dependency tree            Reading state information... Done     Suggested packages:       open-iscsi watchdog     The following NEW packages will be installed:       nfs-common     0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/288 kB of archives.     After this operation, 718 kB of additional disk space will be used.     Selecting previously unselected package nfs-common.     (Reading database ... 14755 files and directories currently installed.)     Unpacking nfs-common (from .../nfs-common_1%3a1.2.6-4_amd64.deb) ...     Processing triggers for man-db ...     Setting up nfs-common (1:1.2.6-4) ...          Creating config file /etc/idmapd.conf with new version          Creating config file /etc/default/nfs-common with new version     [FAIL] Starting NFS common utilities: statd failed!     invoke-rc.d: initscript nfs-common, action "start" failed.     dpkg: error processing nfs-common (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      nfs-common     E: Sub-process /usr/bin/dpkg returned an error code (1)      `/var/log/syslog` has following erros:               2013-09-26 14:33:26  rpc.statd:  Failed to read /var/lib/nfs/state: Success     2013-09-26 14:33:26  rpc.statd:  Initializing NSM state     2013-09-26 14:33:26  rpc.statd:  Failed to access local netconfig database: Netconfig database not found     2013-09-26 14:33:26  rpc.statd:  failed to create RPC listeners, exiting      can anybody please help ?


"sudo: sorry, you must have a tty to run sudo" when using sudo in a remote script

I want to run a series of sudo-elevated commands on a remote machine from an embedded script. To simplify the question, I'm just trying to run sudo id and get it to tell me that it's root. I am encountering "sudo: sorry, you must have a tty to run sudo" when I run this script:               #!/bin/bash     ssh -t 192.168.1.100<<EOF     sudo id     EOF      But not when I run this:               #!/bin/bash     ssh -t 192.168.1.100 sudo id      How do I get the first one, with the end-of-file designations for an embedded script to respect the forced tty at the other end of the SSH?


How to use shell to derive an IPv6 address from a MAC address?

We know that we can use the MAC address to create an interface identifier, e.g. for a link-local IPv6 address which should be unique in the Network. The image shows the way to do this: ![Create interface identifier from MAC address ](http://i.stack.imgur.com/PNQOA.png) My questions are:   * How can I create an IPv6 address from a MAC using `awk` or `sed`?   * OR is there any command that gives me the link-local IPv6 address for a specific MAC (something like that `createIPv6 myMAC`)?


backup user accounts without giving a home directory to them

I am reinstalling the older Ubuntu machines with the latest RHEL 6.0 in servers. I have `/etc/passwd` and `/etc/group` and `/etc/shadow` file backed up for the list of user accounts that I need to create after reinstallation of OS. I have installed RHEL 6.0 in couple of machines and I need to grant access to the users immediately. I want to use the `/etc/passwd` and other files into this machine so that the users can start using the server with their user accounts. But, I do not wish to create a `/home/user` directory for the users for couple of reasons.   * The users will be accessing only the partition `/mounts` which apparently has the project data.   * I am eventually planning to configure `NFS` and `openldap` at a later stage. So, if I have to provide `home` directory for the users, I need to backup the home directory for the users in all the machines where I gave the local user account for users and put it in the `NFS` server which is a redundant step.  Is it possible to give users access without `home` folder? I have seen machines without `/home` directory using `/` as the home directory. But I am not sure if this is a safe step and I want the users to be **unaware** that their `home` directories do not exist. **EDIT** I see the users can be added without creating the home directory for them using the below command.               adduser --system --no-create-home USERNAME      But my challenge lies in how can I use the same user account as in `/etc/passwd` and other files without creating a home directory? I want the users be able to use their same passwords as in `/etc/passwd` now without a home directory.


Website Building throught the Terminal Linux MInt please help!

So! I'm not even 13- 11 to be exact. But I'm making a Game, so, of course, I should have a Website, that would make sense. And, I'm making It from scratch and! I need to learn things. I'm using a ssh Web server and have lots of questions. I'm using php but I can't seem to find any Videos on Youtube, and I've tried looking It up on Google, which Is how I found this. One major thing before I pay some money to publish the thing Is Tabs. How this Website has /questiond /tag /users, etc, I want to know how to do that. If you want I can make a short video of what I've done so far. If you've made a Website from scratch using the Terminal I would really like to know how to do a lot more things. I have Linux Mint, the KDE Desktop.


When was the concept of remote repositories invented?

When were remote repositories, for any package manager, invented and implemented?


change Xfce4 brightness notification position

Is it possible to change the xfce4-notifyd brightness notification positioning? Example: position brightness notification like volume change notification (in my case in the upper right corner). Is this possible by only using xfce4-notifyd (and not notify-send)? im using archlinux with xfce. xfce-notifyd settings: display in upper right corner; theme is Numix (using faenza-dark icon theme) changing settings dont affect the brightness notification, but working fine for the others. (-> is brightness notification really controlled by xfce4-notifyd?) images to clarify my question: I want this notification : ![brightness positioning](http://s1.directupload.net/images/140207/6hucllmy.png) ..positioned like the following: ![normal positioning](http://s14.directupload.net/images/140207/u9zpytdu.png) xfce4-notifyd-config (settings): ![notifyd settings](http://s14.directupload.net/images/140207/ln3vlrhk.png)


Simulating user activity

I want to simulate user activity on a virtual machine in a completely automated maner. That is, I would like to run a program or a set of scripts that would simulate an user using a computer for an indefinite amount of time (say, simulate an office worker - write some random files, open some files, check webpages, etc.) Basically, I'm simulating an internal network over a set of virtual machines and would like to add some activity to the network to make it more realistic. Is there a program or a set of scripts out there that could do the described job? I was thinking that network testing tools might be of help, but would a set of those be enough to simulate activity on different aplications (say, mail servers, ldap server, nfs, apache, etc.) ? Any advice on how to acomplish this? Thank you


What is SVN snapshot?

In the last lines of website http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation it says               Optional tools     Download the latest SVN snapshot from http://ffmpeg.org/releases/     Unpack and install it.     tar -xvjf ffmpeg-export-snapshot.tar.bz2     cd ffmpeg-export-<insert date here>     ./configure --prefix=/opt/gerris     make && make install      i enter this website http://ffmpeg.org/releases/ but there are lots of releases . Which one is SVN snapshot?


how to ignore a MySql error and go on to the next query?

I have created a shell script to connect to a DateBase and INSERT IPs and MACs from dhcpd.log file by connecting to the DB only once:               #/!bin/bash     dhcpLogFile="/var/log/dhcpd.log"     NumberOfLines=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++'|awk 'BEGIN{i=0}{i++;}END{print i}')     j=1     while [ $NumberOfLines -gt 0 ]     do     ip=$(awk '/DHCPACK/ { print $8} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')     mac=$(awk '/DHCPACK/ { print $10} ' $dhcpLogFile | awk '!x[$0]++' |cut -f$j -d$'\n')       let "j +=1"     let "NumberOfLines -=1"     INSERT INTO IP_MACTable (IP_Address, MAC) VALUES ('$ip','$mac');     done | mysql -u root --password='pw' MatchingDB      In MySql I have set "IP,MAC" attributes as a unique so "ip,mac" field won't be duplicated, so when It duplicated in the log of dhcp.log the DB reply with a message `ERROR 1062 (23000) at line 1: Duplicate entry '192.168.1.20-00:0c:29:95:fd:10' for key 'IP_Address'`   my question is : As I connect to the DB only once , sql will interpret multiple queries in one connection, but the problem is when an error occured it won't complete interpreting other queries , so is it a way to ignore an SQL error and go on to other queries?


Can someone explain the different types of unix domain sockets?

If I run `netstat --all | grep ^unix` some of the socket paths that are outputted are preceded with a '@' and some aren't. I've noticed that those preceded with a '@' don't show up when browsing the file system with `ls` but the rest do. What are these two kinds of sockets and what is the difference between them?


Desktop app run by admin user (but not explicitly with sudo) takes file ownership of shared file

Similar to http://stackoverflow.com/questions/15143614/file-ownership-changes- to-root-after-saving-from-a-program-in-ubuntu but I can't use the answer since I'm not running a command-line app as sudo. I'm running a desktop app on Mint 16 32-bit on a shared file (locally shared, i.e. just on a local drive with 777 perms and nobody:users ownership), which then is not able to be overwritten by another user when they go to use it because it becomes adminuser:adminuser and 644. How can I share this file between users, and keep it from switching ownership/perms whenever the main admin user uses it?


Starting backintime at disk plug

I use `backintime`, you can tell it to backup via `backintime -b` as user (not root, but I can change that if needed). Now I'd like it to start as soon as I plug my backup hd. As udev is likely the right tool, there's a bunch of info: http://sprunge.us/icCa. Bonus points if it's possible to assign a label to the disk ("backup") and match against that, not serial numbers.


Meaning of entries in /etc/securetty?

I've been given a set of entries to apply to /etc/securetty, what does each of them mean?               console     tty1cd /     tty2     tty3     tty4     tty5     tty6     ttyS0     ttyS1      I'm especially interested in the "tty1cd /" entry. I can't find anything about it online, and nobody here seems to know why it's there...


How can you achieve vi's `se ai` in Emacs?

What's the simplest way to set up auto indentation in Emacs? I can see that auto-fill correctly wraps, say:                 This is an indented block, and the       wrapping happens as expected.      On the other hand, I get this unwanted behavior:                 This is an indented short line.     I'm now taken to the beginning of the     line.  I expected to be under the "T".      In other words, how can I get the equivalent of vi's `se ai` in Emacs?


Backup of LVM2 logical volume

I'd like to make backup on external drive of LVM2 logical volume in `dd` manner. Approach I consider is to   * make lv on extranl drive with identical size   * copy with `dd` (Please let me know if you see something really wrong in such approach. I need something reliable and fast.) I would like to automatize whole process, it is what I have:               # Sanity check that lv is not used     lvuses="$( lvdisplay -c /dev/mapper/vgA-AA | cut -d ':' -f 6 )"     if [ $lvuses -gt 0 ]; then exit 1 ; fi     #obtain lv size (in sectors)     lvsize="$( lvdisplay -c /dev/mapper/vgA-AA | cut -d ':' -f 7 )"     #create destination     lvcreate -L "${lvsize}s" vgB -n BB || exit 1     # copy     dd if=/dev/mapper/vgA-AA of=/dev/mapper/vgB-BB      Is it all right? Haven't I missed sth ? (In my case vgA-AA is LVM snapshot and I would like to backup it to external drive and take this drive to other geographical location)


rsync with absolute paths and excluding subpaths

Say I have the following structure on path `origin_path`               origin_path/X=1/A/...     origin_path/X=1/B/...     origin_path/X=1/C/...     ...     origin_path/X=2/A/...     origin_path/X=2/B/...     origin_path/X=2/C/...     ...     ...      I would like to replicate the structure above at a different path called `destination_path`, but **only** including the paths corresponding to the directories **B** above. In other words, I would like to get the following at `destination_path`               destination_path/X=1/B/...     destination_path/X=2/B/...     destination_path/X=3/B/...     ...      To clarify, some of this structure in destionation path might exist already (e.g. the folders `destination_path/X=*`). From what I understand, thanks to @Gilles' comment, `rsync` filters may be a great fit for this. However, I have never used them before and it's a bit hard for me to extrapolate the example provided in Rsync filter: copying one pattern only to my situation. In what order should I include or exclude things in my case? And how do I tell rsync to use `origin_path` and `destination_path` as global paths? (as opposed to having it copy things with relative paths)


Is it possible to add an item to the GNOME right click menu?

I want to add an item to my right click menu, and run a command when a user clicks on it. I'm using Centos 6.2, is it possible? If yes please tell me how I can do this.


Saving an iptables configuration permanently

How can I save this configuration permanently? `sudo iptables -t nat -A POSTROUTING -s 10.10.0.0/16 -o eth0 -j MASQUERADE`


Postfix, Amavis-new, ClamAV: Permission denied. ERROR

Error lines in **/var/log/maillog**               Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)run_av (ClamAV-clamd) FAILED - unexpected , output="/var/spool/amavisd/tmp/amavis-20130922T052321-04493-crApLkq5/parts: lstat() failed: Permission denied. ERROR\n"     Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)ClamAV-clamd av-scanner FAILED: CODE(0x29185c0) unexpected , output="/var/spool/amavisd/tmp/amavis-20130922T052321-04493-crApLkq5/parts: lstat() failed: Permission denied. ERROR\n" at (eval 113) line 897.     Sep 22 12:08:20 sun amavis[4493]: (04493-09) (!)WARN: all primary virus scanners failed, considering backups      **Server user and group**               # cat /etc/passwd | grep "amavis\|clamav"     clam:x:495:493:Clam Anti Virus Checker:/var/lib/clamav:/sbin/nologin     amavis:x:494:492:User for amavisd-new:/var/spool/amavisd:/sbin/nologin     # id amavis     uid=494(amavis) gid=492(amavis) groups=492(amavis),493(clam)     # id clam     uid=495(clam) gid=493(clam) groups=493(clam),492(amavis)      **Services** > chkconfig --list | grep "amavisd\|clamd\|spamassassin"               amavisd         0:off   1:off   2:on    3:on    4:off   5:off   6:off     clamd           0:off   1:off   2:on    3:on    4:off   5:on    6:off     clamd.amavisd   0:off   1:off   2:on    3:on    4:off   5:off   6:off     spamassassin    0:off   1:off   2:on    3:on    4:off   5:off   6:off      **/etc/clamd.conf**               LocalSocket /var/run/clamav/clamd.sock     LocalSocketGroup amavis     User clam      **/etc/amavisd.conf**               ### http://www.clamav.net/     ['ClamAV-clamd',       \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],       qr/\bOK$/, qr/\bFOUND$/,       qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],     # # NOTE: run clamd under the same user as amavisd, or run it under its own     # #   uid such as clamav, add user clamav to the amavis group, and then add     # #   AllowSupplementaryGroups to clamd.conf;     # # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in     # #   this entry; when running chrooted one may prefer socket "$MYHOME/clamd".      **/etc/postfix/master.cf**               # ==========================================================================     # service type  private unpriv  chroot  wakeup  maxproc command + args     #               (yes)   (yes)   (yes)   (never) (100)     # ==========================================================================     amavisfeed unix    -       -       n        -      2     lmtp         -o lmtp_data_done_timeout=1200         -o lmtp_send_xforward_command=yes         -o disable_dns_lookups=yes         -o max_use=20          # ==========================================================================     # service type  private unpriv  chroot  wakeup  maxproc command + args     #               (yes)   (yes)   (yes)   (never) (100)     # ==========================================================================     127.0.0.1:10025 inet n    -       n       -       -     smtpd         -o content_filter=         -o smtpd_delay_reject=no         -o smtpd_client_restrictions=permit_mynetworks,reject         -o smtpd_helo_restrictions=         -o smtpd_sender_restrictions=         -o smtpd_recipient_restrictions=permit_mynetworks,reject         -o smtpd_data_restrictions=reject_unauth_pipelining         -o smtpd_end_of_data_restrictions=         -o smtpd_restriction_classes=         -o mynetworks=127.0.0.0/8         -o smtpd_error_sleep_time=0         -o smtpd_soft_error_limit=1001         -o smtpd_hard_error_limit=1000         -o smtpd_client_connection_count_limit=0         -o smtpd_client_connection_rate_limit=0         -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters,no_address_mappings         -o local_header_rewrite_clients=         -o smtpd_milters=         -o local_recipient_maps=         -o relay_recipient_maps=      **/etc/postfix/main.cf**               content_filter=amavisfeed:[127.0.0.1]:10024      **ls /var/spool/amavisd/tmp/**               drwxr-x---. 3 amavis amavis 4096 Sep 23 15:00 amavis-20130923T150035-15730-hgztdUJP     drwxr-x---. 3 amavis amavis 4096 Sep 23 15:12 amavis-20130923T151205-16266-HUEzwmIf      **ls /var/spool/amavisd/ -l**               srwxr-x---. 1 amavis amavis    0 Sep 23 04:36 amavisd.sock     drwx------. 2 amavis amavis 4096 Sep 23 04:36 db     drwx------. 2 amavis amavis 4096 Feb 22  2013 quarantine     drwx------. 4 amavis amavis 4096 Sep 23 18:14 tmp


Mount ubuntu one or similar web storage services without their clients

I want to mount a folder to sync with my Ubuntu One account. The only restriction is that I don't want to use the client provided. I use Arch Linux if it counts. And if you can provide a general solution for all WebDAV(??) resources it would be useful and good reference.


Solaris - permanently update PATH for all users

I have installed JDK and Groovy on my Solaris 11 machine. I would now like to set things up so that the PATH variable would contain the bin directories whenever I open a shell. It is my understanding that the following lines added at the end of the `/etc/profile` file should do the trick.               JAVA_HOME=/usr/jdk/instances/jdk1.7.0     PATH=${PATH}:${JAVA_HOME}/bin          GROOVY_HOME=/usr/local/bin/groovy-2.1.3     PATH=${PATH}:${GROOVY_HOME}/bin          export PATH      However, when I restart my putty session, only the JAVA_HOME and GROOVY_HOME variables are affected. The PATH variable stays the same, e.g.               /usr/bin:/usr/sbin      I am wondering if there is another script that runs after /etc/profile, that might override the PATH variable. But I have no idea where to look. Or is there another problem? * * * As porposed in a comment, I tried to use the following lines instead, but unfortunatelly with the same effect.               JAVA_HOME=/usr/jdk/instances/jdk1.7.0     GROOVY_HOME=/usr/local/bin/groovy-2.1.3     export PATH=${PATH}:${GROOVY_HOME}/bin:${JAVA_HOME}/bin


How to log SSHD failed logins with usernames under OpenBSD 5.3?

Since DYNDNS became a payed service, I found a solution to dynamic IP address problem: OPENWRT router side (dynamic IP, this line is in the CRON):               echo close | ssh LOCATION@SERVER -p 22 > /dev/null 2>&1      SERVER side (with fix IP):               on OpenBSD 5.1 I had nothing to do*      CLIENT side (from where I want to connect to the dynamic IP/OpenWRT router):               vi .bashrc     DYNNAMEHERE() {     DYNNAMEHERE01=`ssh root@DOMAINHERE -p PORTHERE "grep 'user DYNNAMEHERE from' /var/log/authlog | tail -1" | sed 's/ from /\n/g' | tail -1 | grep -o "[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*"`     ssh root@"${DYNNAMEHERE01}" -p PORTHERE     }      and then I just need to use this command:               DYNNAMEHERE      and I'm in the OpenWRT router as root. QUESTION: *but with OpenBSD 5.3 the failed login usernames doesn't get logged. Why? I tried to set the SSHD loglevel to DEBUG3 (then: "kill -HUP SSHDPID"), but the failed login usernames weren't logged. UPDATE: The "LOCATION" is the login name. ( but I tried with "-l" too, it didn't worked ) UPDATE: no, I didn't changed the sshd_config besides:               ListenAddress 0.0.0.0     PermitRootLogin without-password     PubkeyAuthentication yes     PasswordAuthentication no


Installing graphics drivers on ubuntu

I have an Nvidia GTX260 video card and I'm using Ubuntu 12.04 x64 bit. I've been trying for hours to get StarCraft II to work with wine and PlayOnLinux. I have tried nearly everything under the sun to get drivers for it to work:   1. Just using nouveau   2. The .run package from nvidia's website   3. `sudo apt-get install nvidia-current`   4. This method which oddly enough is for 12.10 not 12.04   5. `sudo jockey-text -d xorg:nvidia_current` When I start PlayOnLinux it says: `PlayOnLinux is unable to find 32bits OpenGL libraries. You might encounter problem with your games.`. When I run StarCraft II, after hitting the play button in the launcher, it says: `Failed to initialize DirectX. You may need to reinstall DirectX. If the problem persists....` Now I'm in a bit of a mess and I'm considering reinstalling Ubuntu to start fresh. x32 bit this time, since I don't have more than 4GB RAM, and it won't cause the bug mentioned below. However, is there any way to "reset" so to speak? I want to start fresh with the display driver. I don't **really** want to reinstall Ubuntu since I spent hours customizing it with themes and whatnot. I'm aware of a bug with Ubuntu 12.04 LTS x64 bit and wine which causes StarCraft II to not work in some cases. I had StarCraft II working last night using method 4 but with major fps drop from what I get using the same machine with windows 7 x64 bit.               EDIT      I found a solution: www.benjaminwiedmann.net/fix-nouveau-driver-issues-on- ubuntu-12-04-install-nvidia-drivers.html ! I can now run StarCraft II, I'm just looking now to see if I still have the same fps issues as before.


Keyboard shortcut for SIGTERM in GUI application?

Related to another question, is there a way to **send SIGTERM to the currently focused _local_ GUI window application** with a keyboard shortcut? Like clicking the [X] button in most WMs or `Ctrl`-`c` for the command line. Not like `Alt`-`SysRq`-`e` since it kills every application :)


How to modify the default "Index of" page in OpenBSD 5.3 httpd

Using the old apache:               # grep -i httpd /etc/rc.conf      httpd_flags="-DSSL"     # grep -i nginx /etc/rc.conf      nginx_flags=NO     #       How can I modify the custom "Index of" page? ![enter image description here](http://i.stack.imgur.com/ga9bx.png) **Question** : The only problem with the default "Index of" page is that the "NAME" column has way too short width. How can I increase it?


Where can I find documentation or source code for udev properties?

Specifically, I've been trying to find what the possible values are for the property UDISKS_PARTITION_FLAGS. It seems to be set to "boot" if the partition has the boot/active flag set, and unset if not, but I'd like to find some documentation to that effect. Google is unhelpful. I've downloaded and searched both the systemd source (which includes udev) and the kernel source, but found no match for the string "UDISKS_PARTITION_FLAGS". Where is the value of this property set? Where is it documented? **EDIT:** I've been using pyudev to access this property, and I thought it got them from udev. In response to the comments I've tried to get it to show up using               udevadm info --name=/dev/sda1 --attribute-walk      but I can't find the property in question there. However, looking at the link provided by slm in the comments, I found this command:               udisks --show-info /dev/sda1      The output has a `partition` section, where `flags` has the value `boot`. So it's really this value I want to find the documentation or source code for. It is only present for the partition that has the boot flag set.


echo a loop with variables command

I have several lists and want to run some commands over them. As lists are long I want to run those commands parallel to each other, hence using `nohup`.   For every item I tried to `echo` a loop that contains a nohup command, but it doesn't work - `cat another_list_of_names` reads to stdout, but not into `./tools`. First `cat` in `for a in $(cat list_of_names)` sends list to loop, but `echo`'ed `for b in $(cat another_list_of_names)` sends it to stdout.   How can I set those nohup commands running in parallel (is it possible to run `nohup` with `echo`)?               for a in $(cat list_of_names)           do                             ID=`echo $a`               mkdir ${ID}               echo "                   nohup sh -c '                  for b in $(cat another_list_of_names)                    do                        ./tools $b $a >> ${ID}/output                    done' &                "                done


at.allow and at.deny precedence (in Ubuntu)?

It's clear from documentation about cron that if `cron.allow` and `cron.den` both exist then `cron.allow` takes precedence and it is allowed. What is the case for `at.allow` / `at.deny`?   Everywhere I've searched and checked does not say it explicitly. I use Ubuntu.


Debian 7 apt is upgrading my custom backported package with the "official" identical version!

and happy new year to you all.. Recently I've built nginx deb package v1.4.4 from debian backport source that of course I've added to the apt sources.list and things went great. I have run `apt-get update` then `apt-get -V upgrade` today to check how debian 7 apt would behave.. and this is what I got:               root@debian-lab:~/nginx-1.4.4-packages# apt-get -V upgrade     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages will be upgraded:        nginx-full (1.4.4-1~bpo70+1 => 1.4.4-1~bpo70+1)     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/464 kB of archives.     After this operation, 9,027 kB disk space will be freed.     Do you want to continue [Y/n]?      As you can see, apt is trying to upgrade from **(1.4.4-1~bpo70+1 => 1.4.4-1~bpo70+1)** , which is basically two identical version but my installed deb package has custom nginx modules added to default nginx-full and after the update, my custom modules are all gone and replaced by the standard debian wheezy backport deb.. I've built my nginx backport deb package from debian backport source and installed build-deb through the backport as well but some dependencies installed automatically from the stable that's what I saw from the verbose output.. Can you please help me to prevent this with an example? I heard about pinning, but is it the answer to my problem? * * * **UPDATE** I've tried to apt pin the package and didn't work and here is the output i got:               apt-cache policy nginx-full     nginx-full:     Installed: 1.4.4-1~bpo70+1     Candidate: 1.4.4-1~bpo70+1     Version table:      1.4.4-1~bpo70+1 0         100 http://ftp.uk.debian.org/debian/ wheezy-backports/main amd64 Packages     *** 1.4.4-1~bpo70+1 0         100 /var/lib/dpkg/status      1.2.1-2.2+wheezy2 0         500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages         500 http://security.debian.org/ wheezy/updates/main amd64 Packages      And the following is the apt-cache policy nginx:               /etc/apt/preferences.d# apt-cache policy nginx     nginx:       Installed: 1.4.4-1~bpo70+1       Candidate: 1.4.4-1~bpo70+1       Package pin: 1.4.4-1~bpo70+1       Version table:      *** 1.4.4-1~bpo70+1 1001             100 http://ftp.uk.debian.org/debian/ wheezy-backports/main amd64 Packages             100 /var/lib/dpkg/status          1.2.1-2.2+wheezy2 1001             500 http://ftp.uk.debian.org/debian/ wheezy/main amd64 Packages             500 http://security.debian.org/ wheezy/updates/main amd64 Packages      But still apt is trying to upgrade and replace it!! Sources.list content:               deb http://ftp.uk.debian.org/debian/ wheezy main     deb-src http://ftp.uk.debian.org/debian/ wheezy main          deb http://security.debian.org/ wheezy/updates main     deb-src http://security.debian.org/ wheezy/updates main          # wheezy-updates, previously known as 'volatile'     deb http://ftp.uk.debian.org/debian/ wheezy-updates main     deb-src http://ftp.uk.debian.org/debian/ wheezy-updates main          # Wheezy Backports repository     deb http://ftp.uk.debian.org/debian wheezy-backports main     deb-src http://ftp.uk.debian.org/debian wheezy-backports main      I've tried to apt pin once the package name 'nginx' and another time with nginx-full.. But both fail to hold the package!!!


Where do the device option values beginning with "Monitor-xyz" come from in xorg.conf?

Trying to install prop drivers for my Radeon HD6850 card on crunchbang (debian-based linux). Followed these instructions for install from repo and used aticonfig instead of amdconfig to create an initial xorg.conf file. This didn't give any options though and on the web I see countless references to "Monitor-CRT1" and "Monitor-DFPx" without any explanation as to their significance or where they got them from. I have a dual screen 'shared' desktop. The initial aticonfig left me with a single monitor default config. How do I come up with a config that mirrors my setup? Running X.org 1.10


Remount lvm partitions after OS reinstallation

I recently upgraded to Linux Mint from Ubuntu. I have overwritten `/dev/sda2` which had Ubuntu. I had earlier created two logical volumes `opt` and `virtualization` from /dev/sda1. I forgot to take the lvm partition metadata backup. But looks like when I installed `lvm2`, it managed to recover this metadata.   1. How would I mount these logical volumes to `/opt` and `/virtualization`?   2. Also how did `lvm2` manage to recover partition metadata? volumegroup backup file               vg1 {         id = "d0LGSW-hGoz-mc9W-nTc0-zjxc-bEgm-p3GrcT"         seqno = 3         format = "lvm2" # informational         status = ["RESIZEABLE", "READ", "WRITE"]         flags = []         extent_size = 8192      # 4 Megabytes         max_lv = 0         max_pv = 0         metadata_copies = 0              physical_volumes {                  pv0 {                 id = "ZuOjKi-Ya6m-ES2J-jS5P-KwsS-4H51-MUPEL7"                 device = "/dev/sda1"    # Hint only                      status = ["ALLOCATABLE"]                 flags = []                 dev_size = 101810176    # 48.5469 Gigabytes                 pe_start = 384                 pe_count = 12427    # 48.543 Gigabytes             }         }              logical_volumes {                  opt {                 id = "cGkl9d-aCdR-N5Dx-U7kb-sDaG-XVWL-JRpGQS"                 status = ["READ", "WRITE", "VISIBLE"]                 flags = []                 segment_count = 1                      segment1 {                     start_extent = 0                     extent_count = 6400 # 25 Gigabytes                          type = "striped"                     stripe_count = 1    # linear                          stripes = [                         "pv0", 0                     ]                 }             }                  virtualization {                 id = "cHHxE0-hYlf-pg3o-1fTi-ZdkC-GPJv-gYIbOx"                 status = ["READ", "WRITE", "VISIBLE"]                 flags = []                 segment_count = 1                      segment1 {                     start_extent = 0                     extent_count = 5888 # 23 Gigabytes                          type = "striped"                     stripe_count = 1    # linear                          stripes = [                         "pv0", 6400                     ]                 }             }         }     }      /etc/fstab               # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda2 during installation     UUID=a499863a-0110-4a2f-9624-c128e0124836 /               ext4    errors=remount-ro 0       1     # /home was on /dev/sda4 during installation     UUID=0c9bdfe0-0801-4704-b1e1-9719845f3cc3 /home           ext4    defaults        0       2     # swap was on /dev/sda5 during installation     UUID=7cecc37b-4256-4c08-a47a-ea4849f768eb none            swap    sw              0       0      fdisk listing               Disk /dev/sda: 128.0 GB, 128035676160 bytes     255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x742feb57             Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048   101812223    50905088   83  Linux     /dev/sda2   *   101812224   160405503    29296640   83  Linux     /dev/sda3       199469054   226631679    13581313    5  Extended     /dev/sda4       160405504   199467007    19530752   83  Linux     /dev/sda5       199469056   226631679    13581312   82  Linux swap / Solaris      scans               pvscan       PV /dev/sda1   VG vg1   lvm2 [48.54 GiB / 556.00 MiB free]       Total: 1 [48.54 GiB] / in use: 1 [48.54 GiB] / in no VG: 0 [0   ]     vgscan       Reading all physical volumes.  This may take a while...       Found volume group "vg1" using metadata type lvm2     lvscan       inactive          '/dev/vg1/opt' [25.00 GiB] inherit       inactive          '/dev/vg1/virtualization' [23.00 GiB] inherit


Chain commands with Control + C interrupt

I am trying to execute a program which loops indefinitely, and so must be forcibly interrupted. After executing the program, I want to delete it. I can do it in several steps:   1. `./MyProg`   2. `Control` + `C`   3. `rm MyProg` but I need to do this often, so I'd like to have steps 1 and 3 on a single line for easy history recall. I have tried the following, but in each case the `Control` + `C` interrupt kills the whole line, not just the executing program, and so the file is never deleted:               ./MyProg && rm MyProg     ./MyProg;   rm MyProg     ./MyProg || rm MyProg      How can I get the interrupt to affect only the running program, and not the whole command line?


cp launched from code results in cannot stat '/tmp/somedir' works in shell

I'm working on making some scripts more elegant by implementing them in a real x application etc... At some point in the scripts we basically want to take everything from a mounted removable storage device, and copy into specified folder in a tmp work folder. When executing in the shell it works without a hitch. When executed from the code, it fails. Copy Command:               cp -avfr /tmp/mnt221234jk/* /tmp/mnt23255/disk1/      and the error I get from native app is:               cp: cannot stat: '/tmp/mnt221234jk/*' file not found.      The strange part is that it is absolutely there, has appropriate permissions for the user running the app etc. I can both `stat /tmp/mnt221234jk/*` and run the cp command from the shell and both work just fine. In addition to this, if I omit the `/*` from the file copy origin, it works, but creates a new folder in the destination with name `mnt221234jk` which is not what I am looking for. A couple of side notes: my code to execute shell commands absolutely works, and works well. But there very well may be something funky about needing work paths or something like that. Does failing to stat based on file not existing error ring any bells with anyone? I'd be willing to attempt to achieve this differently if there are alternative shell commands to effectively copy a file structure recursively with permissions etc.


Unable to login to linux machine

I can't login to my linux machine. It's giving me the following error:               /usr/libexec/gconf-sanity-check-2 exited with status 256       I removed all the files in the `/tmp` directory after this issue happened. What is the cause of this error?


Linux Mint: drives' map changing at reboot brings fstab error

I've set up fstab to auto mount media drives on a Linux Mint machine.   The OS is installed on a IDE/ATA Disk while 3 SATA disks hold data to share.   The BIOS has the ATA disk as first boot device.   All SATA drives are NTFS non bootable with a single partition. When I installed the OS:   The ATA disk was seen as sda and the other drives as sdb, sdc and sdd. The problem is that every so often when I reboot, the drives are changing: sda becomes sdd, sdb becomes sda, etc... It doesn't seem to affect the OS, but obviously my fstab config sends errors. All the drives seem fine, and none of them is ever missing. So, question: can I force to map the drives with fixed path? I tried using Labels but it didn't seem to work. Also, I don't know if it is abnormal and/or relevant but my ATA drive has four partitions:   - sda1 => OS   - sda2 => Empty EX4 partition, maybe concurrent OS in the future   - sda4 => Extended partition   - sda5 => Swap   - sdb4 => SATA HDD 1   - sdc1 => SATA HDD 2   - sdd1 => SATA HDD 3  Isn't there something weird? I'd have thought I would get sda1 to 4, then sdb1, sdc1, and sdd1. Thanks for your help!


How can I find a Ubuntu package to use with Amazon EC2?

I'm looking to set up a new server on Amazon's EC2 and I wanted to use Ubuntu 11.04 is it is fairly new but not too new. I previously used 10.10 which I think is also very stable and time-tested. My problem is that when I run `ec2-describe-images -o amazon` (get images owned by amazon) none of these are Ubuntu. If I run `ec2-describe-images -a` (get all images) there are about 12k images. **Questions**   1. Is there a reason Amazon doesn't have ubuntu images available?   2. If you were running ubuntu on a production system, would you choose 11.04? If not, what version would you choose and why?   3. How do I select a good ubuntu image from the list? With 12k images how do you vet them? Is a particular one endorsed or created by Ubuntu?


Why do I immediately get a "Permission Denied" error on login, even with root?

I have a weird problem on my notebook. When I want to login to the system (for example on tty1), immediately after I put in my username I get a `Permission Denied` error, even with root! I booted a liveCD and checked `/etc/{passwd,shadow}`, but both are accessible by root and the users are still in there. What could be the problem? How do I fix it?


SIP Server Installation in Linux

CLick Here for Kamailio Sip proxy server installation page I am not able to get Prerequisites , where to download these files ? even if i get how to install the kamailio server where i getting some Errors like below :   if i type"make all" It gives Error : ![make all error ](http://i.stack.imgur.com/AeC3e.png)   if i type "make Q=0 all" it gives error : ![make Q=0 all error](http://i.stack.imgur.com/Lgfir.png) Can anyone help me to fix the error n make my kamailio install proper . Thanks in advance :) Answered People will get Appreciation for sure .:)


rsync time comparison - what's the precision of the Modified times comparison

I'm doing some synching with rsync using:               rsync --rLvv --times --size-only       For my initial sync. My idea, now is to use:               rsync --rLvv --times      To synch files that have a new modified time. My problem is that after the initial rsync, I see the following Modified times on the files that have been synced:               remote$ stat 6080_04_big.mp4       File: `6080_04_big.mp4'       Size: 258788267       Blocks: 505448     IO Block: 4096   regular file     Device: 903h/2307d      Inode: 862897      Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 2000/ht)   Gid: ( 2000/    cust)     Access: 2010-08-13 10:46:20.000000000 -0700     Modify: 2010-08-12 17:55:08.000000000 -0700     Change: 2010-08-13 10:46:20.205721673 -0700                    local$ stat 6080_04_big.mp4       File: `6080_04_big.mp4'       Size: 258788267       Blocks: 505448     IO Block: 4096   regular file     Device: 902h/2306d      Inode: 136015      Links: 1     Access: (0664/-rw-rw-r--)  Uid: (  506/   admin)   Gid: (  506/   admin)     Access: 2010-08-12 20:55:01.482104000 -0400     Modify: 2010-08-12 20:55:08.468122000 -0400     Change: 2010-08-12 21:15:06.952810711 -0400      The modify time is 'effectively' the same, but only down to the second. What's the resolution of the comparison here? It seems that anything that is the same up to the second is considered the same, but I can't find any docs specifying this. Anyone know off the top of their heads?


What is the most high-performance Linux filesystem for storing a lot of small files (HDD, not SSD)?

I have a directory tree that contains many small files, and a small number of larger files. The average size of a file is about 1 kilobyte. There are 210158 files and directories in the tree (this number was obtained by running `find | wc -l`). A small percentage of files gets added/deleted/rewritten several times per week. This applies to the small files, as well as to the (small number of) larger files. The filesystems that I tried (ext4, btrfs) have some problems with positioning of files on disk. Over a longer span of time, the physical positions of files on the disk (rotating media, not solid state disk) are becoming more randomly distributed. The negative consequence of this random distribution is that the filesystem is getting slower (such as: 4 times slower than a fresh filesystem). Is there a Linux filesystem (or a method of filesystem maintenance) that does not suffer from this performance degradation and is able to maintain a stable performance profile on a rotating media? The filesystem may run on Fuse, but it needs to be reliable.


How do SO (shared object) numbers work?

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:   * `example.so.1`   * `example.so.2` I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that `example.so` is in fact a symbolic link to `example.so.2` where `.2` is the latest version. How then does an application depending on an older version of `example.so` identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source? I suspect this is related to `ldconfig` but I'm not sure how.


How to view recently submitted bugs in Debian bugtracker

I run Debian testing and occasionally notice hiccups in my system. I'd like to be able to see if someone has reported a related bug, but don't always know what package names to look for. Or, before running a dist-upgrade I might just want to see if there has been a spike in bug reports in the last few days just to see if something major has recently broken. Is there some way to just have the Debian Bug Report website spit back a list of bugs, sorted by submission date? Almost all the documentation for the Debian bugracker is about how to submit a bug report. Just submitting a bug report request that's blank other than ordered by age doesn't work, nor does a report request that's blank except for "recent bugs." Using * for the package name doesn't work.


cygwin awk output to windows line delimeters

I could find the way to print zip entries' list and forward to a txt file.               unzip -l my.zip | awk '{print $4}' > my.txt      When I open the file `my.txt` in windows' notepad the line delimiters ignored and all lines renders in a single line. How can I make those piped lines to have appropriate line delimiters?


When were the first graphical app installers created for Linux distributions

Having a discussion at work with a colleague, and he is claiming graphical installers for *nix environments have only been available for the last few years, but I can't find any solid information on the topic, so I thought I'd ask. References would be appreciated, but recalling from memory will do for any of you who have been using Linux for years. Update : Apologies, not installers for Linux, but installers for apps inside of Linux.


Unix on a DEC VAX?

I just picked up a DEC VaxStation 4000 model 90 with a built in CDROM and an auxiliary SCSI storage module with tape archive drive. I believe it is functional although I cannot test it yet since I still do not have a working terminal or monitor. I can get a VT-520 terminal and keyboard and will also try to resurrect a separate now defunct Radius monitor with the BNC connectors and I believe the ability to sync on green (somebody unfortunately tried to convert that monitor to a standard VGA connection and butchered it in the process). I am fairly comfortable with Linux and have played around a little with FreeBSD and Solaris in the past. I have never used VMS in the past. This is the first time I am working with a VAX computer. I have a few questions: Which Unix version to install on the VAX? Original UC Berkeley BSD Unix? OpenBSD? NetBSD? Ultrix if I can get a legal copy? AT&T Unix? For emotional reasons I may prefer to install some version of the original UC Berkeley BSD (1980s Bill Joy/Marshall Kirk McKusick Era), but will go with whichever is easier to install, the machine is newer (production started 1991) than the original BSD Unix versions. I would call it nostalgia except I never did use the original BSD Unix! Another consideration would be some version of AT&T Unix if it will run. Is there a version of FreeBSD for the VAX? If there is a functional VMS install on the machine's 4 hard drives (2 each in the machine and the auxilliary SCSI storage module), is there a way to dual boot between Unix and VMS? I presume that I can get some version of Emacs running on this system, it does not have to be recent. While Vi may be more historically correct on this machine I much prefer Emacs. Any suggestions or ideas? My cell phone probably has significantly more computing power and far more memory and storage than this "minicomputer", I am approaching this as a hobbyist. I hope to use the system to explore BSD Unix (and possibly AT&T Unix) further and do some C programming on it. I anticipate to be working purely from the command line. I may explore VMS also at some point.


How to route network in order to use internet on CentOs?

I have 2 computer in local network which have CentOS both. One has wireless card which can use internet connection. Other computer does not have internet connection. I want to route ip addresses in order to connect internet with other computer too. Here is what I tried.               Pc :     eth0     Ip address : 22.150.16.100     Netmask : 255.255.255.0          Laptop :     eth0     Ip address : 22.150.16.200     Netmask : 255.255.255.0          wlan0      Ip address : 192.168.2.88     netmask : 255.255.255.0      With this network connection I typed in PC :               route add default gw 22.150.16.200      and also ip_forwarding is enable in Laptop. However when I ping google with PC it says unknown host. I think I missed something which I do not know how to solve it.. Could you plase help me ?


How to have find recurse into subdirectories when using -prune option

I see that the `find` command does **not** descend into subdirectories when you're using the `-prune` option. How do I tell find to recurse into the sub directories, but also ignore some stuff? Specifically, I want to search the `/var/lib/foo` directory, but exclude any directories with the name `.snapshot/`.               sudo find /var/lib/foo -prune -name '.snapshot'      With the above, it properly ignores .snapshot, but doesn't go into the sub dirs. FYI, I'm working in bash on a CentOS 6.3 host.


How to diagnose a problem using a core dump?

I have the following core dump:               pth_signal.pthread_kill(??, ??) at 0xd0124734     pth_signal._p_raise(??) at 0xd01241a4     raise.raise(??) at 0xd038acd0     abort.abort() at 0xd03eeb78     _ZN10__cxxabiv111__terminateEPFvvE(handler = ??), line 47 in "eh_terminate.cc"     _ZSt9terminatev(), line 57 in "eh_terminate.cc"     __cxa_throw(obj = ??, tinfo = ??, dest = ??), line 77 in "eh_throw.cc"     unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"     unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"     unnamed block in _Znwm(sz = 4048060128), line 54 in "new_op.cc"     _Znwm(sz = 4048060128), line 54 in "new_op.cc"     _Znam(sz = ??), line 36 in "new_opv.cc"     _ZN7PROFILEC1ERK6STRING(this = @0x2fe74398, iniFilename = @0x21973300), line 99 in "profile.cpp"     _ZN2IE17AppendToBDataListEP10BASKETDATA(this = @0x2130eb38, bd = 0x2fe7f000), line 2451 in "ie.cpp"     _ZN5DIEGO14HandleResponseEP10BASKETDATAPv(this = 0x2130eb38, bd = 0x2fe7f000, args = 0x2fe71d78), line 513 in "diegoclass.cpp"     _ZThn68_N5DIEGO14HandleResponseEP10BASKETDATAPv(0x2130eb7c, 0x2fe7f000, 0x2fe71d78), line 21 in "diegoclass.h"     _ZN8KOBJBASE8dispatchEiP10BASKETDATAPv(this = 0x2130eb7c, fcnidx = 12, bd = 0x2fe7f000, args = 0x2fe71d78), line 67 in "kobjbase.cpp"     _ZN6KERNEL8DispatchEPcS0_iP10BASKETDATAPvR4LISTI8KOBJBASEE(this = @0x2fe71d38, module = "diego", method = "HandleResponse", fcn_idx = 12, bd = 0x2fe7f000, args = 0x2fe71d78, thread_objects = @0xf156dd58), line 1118 in "skernel.cpp"     unnamed block in _ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"     unnamed block in _ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"     _ZN6KERNEL9ExecuteTXEP10BASKETDATA(this = @0x2fe71d38, bd = 0x2fe7f000), line 224 in "txthread.cpp"     unnamed block in _ZN6KERNEL22ProcessEnqueuedBasketsEP6BASKET(this = @0x2fe71d38, b = @0x2fe7ef68), line 1162 in "skernel.cpp"      How can I use the core dump to fix the crash I'm having?


Indent the middle of multiple lines

I often run into situations like this:               title : Jekyll Bootstrap     tagline: Site Tagline     author :       name : Name Lastname       email : blah@email.test       github : username       twitter : username       feedburner : feedname      Where the arguments are not lined up well, is there a standard way in `vim` for to have it formatted with each of the according arguments aligned to the nearest indent where an indent is defined as 2 spaces without having to go through line by line to the, such as in the following:               title   : Jekyll Bootstrap     tagline : Site Tagline     author  :       name      : Name Lastname       email     : blah@email.test       github    : username       twitter   : username       feedburner: feedname      **UPDATE:** I believe tabular.vim is the plugin I am looking for but I am having a difficult time forming a regular expression which would take into account the number of spaces at the beginning of the line when deciding something should be part of a block, i.e. `Tabularize/:` produces:               title       : Jekyll Bootstrap     tagline     : Site Tagline     author      :       name      : Name Lastname       email     : blah@email.test       github    : username       twitter   : username       feedburner: feedname      The is an example in the documentation where the following is achieved via a regular expression:               abc,def,ghi     a,b     a,b,c      :Tabularize /^[^,]*\zs,/r0c0l0               abc,def,ghi       a,b       a,b,c      But I am unsure how to formulate this when consider each line with the same number of spaces in front part of the same block while still evaluating subblock such as in the following more complex than my original example:               comments :       provider : disqus       disqus :         short_name : jekyllbootstrap       livefyre :         site_id : 123       intensedebate :         account : 123abc       facebook :         appid : 123         num_posts : 5         width : 580         colorscheme : light      would be transformed `tabularize\some_regular_expression_I_cant_figure_out` to:               comments :       provider      : disqus       disqus        :         short_name    : jekyllbootstrap       livefyre      :         site_id       : 123       intensedebate :         account       : 123abc       facebook      :         appid         : 123         num_posts     : 5         width         : 580         colorscheme   : light


Cannot find config option "CONFIG_CRASH_DUMP" for kdump

I'm studying on kdump which is a linux kernel crash dumping mechansim. According to `documentation/kdump/kdump.txt` under the kernel source tree, I need to set the kernel config option `CONFIG_CRASH_DUMP=y`. > Dump-capture kernel config options (Arch Independent)   >  1) Enable "kernel crash dumps" support under "Processor type and features":   >  CONFIG_CRASH_DUMP=y But after `make menuconfig`, I cannot find "kernel crash dumps" as said, and cannot find `CONFIG_CRASH_DUMP` by searching file `.config`, why? More info may be helpful:   - I'm using SLES11.   - Arch is X86_64   - The .config file is initially from /proc/config.gz.   - Find a option looks similar: `CONFIG_CRASHER=m`


Why is zone.tab missing so many time zones?

There are over a thousand time zone files on your typical *nix box (in /user/share/zoneinfo). Many of them vary only in historical dates which have little relevance for programs which care only about recent dates - or even only about the current time. But regardless, there _are_ a ton of them, and it's perfectly legal to select any of them as the time zone for your system as well as to use any of them for a specific program or shell by setting the TZ environment variable. They're all valid. And then there's the zone.tab file (/usr/share/zoneinfo/zone.tab). It lists only a bit over 400 time zones (414 on my system). It's missing a _lot_ of time zones. So, the question is why? Why aren't they all in there? And since they aren't all in there, how is it decided which ones get put in there? zone.tab does include a country code and as well as longitude and latitude for each time zone that it lists (which presumably is the reason for the file's existence), and not _all_ time zones really have those (e.g. UTC doesn't have those, and it's not in zone.tab), so clearly, not _every_ time zone can be listed in zone.tab. But why aren't all of the ones which correspond to an actual city or region (as most of them do) listed in the file? Why only 414 instead of the 1000+ which are actually available?


Cannot access ubuntu server from other machines other than the machine which is hosting the virtual machine which is my ubuntu server

I created a ubuntu server on vmware. I am using it as a file server. I can access it if I am connecting through the machine which hosts the virtual machine. I am not able to do it from other machines which are on the same network. Thanks in advance!


Is it a bad idea to use an SD card for home directory?

I'm planning to make an SD card (or a flash drive) my home directory so as to be able to work on different PCs without much hassle. Is this a bad idea for some reason?


Why escape trivial characters in shell script?

I just opened a legacy shell script (written in old ksh88 on Solaris) and found the following repeated all throughout the code:               [ -f $myfile ] && \rm -f $myfile      The escaping backslash strikes me as odd. I know it is deliberate, since this kind of (apparently useless) escaping is repeated all throughout the code. The original author is long gone, I cannot get in touch with him to ask him. Is this simply a funny idiosyncrasy of the author or is it some sort of deprecated good practice that made sense at some point in time? Or maybe is actually the recommended way of doing things and I'm missing something altogether?


how to find out wich chain in iptables in listing

Suppose I have the following two entries line of iptables:               iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE     iptables -A INPUT -s 192.168.1.0/24 -j DROP      So, I have `POSTROUTING` and `INPUT` chains. Then i can get the result list with:               iptables -L  -t nat -n --line-numbers -t filter      My result is:               Chain INPUT (policy ACCEPT)     num  target     prot opt source               destination              1    DROP       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:70     2    DROP       all  --  10.10.10.0/24        0.0.0.0/0                 **My quesion is** , how can I find out which rule belong to `POSTROUTING` and wich belong to `INPUT` ?


bash script to detect and record mouse movements?

I need to be able to record the mouse movements every so often (every .2 of a second for example) and have them in a coordinate representation instead of a diff. I found the following script:               #!/bin/bash     while :     do     cat /dev/input/mice | read -n 1     date     sleep 1     done      But it doesn't seem to print anything to the terminal (or perhaps it's all gibberish). Other discussions suggest that /dev/input/mice is deprecated. On top of that, /dev/input/mice wouldn't actually have the data in a friendly format. Am I going to have to do the conversion manually (from the format in the /dev/input files), or is there an API for this?


How to add a new line after the "test message1" using sed?

Actually I have a file called `test1.txt`. In that file I have the following five lines:                'test message1'      'test message2'      'test message3'      'test message4'      'test message5'      Now I want to add a new line `'testing testing'` into `test1.txt` file, after the `'test message1'` line. How to do that?


problem exporting /media as an nfs share: why does it happen?

I've got two netbooks. One netbook has two installed Linux systems: openSUSE 11.04 and Debian testing. By default, in Debian, gnome mounts the `/home` filesystem for openSUSE, which shows up in gnome's 'places,' in `/media` as               /media/f9309491-1893-47da-b473-021fa2989fcf/      with read only permissions for users. When I share /media via NFS, I can't access anything.               me@ROOROO:~/$ cd /mnt/network2/f9309491-1893-47da-b473-021fa2989fcf/     bash: cd: /mnt/network2/f9309491-1893-47da-b473-021fa2989fcf/: Permission denied      Obviously the best idea here is to mount and share the partition (`mount /dev/sda3 /mnt/foldername`) directly by exporting `/mnt/foldername/` in `/etc/exports`, without using gnome. But I want to know why I couldn't just export `/media` in the first place, because I like knowing how stuff works.


how to plot multiple graphs in one plot?

I want a plotting script that will plot multiple graphs on the same plot where the values of my data have the same `x` coordinate. This will help me the differences of each variable in the plot. I tried to plot using spreadsheet, but the plots are not clearly identifiable each other. I want you help me with the script to do my plot. My data looks like:               x y1 y2 y3 y4           1 10 25 28 30      2 20 15 40 20      3 10 10 30 20      4 2 5 15 30         . . . .


How to migrate from CentOS to RHEL?

What packages do I need to install to migrate my CentOS 5.7 server to identical version of RHEL. I have RHN subscription but I don't want to create a fresh install and move files.


search text on the terminal output

I am running an application with command `$ grails run-app` which prints log in terminal like below. ![search_text_terminal](http://i.stack.imgur.com/sPXDQ.png) What I want is search a particular text (say `user authorities`) in this log so that I can verify further. One way using Logging Apis to write in text file but I want to search it in a terminal at the moment. I found similar question at how to make search a text on the terminal directly which suggests `screen` command, but I have no idea how `screen` works in this case. I tried `$ screen grails run-app` but couldn't move ahead. I can see screen lists with               prayag@prayag:~/zlab/nioc2egdelonk$ screen -list     There is a screen on:         8076.pts-2.prayag   (10/06/2013 12:13:25 PM)    (Attached)     1 Socket in /var/run/screen/S-prayag.


XForwarding not loading correct $PATH

I tried to XForward netbeans to my laptop, using the following code:               # This does not work     $ ssh user@10.0.0.5 -Y netbeans     which: no javac in (/usr/bin:/bin:/usr/sbin:/sbin)     which: no java in (/usr/bin:/bin:/usr/sbin:/sbin)     Cannot find java. Please use the --jdkhome switch.      That did not work, but this did:               # This works     $ ssh user@10.0.0.5 -Y     user@home $ netbeans      My questions:   * Why does the first method fail?   * How can I make the first method work?


Keyboard macros for X and/or KDE

I'm looking for a utility to record and playback keyboard macros in X applications (KDE specifically). I've tried `xmacrorec` and `xmacroplay`, but after running them, my mouse and keyboard does not respond properly _(i.e. the left mouse button gets stuck in a "clicked" state)_ and I have to restart X. Are the any modern alternatives that work under **KDE 4.5** and **openSUSE 11.3**?


How to get the mouse pointer where the input caret is?

I am running an Arch Linux system with `i3` window manager. Let's say I am typing on a GUI editor and I want to insert text with the middle click button of the mouse exactly where I am typing. The idea is after pressing the keybinding the pointer will be place at the input caret and then I can just click the middle button to paste the text. I know that `xdotool` can get the coordinates of the pointer (mouse), but what I want is to **get the coordinates of the text input caret** , so then I can use `xdotool` to put that same coordinates for the mouse pointer.


How do I use custom-signed shim for secure boot (Fedora)?

I'm not sure whether there's a guide for this but I'd like to know the detailed steps (step-by-step guide perhaps?) involved in achieving the following:   1. Re-sign shim with a custom CA private key, but still let shim to use Fedora boot CA public key to verify the kernel components for Secure Boot.   2. Replace Microsoft's key stored in the firmware with the corresponding custom CA public key whose private key was used to sign shim. The main goal that I want to achieve is to replace the built-in Microsoft's CA certificate stored in the firmware, in order to forbid Microsoft-signed OS bootloaders from being executed, and still use the UEFI's secure boot functionality to boot up F19. The general overview seems to be outlined in this link, but I'm not able to find any detailed guide to do this.


Is there a good combination of command-line and graphical file browser?

Is there a feasible solution than combines the advantages of a command-line and a graphical file browser? For example, the command-line is good to change the directory and execute commands but can't show thumbnails and the file browser is intuitive, gives a good overview on where you are in the tree but you can't "talk" to the computer like in a command-line. EDIT: for me, as a command-line user, its more like needing a command-line with additional file-browser capabilities than having a file browser with some command-line features.


How to make difference between .wxm (wxMaxima) and .c files in Linux Mint?

I installed `wxMaxima` on my laptop a few days ago. The issue is that files with the extension `.wxm`, that are used with `wxMaxima`, are identified as a C source files. Therefore, when I double click on such a file, it opens my text editor. I tried right clicking on a `.wxm` file, and changing the default program -- but that also changed the default program for `.c` extensions -- something I don't want to happen. The bottom line: how do I define `.wxm` extension to be of a different type than `.c` extensions?


Is it possible to execute the result of wget as a command?

I have 10 VPS machines and all of them have to run this one script that I need to change often, but I don't want to change it at 10 places, every time I need to make a change. I put the script as a plain text file on a remote HTTP server. If I could `wget` this file and run the contents, that would be great. But I'm not sure how to do it, or if there are alternative ways to achieve my goal?


Why read() is slower than getc()?

Why is `read` slower than `getc`? For example, this:               for (;;) {             chr++;             amr=read(file1, &wc1, 1);             amr2=read(file2, &wc2, 1);             if (wc1 == wc2) {                 if (wc1 == '\n')                     line++;                 if (amr == 0) {                     if (eflg)                         return (1);                     return (0);                 }                 continue;             }      is slower than that:               for (;;) {         chr++;         c1 = getc(file1);         c2 = getc(file2);         if (c1 == c2) {             if (c1 == '\n')                 line++;             if (c1 == EOF) {                 if (eflg)                     return (1);                 return (0);             }             continue;         }      `getc` uses the `read` system call, so why is it slower?


Increasing conky height

Is there any way to change the height of a conky window? ### .conkyrc               background no     update_interval 1          cpu_avg_samples 2     net_avg_samples 2          override_utf8_locale yes          double_buffer yes     no_buffers yes          text_buffer_size 2048     #imlib_cache_size 0          # Window specifications #          own_window_class Conky     own_window yes     own_window_type desktop     own_window_transparent yes     own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager     own_window_argb_visual yes          border_inner_margin 0     border_outer_margin 0          minimum_size 200 200     maximum_width 200          alignment tr     gap_x 0     gap_y 25          # Graphics settings #     draw_shades no     draw_outline no     draw_borders no     draw_graph_borders no          # Text settings #     use_xft yes     xftfont Ubuntu:size=8     xftalpha 0.5          uppercase no     temperature_unit celsius     default_color FFFFFF          # Lua Load  #     lua_load ~/.conky/draw_bg.lua     lua_draw_hook_pre draw_bg          lua_load ~/.conky/clock_rings.lua     lua_draw_hook_post clock_rings          TEXT     ${voffset 8}${goto 25}${color FFFFFF}${font Ubuntu:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %e}${font}     ${color FFFFFF}${goto 25}${voffset -30}${color FFFFFF}${font Ubuntu:size=18}${time %b}${goto 75}${font Ubuntu:size=20}${time %Y}${font}${color 0B8904}     ${voffset 150}${font Ubuntu:size=10}${font}     ${font Ubuntu:size=12}${color FFFFFF}${alignr}${font}     ${voffset -20}${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %H}${font}     ${alignr 50}${color FFFFFF}${font Ubuntu:size=38}${time %M}${font}          ${voffset -95}     ${color FFFFFF}${goto 23}${voffset 48}${cpu cpu0}%     ${color 0B8904}${goto 23}CPU     ${color FFFFFF}${goto 48}${voffset 23}${memperc}%     ${color 0B8904}${goto 48}RAM     ${color FFFFFF}${goto 73}${voffset 23}${swapperc}%     ${color 0B8904}${goto 73}Swap     ${color FFFFFF}${goto 98}${voffset 23}${fs_used_perc /}%     ${color 0B8904}${goto 98}Disk     ${color FFFFFF}${voffset 25}${alignr 62}${downspeed eth1}${goto 135}D     ${color FFFFFF}${alignr 62}${upspeed eth1}${goto 135}U      ${color 0B8904}${goto 123}Net          ${color FFFFFF}${font Ubuntu:size=8}${goto 55}Uptime: ${goto 100}${uptime_short}     ${color FFFFFF}${font Ubuntu:size=8}${goto 42}Processes: ${goto 100}${processes}     ${color FFFFFF}${font Ubuntu:size=8}${goto 50}Running: ${goto 100}${running_processes}}      ### draw_bg lua script               -- Change these settings to affect your background.     -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.          corner_r=0          -- Set the colour and transparency (alpha) of your background.          bg_colour=0x000000     bg_alpha=.8          require 'cairo'     function rgb_to_r_g_b(colour,alpha)         return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha     end          function conky_draw_bg()         if conky_window==nil then return end         local w=conky_window.width         local h=conky_window.height         local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)         cr=cairo_create(cs)              cairo_move_to(cr,corner_r,0)         cairo_line_to(cr,w-corner_r,0)         cairo_curve_to(cr,w,0,w,0,w,corner_r)         cairo_line_to(cr,w,h-corner_r)         cairo_curve_to(cr,w,h,w,h,w-corner_r,h)         cairo_line_to(cr,corner_r,h)         cairo_curve_to(cr,0,h,0,h,0,h-corner_r)         cairo_line_to(cr,0,corner_r)         cairo_curve_to(cr,0,0,0,0,corner_r,0)         cairo_close_path(cr)              cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha))         cairo_fill(cr)     end      ### Screenshot of setup                                          ![Screenshot](http://i.stack.imgur.com/J4Htg.png) ### Question I want to increase the background(drawn by the lua script using `conky_window.height`) to occupy the entire screen height. ### Tried   * Changing `minimum_size` has no effect   * Adding lines at the botto has no effect, see http://imgur.com/KJ5uVD3 ### Fix Turns out that `conky_window.height` used by the lua script is preserved between conky restarts. Logging out and back in resolves this issue. Changing `minimum_size` works.


use `/run/shm` (formerly `/dev/shm`) as a temp directory

Is it good practice to create a directory in `/run/shm` (formerly `/dev/shm`) and use that like a temp directory for an application? Background: I am writing black box tests for a program which does a lot of stuff with files and directories. For every test I create a lot of files and directories and then run the program and then create the expected set of files and directories and then run diff to compare. I now have about 40 tests and they are already taking over 2 seconds to run. Hoping to speed things up I want to run the tests in a directory on some sort of ramdisk. Researching about ram disk I stumbled upon a question with an answer stating that it is okay to create a directory in `/dev/shm` and use that like a temp directory. Researching some more however I stumbled upon a wiki page from debian stating that it is an error to use `/dev/shm` directly. I should use the `shm_*` functions. Unfortunately the `shm_*` functions seem to be not available for use in a shell script. Now I am confused. Is it okay or not to use `/run/shm` (formerly `/dev/shm`) like a temp directory?


How to purge dbus configuration?

I get some various errors at boot from dbus in my logs:               Rejected send message, 2 matched rules; type="method_call" ...      I've been running this Debian sid system (systemd init) for years, so I suspect a bad mix of configuration. Usually this type of problems can be fixed with               apt-get purge package     apt-get install package      But dbus being a low-level dependency it would remove pretty much all my packages. `/etc/dbus-1/system.d` has quite some files in it, I'm not sure if erasing them is a good idea. How can I proceed ?


Redirect all standard out for rest of script

I have a bash script that I want to redirect all the rest of the output into a file.               #!/bin/bash     # the part i dont know  ${file}     echo spo      echo car          cat ${file}      output should be spo\ncar\n


How to install Ruby Test to Sublime Text 2

I am quite new to Ubuntu, so I am running into some problems. I was following this tutorial to install Ruby Tests for Sublime Text 2: https://github.com/maltize/sublime-text-2-ruby-tests There is one point: > Make a copy of RubyTest.sublime-settings file to ~/Library/Application > Support/Sublime Text 2/Packages/User/ and make your changes. But when I try to copy, I get error that there is no such folder. Can anyone help me?


Listing users and usergroups in Raspbian

It surprised me no search has led me to a such simple question like this one. All I want is to get a list of users and usergroups (whatever the second thing actually is). I've found many text about how user accounts are being created or removed, but it sounds like everyone remembered all the accounts on their system by heart. I guess it's not that way. So how do I list them, their permissions and how do I list groups?


Updating openssl on debian squeeze

Can I replace my openssl 0.9.8o-4squeeze16 package with http://ftp.de.debian.org/debian/pool/main/o/openssl/openssl_1.0.1h-3_amd64.deb without any problems/concers? I did a `apt-get update` but I did not get a higher version than 0.9.8o-4squeeze16. Is there anything I should think about before installing it with `apt-get install openssl_1.0.1h-3_amd64.deb` ?


How to terminate a shell script?

I'm working on a supercomputer and have a shell script that will automatically schedule a bunch of jobs for me. Once the script is run, I can terminate manually with `Ctrl`+`C`. I was running the script from a unix `screen` session and terminated the `screen`, but the script is somehow still running and submitting jobs. It seems to be stuck in a loop and not ending, thus consuming precious core-hours. I tried `ps -u [user]` but it doesn't show up. I know for a fact that it's still running in the background and just need to kill it. Edit: `uname -a` gives the following result:               Linux blogin3 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux      So I guess the supercomputer is running Linux.


File permission with setuid and octal 4000

When we set `setuid` to a file, we do the following in the terminal:               chmod u+s filename      This works fine. But the octal number 4000 is always associated with setuid (in books etc). I understand (to some good extent) file permissions, the concept of umask, setuid and using octal numbers with `chmod`. But I still cannot figure out the relationship between the octal number 4000 and setuid. Please explain.


Is there a more succinct alternative to piping to wc for counting files in a directory

If I do `ls -1 target_dir | wc -l`, I get a count of files in a directory. I find this a bit cumbersome. Is there a more elegant or succinct way?


Installing afpfs-ng from source

I want to install afpfs-ng to get access to an AFP share from my Mac. I am running Debian and am following instructions from http://unix.stackexchange.com/a/175/17242, and I get               checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for a thread-safe mkdir -p... /bin/mkdir -p     checking for gawk... no     checking for mawk... mawk     checking whether make sets $(MAKE)... no     checking for gcc... no     checking for cc... no     checking for cl.exe... no     configure: error: no acceptable C compiler found in $PATH     See `config.log' for more details.      Does it mean there were some issues during installation? Are there any better ways of enabling AFP access on Linux?


Installation Error: Kernel Panic - not syncing

I have a machine with the following spec: CPU: Intel i7-2600S 2nd Gen Core 2.8GHz Low Voltage CPU 65W TDP RAM: 8GB DDR3 - 2 of these so I got 16GB of RAM. I want to install a Linux distribution and use the machine as a server. I tried Ubuntu (both desktop 32) and I get the following error: Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown um- block(8,1)


Black screen when installing Fedora 16

I have read many other threads here and elsewhere but found no solution... I'm trying to install Fedora 16 x86-64. At random points during installation I get black screens that do not go away. I have tried adding `nomodeset` to the kernel options (by far the most common answer to this kind of problems) but it didn't help. I also tried it with combination of `xdriver=vesa`, still with no success. I also tried `acpi=off`, `noapic`, `nolapic` and `noapictimer` combined with and without `nomodeset` with no success. Any suggestions? Btw, my machine has an Intel i7-950 CPU, 12 GB RAM, Gigabyte X58A-UD3R motherboard, an ATI 5870 graphics card (Gigabyte GV-R587UD-1GD Bios F8) and a couple of SATA hard drives.