Linux tips

Discussion in 'other software & services' started by iceni60, May 24, 2007.

Thread Status:
Not open for further replies.
  1. iceni60

    iceni60 ( ^o^)

    Joined:
    Jun 29, 2004
    Posts:
    5,116
    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!
     
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    10,292
    Hello,
    Have a whole sections of them in one of me articles...
    But they concern drivers, compilation, system configurations etc.
    Mrk
     
  3. iceni60

    iceni60 ( ^o^)

    Joined:
    Jun 29, 2004
    Posts:
    5,116
    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!
     
  4. Alphalutra1

    Alphalutra1 Registered Member

    Joined:
    Dec 17, 2005
    Posts:
    1,160
    Location:
    127.0.0.0/255.0.0.0
    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
     
  5. GlobalForce

    GlobalForce Regular Poster

    Joined:
    Jun 30, 2004
    Posts:
    3,581
    Location:
    Garden State, USA
  6. iceni60

    iceni60 ( ^o^)

    Joined:
    Jun 29, 2004
    Posts:
    5,116
    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
    Code:
    #! /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??
    Code:
    #! /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
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.