PDA

View Full Version : Linux tips


iceni60
May 24th, 2007, 06:10 PM
here are some nice linux tips -

Gursor Maker can import CursorXP cursor themes then export and save them in a format X can use.

http://gursormaker.sourceforge.net/
here are some cursors -
http://www.wincustomize.com/skins.aspx?libid=25

here are some useful aliases, they go in your .bashrc file which is in your home directory, you can put them at the end of the file if you want them. to run the first one run cpuu in a terminal, then it will run ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d' for you -

anything written after a # is ignored for the rest of the line. cpuu and memu below show cpu and memory usage.

# system
alias cpuu="ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'"
alias memu='ps -e -o rss=,args= | sort -b -k1,1n | pr -TW$COLUMNS'
alias pg='ps aux | grep' #requires an argument, e.g. pg opera or pg firefox

# Directory navigation aliases
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'

# interactive
alias cp='cp -vi'
alias mv='mv -vi'
alias rm='mv --target-directory=$HOME/.Trash/'

# network
alias net0='sudo lsof -i'
alias net1='watch --interval=2 "sudo netstat -ano -l -A inet"'
alias net2='watch --interval=2 "sudo netstat -tulpan"'
alias ping='ping -c 10'

# chmod commands
alias mx='chmod a+x'
alias 000='chmod 000'
alias 644='chmod 644'
alias 755='chmod 755'

alias google='lynx http://google.co.uk'

that last one is useful if your GUI is broken and you need to use the internet to help fix it. (you have to have lynx installed, it's a texted based browser.)

it would be good if someone else can add some more linux tips and tricks!

Mrkvonic
May 25th, 2007, 10:44 AM
Hello,
Have a whole sections of them in one of me articles...
But they concern drivers, compilation, system configurations etc.
Mrk

iceni60
October 16th, 2007, 04:54 PM
can someone try and convert this icon theme? it's the only one that gives an error when Gursor Maker tries to do it :(
http://aroche.wincustomize.com/skins.aspx?skinid=1921&libid=25

all you do is download the theme, Ecliz Cursors, then open Gursor Maker, click File»Import CursorXP Theme (and select the downloaded cursors)»Export X Cursor Theme, then write the name of the exported cursor theme when you select where to save it.

here's the download link for Gursor Maker, on suse i just used the rpm version - gursormaker-0.6.0-1.noarch.rpm
http://sourceforge.net/project/showfiles.php?group_id=157772

and here's the download link for the cursor theme -
http://www.wincustomize.com/download.aspx?skinid=1921&libid=25



if anyone wants more tips i can post some, i can use them for references for other linux installs!

Alphalutra1
October 17th, 2007, 11:10 AM
Just to let you know, ps aux| grep does the same thing as pgrep, except pgrep is much easier to type and remember ;)

Cheers,

Alphalutra1

GlobalForce
October 19th, 2007, 09:49 PM
Figuring this should help transitioning newcomer's - http://forums.scotsnewsletter.com/index.php?showtopic=503

GF

iceni60
November 9th, 2007, 07:11 PM
i just found these file manager scripts, i wasn't really sure how they worked until i ran them. i like them.

http://ubuntuforums.org/showthread.php?t=101859

here's the copy one
#! /bin/bash
location=`zenity --file-selection --directory --title="Select a directory"`
for arg
do
if [ -e "$location/$arg" ]; then
zenity --question --title="Conflict While Copying" --text="File $location/$arg already exists. Would you like to replace it?"
if [ "$?" = 1 ]; then
exit 1
fi
fi
cp -R "$arg" "$location" &
ORIG_SIZE=`du -bs "$arg"|awk '{print $1}'`
CP_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`

(
while [ $CP_SIZE -ne $ORIG_SIZE ]; do
expr `expr $CP_SIZE \* 100` / $ORIG_SIZE
CP_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`
done
echo 100
)| zenity --progress --auto-close --text "Copying \"$arg\"..."

done
here's the move one. i changed it so it works the same as the copy one, are there any mistakes??
#! /bin/bash
location=`zenity --file-selection --directory --title="Select a directory"`
for arg
do
if [ -e "$location/$arg" ]; then
zenity --question --title="Conflict While Moving" --text="File $location/$arg already exists. Would you like to replace it?"
if [ "$?" = 1 ]; then
exit 1
fi
fi
mv "$arg" "$location" &
ORIG_SIZE=`du -bs "$arg"|awk '{print $1}'`
MV_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`

(
while [ $MV_SIZE -ne $ORIG_SIZE ]; do
expr `expr $MV_SIZE \* 100` / $ORIG_SIZE
MV_SIZE=`du -bs "$location/$arg"|awk '{print $1}'`
done
echo 100
)| zenity --progress --auto-close --text "Moving \"$arg\"..."

done