In ~/.vimrc find line like
set mouse=aand change it to
set mouse=r
That's it!
set mouse=aand change it to
set mouse=r
$ cd /tmp && wget 'http://sourceforge.net/projects/nethogs/files/nethogs/0.7/nethogs-0.7.0.tar.gz/download' $ tar -xzvf nethogs-0.7.0.tar.gz
$ cd nethogs $ makeYou may try running
$ sudo checkinstall -Rbut if you are at openSUSE box as me, you'd probably get error that says you didn't specify filename in
sbin := $(DESTDIR)/sbin2) append the folliwing line after that:
bin := $(DESTDIR)/bin
$ sudo checkinstall -Rand follow checkinstall instuctions. Everything should be OK now.
UPDATE
You might have to install checkinstall:
$ sudo zipper in checkinstall
$ sudo zypper in checkinstall
$ ./configure && make ###################################################################### # or # qmake # or whatever appopriate before doing make install. ###################################################################### $ sudo /usr/sbin/checkinstall ###################################################################### # ... checkinstall advices some settings ###################################################################### $ rpm -i /path/to/generated/rpmNow let's build an RPM for KeePassX password manager:
$ cd /tmp $ mkdir keepasx $ cd keepasx $ svn co https://keepassx.svn.sourceforge.net/svnroot/keepassx/trunk $ cd trunk $ qmake ###################################################################### # To install qmake: # $ sudo zypper in libqt4-devel ###################################################################### $ sudo /usr/sbin/checkinstall ###################################################################### # Now I had some problems with uncreated directories... Had to issue: # $ sudo mkdir /usr/share/keepassx /usr/share/mimelnk # and repeat # $ sudo /usr/sbin/checkinstall ######################################################################
$ /usr/src/packages/RPMS/x86_64/keepassx-0.4.3-1.x86_64.rpmSo may now install the RPM normally:
$ sudo rpm -i /usr/src/packages/RPMS/x86_64/keepassx-0.4.3-1.x86_64.rpm
$ echo $TERMNow in ~/.bashrc find lines like
screen-bce
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm*) color_prompt=yes;;
and append the following line there:
screen*) color_prompt=yes;;
Then find lines like:
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
and change them to:
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*|screen*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# ~/.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
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
#export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
export HISTSIZE=1000
export HISTFILESIZE=3000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# 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_prompt=yes;;
screen*) 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 && "$USER" = root ]]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w\[\033[00m\] \$ '
elif [[ "$color_prompt" = yes ]]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[00;33m\]\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*|screen*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# Alias definitions.
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 [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
export EDITOR='vim'
export GREP_COLOR=';33'
#export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/sbin
SHELL=/bin/bash PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin @hourly /share/scripts/bash/change_wallpaper.sh
#!/bin/bash -
# Get the pid of nautilus
nautilus_pid=$(pgrep -u $LOGNAME -n nautilus)
# If nautilus isn't running, just exit silently
if [ -z "$nautilus_pid" ]; then
exit 0
fi
# Grab the DBUS_SESSION_BUS_ADDRESS variable from nautilus's environment
eval $(tr '\0' '\n' < /proc/$nautilus_pid/environ | grep '^DBUS_SESSION_BUS_ADDRESS=')
# Check that we actually found it
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
echo "Failed to find bus address" >&2
exit 1
fi
# export it so that child processes will inherit it
export DBUS_SESSION_BUS_ADDRESS
HOUR=$(date +%H)
PICDIR="/usr/share/backgrounds/"
#echo "HOUR: $HOUR"
#echo "PICDIR: $PICDIR"
case $HOUR in
21|22|23|00|01|02|03|04|05|06)
/usr/bin/gconftool-2 --type string --set /desktop/gnome/background/picture_filename $PICDIR"NATURE-ZenLizard.png"
;;
12|13|14|15|16|17|18|19|20)
/usr/bin/gconftool-2 --type string --set /desktop/gnome/background/picture_filename $PICDIR"Fern_by_aalex04.jpg"
;;
09|10|11)
/usr/bin/gconftool-2 --type string --set /desktop/gnome/background/picture_filename $PICDIR"Bon-Echo_wallpaper.jpg"
;;
*)
/usr/bin/gconftool-2 --type string --set /desktop/gnome/background/picture_filename $PICDIR"Ropey_Photo_by_Bob_Farrell.jpg"
;;
esac
#!/usr/bin/env php
<?php
/* htmlescape.php */
echo str_replace("\n", "<br />\n", htmlspecialchars( file_get_contents('php://stdin')));
?>
#!/usr/bin/python # htmlescape.py import cgi, sys print cgi.escape(sys.stdin.read())
$ php htmlescape.php < file.htmlor
$ python htmlescape.py < file.htmlor for executables:
$ cat file.html | htmlescape.py $ cat file.html | htmlescape.phpIt also works like that:
$ ./htmlescape.py if (a > b && c < d) func(); ^D if (a > b && c < d) func();^D is Ctrl+D shortcut.
#!/bin/bash -
# FILE: cpsvnst.sh
# USAGE: ./cpsvnst.sh source_dir destination_dir
# DESCRIPTION: Copy changed files and folders from SVN working copy to a temp. dir.
# AUTHOR: Ruslan Osmanov
# CREATED: 11/25/2010 01:37:18 PM UZT
set -o nounset # Treat unset variables as an error
# Displays the message, usage info and exits with error code 1
function my_usage()
{
msg=$1
[[ $msg ]] && echo $msg
echo "Usage:
./$0 source_dir destination_dir
source_dir Source directory
destination_dir Destination directory"
exit 1
}
# Returns dir name with trailing slash
function my_get_dirname()
{
dir=$1
if [[ ${dir:${#dir}-1:1} != '/' ]]; then
dir=$dir"/"
fi
echo $dir
}
src_dir=`my_get_dirname $1`
dst_dir=`my_get_dirname $2`
verbose=1
# Validate args
if [[ ! -d $src_dir ]]; then
usage "'$src_dir' is not a directory"
elif [[ ! -d $dst_dir ]]; then
usage "'$dst_dir' is not a directory"
fi
# Remember current dir
dir=`pwd`
cd $src_dir
# Loop through files and folders
svn st | awk '{ print $2 }' | while read F
do
if [[ $F != 'framework' ]]; then
# Create directory, if not exists
d=`dirname "$dst_dir$F"`
if [[ ! -d $d ]]; then
mkdir -p "$d"
fi
# Copy file or directory
if [[ -f $F ]]; then
[[ $verbose = 1 ]] && echo "FILE $F"
cp -f "$F" "$dst_dir$F"
elif [[ -d $F ]]; then
[[ $verbose = 1 ]] && echo "DIR $F"
[[ ! -d "$dst_dir$F" ]] && mkdir -p "$dst_dir$F"
cp -rf $F $dst_dir$F/../
fi
fi
done
# Go to the initial dir
cd $dir
I'd be glad, if it helped someone.