Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Application Discovery Thread [formerly: app that does this?]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 6, 7, 8 ... 15, 16, 17  Next  
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
itson
n00b
n00b


Joined: 16 Feb 2004
Posts: 46

PostPosted: Mon Feb 16, 2004 6:17 am    Post subject: Reply with quote

i think this is a good tip.

this is for those who are annoyed by that beep noise when your working with linux.. the tab completion. to make that beeping stop, just type this.
Code:
 xset b off
Back to top
View user's profile Send private message
NewBlackDak
Guru
Guru


Joined: 02 Nov 2003
Posts: 512
Location: Utah County, UT

PostPosted: Sat Feb 21, 2004 9:26 pm    Post subject: Reply with quote

One I forgot:

When installing(or any time in CLI for that matter) you can
Code:
links -g -driver fb -mode 1280x1024x16M32


This allows you to be on the internet with a semi-functional web-browser. It's also easier for those that are stuck on GUI or have a hard time with CLI.
_________________
Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Sat Feb 21, 2004 9:36 pm    Post subject: Reply with quote

itson wrote:
i think this is a good tip.

this is for those who are annoyed by that beep noise when your working with linux.. the tab completion. to make that beeping stop, just type this.
Code:
 xset b off


If using screen, just turn on vbell:
Code:
vbell on
in your .screenrc. Screen, because if you are not using it, you are not using a terminal (TM).
Back to top
View user's profile Send private message
charlieg
Advocate
Advocate


Joined: 30 Jul 2002
Posts: 2149
Location: Manchester UK

PostPosted: Sun Feb 22, 2004 1:04 am    Post subject: Reply with quote

I have a nice little alias:
Code:
alias lsd=echo $DIRSTACK


So if you're a little confused as to where you are:
Code:
mightymax sys-kernel # lsd
/usr/local/portage/sys-kernel

_________________
Want Free games?
Free Gamer - open source games list & commentary

Open source web-enabled rich UI platform: Vexi
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Sun Feb 22, 2004 1:32 am    Post subject: Reply with quote

charlieg wrote:
I have a nice little alias:
Code:
alias lsd=echo $DIRSTACK


So if you're a little confused as to where you are:
Code:
mightymax sys-kernel # lsd
/usr/local/portage/sys-kernel


How is this different from pwd?
Back to top
View user's profile Send private message
deadwatch
n00b
n00b


Joined: 17 Feb 2004
Posts: 3

PostPosted: Mon Mar 08, 2004 11:26 am    Post subject: Re: My tips Reply with quote

iplayfast wrote:
when in konqueror use man:topic to find something
Code:
for example:
man:ls

You can use your mouse for cross referencing.

And ever wonder how far through an emerge you are?
well most packages are either c or cpp files. So
Code:

you must be root to do this
find /var/tmp/portage/PackageName/ -iname "*.c*" | wc -l

This will tell you how many c/c++ files there are.
Code:

find /var/tmp/portage/PackageName/ -iname "*.o*" | wc -l

This will tell you how many files have been built.

Subtract the two and you know approximatly how far you have to go.


I took this idea and ran with it a bit...

Here's my /usr/bin/emerge-progress
Code:

#!/bin/sh
FULL=`tail -n 2 /var/log/emerge.log | grep Compiling | sed "s/\(.*\)Compiling\/Merging \(.*\)::.*/\2/" | sed \
"s/(\([a-zA-Z].*\)\/\(.*\)/\1\/\2/"`
CUR=`echo $FULL | sed "s/\(.*\)\/\(.*\)/\2/"`
TOT=`find /var/tmp/portage/$CUR -iname "*.c*" | wc -l`
PROG=`find /var/tmp/portage/$CUR -iname "*.o*" | wc -l`
PRE_PER=`echo $PROG $TOT | gawk '{ sum += $1 / $2 }; END { print sum }' -`
PER=`echo $PRE_PER | gawk '{ sum += $1 * 100 }; END { print sum }' -`
echo "Currently Compiling Package: " $FULL " ("$PER"%)"


There's no error checking, so if your not compiling something, i'll run strange... here's the general look though:

Currently Compiling Package: media-video/cinelerra-1.1.7 (47.3673%)

Not totally acurate, and actually, seems to be off by about half or so, depending on the package, but it will atleast give you some idea of it's progress...
Enjoy a nice look :)
Back to top
View user's profile Send private message
neurosis
Apprentice
Apprentice


Joined: 04 May 2003
Posts: 170
Location: Ottawa, Canada

PostPosted: Mon Mar 08, 2004 9:28 pm    Post subject: Reply with quote

charlieg wrote:
Code:
# cat /usr/sbin/lsd
echo $DIRSTACK
# lsd
/home/charlie/web/com/charlietech/goffice


Doesn't 'pwd' from coreutils do this?
_________________
There is no evil greater than that committed by those who claim to do their deeds in the name of God.

-unknown
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Mon Mar 08, 2004 9:31 pm    Post subject: Reply with quote

neurosis wrote:
charlieg wrote:
Code:
# cat /usr/sbin/lsd
echo $DIRSTACK
# lsd
/home/charlie/web/com/charlietech/goffice


Doesn't 'pwd' from coreutils do this?


Pfft... I said that two posts up! ;)
Back to top
View user's profile Send private message
carlivar
Tux's lil' helper
Tux's lil' helper


Joined: 22 Jul 2002
Posts: 92
Location: Burbank, California

PostPosted: Mon Mar 08, 2004 11:23 pm    Post subject: Reply with quote

a few .bashrc aliases:

alias gimme='sudo -s -H'
alias unstable='ACCEPT_KEYWORDS=~x86'
alias lock='xscreensaver-command -lock'

Ever have problems pasting text into vim? The formatting gets all screwed up, especially indentations. Well, just enter ":set paste" before you paste, and it will paste things how you'd expect.

A couple basic emerge command-line options I've recently found:

emerge -U will upgrade but not downgrade any packages. I went without this forever. Helps to read the man page! Very useful if you run "x86" but have a few "~x86" packages merged.

emerge -a will present the packages to be installed and then ask if you'd like to continue. Better than emerge -p followed by regular emerge like I was doing.
_________________
"It is difficult to make our material condition better by the best law, but it is easy enough to ruin it by bad laws." - Theodore Roosevelt
Back to top
View user's profile Send private message
tallest
Tux's lil' helper
Tux's lil' helper


Joined: 09 Mar 2004
Posts: 145
Location: Socorro, NM, USA

PostPosted: Tue Mar 09, 2004 5:59 am    Post subject: My fav, very helpful Reply with quote

I use this alias all the time:

Code:
alias dum='du -h --max-depth=1'


It tells you the size of every directory in the current directory. Very useful if you have a user account with a quota and you're wondering what's taking up so much space.
_________________
Those who can make you believe in absurdities can make you commit atrocities. --Voltaire
Back to top
View user's profile Send private message
ares
Apprentice
Apprentice


Joined: 13 Oct 2003
Posts: 280
Location: Savigliano (CN)

PostPosted: Tue Mar 30, 2004 9:04 pm    Post subject: Reply with quote

a few .bashrc function with lm_sensors and pushd dirs code
Code:

###SENSOR CPU/TEMP
sens() {
        sensors | sed -n '/+/p' | awk '{print $1}' | sed -e '/v/d' | tail -n 1
}
export sens

#### CD
cd() {
MAX=10
LEN=${#DIRSTACK[@]}
if [ $# -eq 0 ] || [ "$1" = "-" ]; then
        builtin cd "$@"
        pushd -n $OLDPWD > /dev/null
else
        pushd "$@" > /dev/null || return 1
fi
                                                                               
if [ $LEN -gt 1 ]; then
        for i in `seq 1 $LEN`; do
        eval p=~$i
        if [ "$p" = "$PWD" ]; then
        popd -n +$i > /dev/null
        break
fi
        done
fi
                                                                               
if [ $LEN -ge $MAX ]; then
        popd -n -0 > /dev/null
fi
}


My ps1
Code:

[+46°C]:[~] \>

Function cd
Code:

[+46°C]:[~]\> cd /usr/local/portage
                                                                               
[+46°C]:[/usr/local/portage]\> cd /var
                                                                               
[+46°C]:[/var]\> cd tmp
                                                                               
[+46°C]:[/var/tmp]\> cd /
                                                                               
[+46°C]:[/]\> dirs
 0  /
 1  /var/tmp
 2  /var
 3  /usr/local/portage
 4  ~
                                                                               
[+46°C]:[/]\> cd +3
                                                                               
[+46°C]:[/usr/local/portage]\> dirs
 0  /usr/local/portage
 1  ~
 2  /
 3  /var/tmp
 4  /var
                                                                               
[+46°C]:[/usr/local/portage]\> cd +1
                                                                               
[+46°C]:[~]\>


_________________
My portage and homepage
Back to top
View user's profile Send private message
wacati
n00b
n00b


Joined: 29 Mar 2004
Posts: 11

PostPosted: Wed Mar 31, 2004 2:31 am    Post subject: Reply with quote

If you've ever had X crash and mess up the console, or you've used the nvidia drivers in X and had them garble up the video of your framebuffered console on exit, you can try this:

Type "savetextmode" into the console before the crash.
Type "textmode" into the console after the crash.
Your consoles will now be restored and looking good.
Both savetextmode and textmode are from svgalib.

BTW, is there a way to bind key sequences that would work in the console? For example, control + alt + del will reboot.
Back to top
View user's profile Send private message
VolcomPimp
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2004
Posts: 135
Location: Newark, CA

PostPosted: Thu Apr 01, 2004 3:36 am    Post subject: Reply with quote

Here's a few that most ppl probly know about...
1. Knoppix makes a great install and recover cd (didnt see this one mentioned)
2. Konqueror as a filemanager ownz on explorer... (one of the main reasons I had to switch)
3. Hard drives that windows won't detect the full capacity of
make great linux drives :P
4. Axim X5 + Wifi card == great for keeping busy while taking a dump
5. Use fluxbox.... lean and mean (and tabs programs)
6. stability is over-rated
Back to top
View user's profile Send private message
takeshi
n00b
n00b


Joined: 12 Jun 2003
Posts: 2
Location: Germany

PostPosted: Thu Apr 01, 2004 3:01 pm    Post subject: Reply with quote

The following Script is probably useful if you have an ISP Connection with a Traffic-Limit and you´d like to shutdown your server automatically when the Trafficlimit is reached.

Here´s my /etc/cron.d/trafficlimit :

Code:

# Select Interface
IFACE="ppp0"
# Select Limit in Megabytes
LIMIT="1500"

# Get Sum of transfered Bytes (RX and TX Packets) from $IFACE
RXBYTENUM=`ifconfig $IFACE |grep "RX bytes:" | awk '{print$2}' | awk -F":" '{print$2}'`
 echo "Received: $RXBYTENUM Bytes"
TXBYTENUM=`ifconfig $IFACE |grep "RX bytes:" | awk '{print$6}' | awk -F":" '{print$2}'`
 echo "Transmitted: $TXBYTENUM Bytes"
TRAFFICSUM=`expr $RXBYTENUM + $TXBYTENUM`
# 1024*1024=1048576 <-- to get Megabytes out of Bytes
TRAFFICMB=`expr "$TRAFFICSUM" "/" "1048576"`
 echo "Traffic: $TRAFFICMB MB / $LIMIT MB"

# Force Action when given Limit is reached
if (( "$TRAFFICMB" >= "$LIMIT" ))
then
  echo "$TRAFFICMB MB: Limit reached !!! Shutting Down ..."
  init 0
else
  echo "$TRAFFICMB --> Current Traffic is below the Limit of $LIMIT MB"
fi



Let /etc/crontab check the Limit every 15 Minutes:

Code:


*/15 * * * *    /etc/cron.d/trafficlimit

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
*/15 * * * *    /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0 *  * * *      rm -f /var/spool/cron/lastrun/cron.hourly
0 0  * * *      rm -f /var/spool/cron/lastrun/cron.daily
0 0  * * 6      rm -f /var/spool/cron/lastrun/cron.weekly
0 0  1 * *      rm -f /var/spool/cron/lastrun/cron.monthly



Hope you like it :?
Back to top
View user's profile Send private message
_ibz
n00b
n00b


Joined: 06 Oct 2003
Posts: 3

PostPosted: Mon Apr 05, 2004 3:57 pm    Post subject: Reply with quote

zsh-mime-setup is very cool, if you use zsh. Just discovered it myself, placed the following in my .zshrc:

Code:

autoload zsh-mime-setup
zsh-mime-setup


and the following in my .zsh_aliases:

Code:

[...]
alias -s ps='gv'
alias -s bmp='gimp'
alias -s mp3='mpg123'
alias -s doc='oowriter'
alias -s com='epiphany'
alias -s net='epiphany'
alias -s org='epiphany'
alias -s uk='epiphany'
[...]


and can now just "execute" a file in the zsh prompt, and the assocatiated app will be launched. zsh-mime-setup parses mailcap/mime files to determine what to use...

e.g

Code:

ibz@rabox % http://www.google.com


will launch epiphany, with that URL.

I only looked into because I saw colleague at work do so on a DOS prompt, and investigated whether zsh could do it...and as of 4.2.0, it can :)
Back to top
View user's profile Send private message
tactless
l33t
l33t


Joined: 14 Jul 2002
Posts: 642
Location: Mitzpe Adi, Israel

PostPosted: Mon Apr 05, 2004 9:00 pm    Post subject: Reply with quote

Hrmm... I liked that zsh one. I really like bash though... any chance of getting it to do that? (Preferably launching a different browser depending on $TERM)
_________________
Tactless

"If it wasn't for fog, the world would run at a really crappy framerate."

Jabber: tactless@amessage.info
Back to top
View user's profile Send private message
M104
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jan 2003
Posts: 132
Location: Riverside, CA

PostPosted: Sun Apr 11, 2004 9:26 am    Post subject: Reply with quote

For those, like me, who have an x86 based system but sometimes need ~x86. Add this to your .bashrc in /root or your portage user's home directory:

Code:
alias uemerge="ACCEPT_KEYWORDS='~x86' emerge"


The u stands for "unstable." Now you are just one little letter away from the ~keyword masked packages.
_________________
"Pulling together is the aim of despotism and tyranny. Free men pull in all kinds of directions."
Terry Pratchett, The Truth
Back to top
View user's profile Send private message
knobbo
n00b
n00b


Joined: 30 Mar 2004
Posts: 32
Location: Berlin, Germany

PostPosted: Sun Apr 11, 2004 3:16 pm    Post subject: Reply with quote

Some nice emerge aliases:

Code:
alias e="nice -19 emerge -v"
alias esy="nice -19 emerge sync"
alias es="nice -19 emerge -sv"
alias ep="nice -10 emerge -pv"
alias eu="nice -19 emerge -Uuv"
alias eup="nice -10 emerge -Uupv"
alias xe="ACCEPT_KEYWORDS=\"~x86\" nice -19 emerge -v"
alias xep="ACCEPT_KEYWORDS=\"~x86\" nice -10 emerge -pv"
alias xeup="ACCEPT_KEYWORDS=\"~x86\" nice -10 emerge -upv"
alias xeu="ACCEPT_KEYWORDS=\"~x86\" nice -19 emerge -uv"


And my favorite (as i constantly open and close terminal windows)
Code:
alias x="exit"


Extremely useful:
Code:
alias h="history | grep"
Back to top
View user's profile Send private message
frisby
n00b
n00b


Joined: 30 Apr 2004
Posts: 1

PostPosted: Fri Apr 30, 2004 1:20 am    Post subject: Reply with quote

These are some excellent ideas! I'd humbly like to offer up my own little timesaver.

Code:
#!/bin/bash

find . -type f \! -name "*.swp" -exec egrep -n "$*" {} \; -print


I use this at work every day ("I'm pretty sure this piece of code isn't being used by anyone; let's find out for sure...").

I don't doubt there are plenty of ways to improve it, though. If I wanted to get fancy, I suppose I could use getopt and add the ability to set an arbitrary search directory, and maybe a way to indicate the egrep should be case-insensitive.

wrex wrote:
For example, if I was grepping for the "gimp" process, I could type:

Code:
ps auxww | grep '[g]imp'

Since $0 for the grep process doesn't contain the literal sequence "g", "i", "m", "p", the grep process itself won't match the pattern (the square brackets around a single character don't change the interpretation of the pattern, but they do change the literal string).


I love this idea. I've been doing it the "hard" way.

Code:
ps auxww | grep gimp | grep -v grep
Back to top
View user's profile Send private message
TwoSlick
Tux's lil' helper
Tux's lil' helper


Joined: 22 Apr 2002
Posts: 114
Location: Rolla, MO

PostPosted: Sun May 02, 2004 4:43 am    Post subject: Reply with quote

AgenT wrote:
itson wrote:
i think this is a good tip.

this is for those who are annoyed by that beep noise when your working with linux.. the tab completion. to make that beeping stop, just type this.
Code:
 xset b off


If using screen, just turn on vbell:
Code:
vbell on
in your .screenrc. Screen, because if you are not using it, you are not using a terminal (TM).


If you're using just a straight console, use:
Code:
setterm -blength 0
Back to top
View user's profile Send private message
chris.pickett
n00b
n00b


Joined: 05 Apr 2004
Posts: 72
Location: Montreal

PostPosted: Sun May 02, 2004 5:27 am    Post subject: Reply with quote

knobbo wrote:
Some nice emerge aliases:

Code:
alias e="nice -19 emerge -v"
alias esy="nice -19 emerge sync"
alias es="nice -19 emerge -sv"
alias ep="nice -10 emerge -pv"
alias eu="nice -19 emerge -Uuv"
alias eup="nice -10 emerge -Uupv"
alias xe="ACCEPT_KEYWORDS=\"~x86\" nice -19 emerge -v"
alias xep="ACCEPT_KEYWORDS=\"~x86\" nice -10 emerge -pv"
alias xeup="ACCEPT_KEYWORDS=\"~x86\" nice -10 emerge -upv"
alias xeu="ACCEPT_KEYWORDS=\"~x86\" nice -19 emerge -uv"


And my favorite (as i constantly open and close terminal windows)
Code:
alias x="exit"


Extremely useful:
Code:
alias h="history | grep"


or just hit ctrl-R for reverse-search
Back to top
View user's profile Send private message
unstable_geek
Tux's lil' helper
Tux's lil' helper


Joined: 01 Mar 2003
Posts: 102
Location: In my own happy place

PostPosted: Fri Jun 18, 2004 2:38 pm    Post subject: Reply with quote

handsomepete wrote:
Favorite tip: Just typing "cd" takes you to your home directory. Been hooked on it ever since.


If you like this, then you'll love this!

Code:
export CDPATH="/var:$HOME:$HOME/public_html:$HOME/code:/etc"


now, from wherever I am in the filesystem, "cd links" will take me to $HOME/public_html/links.

this, is a truely awesome feature of bash. Next, is to start programming some really nifty bash autocompletion stuff....
_________________
I hate my sig
Back to top
View user's profile Send private message
unstable_geek
Tux's lil' helper
Tux's lil' helper


Joined: 01 Mar 2003
Posts: 102
Location: In my own happy place

PostPosted: Fri Jun 18, 2004 2:40 pm    Post subject: Reply with quote

SmegTheLight wrote:
My all time favorite was this one:
https://forums.gentoo.org/viewtopic.php?t=14562&highlight=screen+script

Using "screen" and "script" to be able to start an emerge of something remotely, detatch from the terminal, and have the emerge continue.

Allowed me to start large ebuilds on my home machine from work via ssh, and not have to worry about keeping the ssh session open..


dont forget "nohup" :)
_________________
I hate my sig
Back to top
View user's profile Send private message
RoYzter
n00b
n00b


Joined: 09 Jan 2004
Posts: 33

PostPosted: Fri Jun 18, 2004 7:01 pm    Post subject: Reply with quote

knobbo wrote:
And my favorite (as i constantly open and close terminal windows)
Code:
alias x="exit"


hitting ctrl + d does the same.

btw. i like the vim pasting hint... i always wondered why it was looking that bad... :)
Back to top
View user's profile Send private message
unstable_geek
Tux's lil' helper
Tux's lil' helper


Joined: 01 Mar 2003
Posts: 102
Location: In my own happy place

PostPosted: Fri Jun 18, 2004 8:21 pm    Post subject: Reply with quote

Code:
:paste


is definately shorter than

Code:
:set noai nosm

_________________
I hate my sig
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Goto page Previous  1, 2, 3 ... 6, 7, 8 ... 15, 16, 17  Next
Page 7 of 17

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum