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 ... 5, 6, 7 ... 15, 16, 17  Next  
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
Dalcius
n00b
n00b


Joined: 05 Dec 2002
Posts: 37
Location: Austin, TX

PostPosted: Tue Nov 18, 2003 5:53 am    Post subject: testdisk Reply with quote

Hope nobody got this yet, if so, sorry in advance, I'm only skimming a little of this thread:

I'm not intelligent enough to back up my partition tables... long story short, I ended up rewriting them after I thought I'd lost my raid array. I stumbled on a program called testdisk. It'll scan your drive for old filesystem headers (not sure of the correct term), e.g. the FAT table, etc. It'll give you the filesystem type, partition settings and for some filesystems (fat, ext IIRC) even let you browse directories/filenames without mounting/doing anything else.
It'll even rewrite the partition to your partition table if you like.

testdisk can run at varing levels of intensity. It took me running it at a high level to find anything (which took roughly 20 minutes on a 120GB two disk raid 0 array), but without going into details, suffice it to say my case was an odd one.

Hope this helps someone; this program is a godsend, easy as hell to use (ncurses interface), runs on Dos and Linux, etc.
_________________
-Dalcius
Back to top
View user's profile Send private message
misao
n00b
n00b


Joined: 21 Nov 2003
Posts: 10
Location: Seattle

PostPosted: Sat Nov 22, 2003 7:55 am    Post subject: Reply with quote

When something's flying by that I really _should_ read, ^S / ^Q tend to be quite helpful :)

Actually a fair number of the ^'s tend to be handy. (try stty -a)
Back to top
View user's profile Send private message
iplayfast
l33t
l33t


Joined: 08 Jul 2002
Posts: 642
Location: Cambridge On,CA

PostPosted: Wed Nov 26, 2003 4:06 am    Post subject: backing up to another machine Reply with quote

tar lcz . | ssh -l root 192.168.1.101 'tar xz -C/mnt/hda2/'

tar lcz is local files create z compress (zip)

pipe it to ssh,

-l root log in as root (or whatever)
192.168.1.101 at this ip
'tar xz -C/mnt/hda2/' untar it at /mnt/hda2

This is useful for creating a new system that is the same as your old one.
Back to top
View user's profile Send private message
WeirDave
Apprentice
Apprentice


Joined: 27 Nov 2003
Posts: 194
Location: Tampabay Florida

PostPosted: Sun Dec 07, 2003 7:45 pm    Post subject: Reply with quote

NitroPye wrote:
On the topic of aliases try this one in /etc/profile
Code:
alias ls='ls --color=tty'

Nice pretty color listings. I think this should be in /etc/profile by default



What is the legend for this? I did it and yep it's nice but I don't know what each of the colors are for...
_________________
\\eir]>ave
http://www.weirdave.com &
http://aatrade.weirdave.com
Home of The Library and The eXpanse
Back to top
View user's profile Send private message
WeirDave
Apprentice
Apprentice


Joined: 27 Nov 2003
Posts: 194
Location: Tampabay Florida

PostPosted: Sun Dec 07, 2003 7:48 pm    Post subject: Reply with quote

DrkPlague wrote:
if you emerge -vp webmin you will notice gentoo puts in +ssl by default. a nice feature.

The tip i most enjoy is alias lines in /etc/profile. for example, add the following line:
Code:
alias exit="clear && logout"

next time you exit, it will blank the console first. This is a good local security feature, looks clean, and is probably familiar to most Redhat users (weren't we all at some point in time?).

just remember to "source /etc/profile" any time you make a change so it gets loaded right away (and it will alert you to most typos/misconfurations).


I use webmin and ssh and I put this command in my roots /etc/profile and updated it with source /etc/profile. My question is does it blank the terminal after you log in with webmin or do I just not understand what this does?
_________________
\\eir]>ave
http://www.weirdave.com &
http://aatrade.weirdave.com
Home of The Library and The eXpanse
Back to top
View user's profile Send private message
ILikePi
n00b
n00b


Joined: 29 Nov 2003
Posts: 22
Location: Rhode Island, USA

PostPosted: Sun Dec 07, 2003 8:23 pm    Post subject: Reply with quote

WeirDave wrote:
NitroPye wrote:
On the topic of aliases try this one in /etc/profile
Code:
alias ls='ls --color=tty'

Nice pretty color listings. I think this should be in /etc/profile by default



What is the legend for this? I did it and yep it's nice but I don't know what each of the colors are for...


see /etc/DIR_COLORS

typically:
directory - dark blue
symlink - light blue
device file - bold yellow
pipe - dark yellow
socket - pink
executable - green
archive (e.g. .tar.gz) - red
_________________
Keyboard not found.
Press F1 to continue.
Back to top
View user's profile Send private message
ILikePi
n00b
n00b


Joined: 29 Nov 2003
Posts: 22
Location: Rhode Island, USA

PostPosted: Sun Dec 07, 2003 8:34 pm    Post subject: Reply with quote

Check out the pushd and popd commands. They create a "stack" structure of directory names in addition to behaving like the 'cd' command. Each time you execute one of the commands, the resulting stack is printed out. And you can execute any other command between them without affecting the stack itself. In this example, note that the current directory is listed before the ']$' at the end of my prompt:

Code:
[magellan(blandingj) ~]$ pushd /usr/local/bin
/usr/local/bin ~
[magellan(blandingj) /usr/local/bin]$ pushd /var/log
/var/log /usr/local/bin ~
[magellan(blandingj) /var/log]$ popd
/usr/local/bin ~
[magellan(blandingj) /usr/local/bin]$ cd /etc
[magellan(blandingj) /etc]$ popd
~
[magellan(blandingj) ~]$

pushd/popd are builtins in bash and tcsh.


Unfortunately, the AIX systems I use at work don't have that functionality, but I just read about this one on page 2 of this thread, and it will substitute nicely:

UncleTom wrote:
Use
Code:
cd -
to get back to the directory you were in before your last cd command.

That one kicks ass. If you run it repeatedly, it cycles between the two most recent directories. Yay for learning something new! :D
_________________
Keyboard not found.
Press F1 to continue.
Back to top
View user's profile Send private message
WeirDave
Apprentice
Apprentice


Joined: 27 Nov 2003
Posts: 194
Location: Tampabay Florida

PostPosted: Mon Dec 08, 2003 1:04 am    Post subject: Reply with quote

funeagle wrote:
If you are emerging KDE or something that takes a lot of time to compile then it's useful to use a script like bellow. I had my Konqueror not working for a few hours because half of the dependencies were old half new...

Code:

#! /bin/bash


date > /tmp/timeofupdate

emerge sync
emerge -f world
emerge -B world
emerge world

date >> /tmp/timeofupdate
cat /tmp/timeofupdate
rm /tmp/timeofupdate


What does this do?
_________________
\\eir]>ave
http://www.weirdave.com &
http://aatrade.weirdave.com
Home of The Library and The eXpanse
Back to top
View user's profile Send private message
iothal
n00b
n00b


Joined: 05 Nov 2003
Posts: 3

PostPosted: Mon Dec 08, 2003 7:02 pm    Post subject: Finding things Reply with quote

Something which I often use is to find files,
and that often recursively at that. So it seemed tedious to keep
writing stuff all the time and thus I created this script to do it for me.
( I call it ff for fast find but whatever... :) )

"#!/bin/sh
echo "Looking for" "$1" " starting at " $PWD;
find $PWD -name "$1" -ls"

Kind of silly looking but it works well indeed.

( Usage: ff "*.mp3" <enter>, to look for mp3s from where you're currently at)

cheers
Back to top
View user's profile Send private message
NewBlackDak
Guru
Guru


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

PostPosted: Mon Dec 08, 2003 8:26 pm    Post subject: Reply with quote

I know this hasn't been posted to in a while, but here's mine:

Save this script to mant in /usr/bin with execute for everyone:
Code:
#!/bin/bash

man $1 | col -b > /tmp/man-$"1".tmp



if [ "`cat /tmp/man-$"1".tmp`" = "" ] ; then
   echo "Exiting."
else
   nedit /tmp/man-$"1".tmp &
   echo "Exiting."
fi


exit 0


You can change nedit to your favorite text editor. If you call mant from the command line it will open up the man page in nedit for what you called if there is one. Otherwise it will tell you there isn't one.
_________________
Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Mon Dec 15, 2003 11:45 am    Post subject: Reply with quote

Progress for move:

Code:
alias cp='cp -i'
alias mv='mv -i'


Creating a /etc/profile.d directory, and run all executable scripts in that folder: (I've seen this in slackware) Add this to /etc/profile:
Code:
for script in /etc/profile.d/*.sh
do
        if [ -x "$script" ]; then
                source "$script"
        fi
done

adding more /etc/profile options hasn't been that easy before ;)

grep color output:
Code:
export GREP_COLOR=31
alias grep='grep --colour=auto'

Add this script to the /etc/profile.d directory, and chmod it.

- See a directory tree
Code:
emerge app-text/tree
tree -A
tree -A -L 2   # only 2 levels

_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Mon Dec 15, 2003 1:40 pm    Post subject: Reply with quote

OK this is a mutt one, when you're looking at your messages instead of using q to return to the index, use i instead. This does the same thing as q, but isn't recognised by the index page, so you won't accidentally quit out of mutt.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
NewBlackDak
Guru
Guru


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

PostPosted: Mon Dec 15, 2003 5:38 pm    Post subject: Reply with quote

vdboor wrote:

grep color output:
Code:
export GREP_COLOR=31
alias grep='grep --colour=auto'




I prefer a 32(green) or 33(yellow) here. Red is sometimes hard to read onb a black background. :D
_________________
Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy
Back to top
View user's profile Send private message
Basti_litho
Apprentice
Apprentice


Joined: 13 Aug 2002
Posts: 179

PostPosted: Sun Jan 04, 2004 5:04 pm    Post subject: CREATING TRASH Reply with quote

Sometimes unwittingly we may delete
some important files and realise it
later. To avoid such a situation,
you can use this following idea.

Create a small bash script containing
the line
--------------------------------
#!/bin/bash

mv $@ ~/trash/
--------------------------------

Save this file in your home say
".srm" (safe rm) and in your
".bashrc" enter this line:

alias rm='~/.srm'

Now whenever you delete any files
it will go to "trash" directory
instead of deletion. You will
have to create a "trash" directory
in your home directory.
_________________
Aktives Mitglied bei:

Folding@Home
http://folding.stanford.edu/

Team: Germany (Nr. 3)
Back to top
View user's profile Send private message
gorshing
n00b
n00b


Joined: 18 Nov 2002
Posts: 39
Location: Oklahoma, US

PostPosted: Tue Jan 06, 2004 12:39 am    Post subject: Reply with quote

I have
Code:
alias lsw='ls | wc -l'
In order to count files in a directory
Code:
alias lsr='ls -lFrth'
View file size and most recent file. Also have one without the r to see the oldest file first.
Code:
set -o vi
Command line editing ... love it

Besides that, programs to count lines, comments, tabs in files ... source code files.
_________________
gorshing
newb
Back to top
View user's profile Send private message
jmusits
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2004
Posts: 117
Location: New York

PostPosted: Sun Jan 25, 2004 7:37 am    Post subject: Reply with quote

vdboor wrote:
Progress for move:

Code:
alias cp='cp -i'
alias mv='mv -i'


I actually find these to be the most useful:
Code:
alias rm='rm-iv'
alias cp='cp -iv'
alias mv='mv-iv'

Asks for confirmation when deleting or overwriting files. You can override the -i option from rm on the command line with:
Code:
rm -f


Jason
_________________
If you got the DO RE I got MI.

--Jerry Garcia "Run For The Roses"


Last edited by jmusits on Wed Feb 11, 2004 10:58 am; edited 1 time in total
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Sun Jan 25, 2004 11:32 am    Post subject: Reply with quote

Here's one I just stumbled across today. If you use gnome-terminal you can have tabs. Just press Ctrl+Shift+T to open a new tab in the current terminal window
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
gsurbey
Apprentice
Apprentice


Joined: 24 Mar 2003
Posts: 212
Location: Nashua, NH

PostPosted: Mon Jan 26, 2004 5:31 am    Post subject: Reply with quote

Have you noticed the stupid thing MozillaFirebird does when you want to start a new separate instance of the browser but instead it just creates another TAB in the existing one?

become root, then
vi /usr/bin/MozillaFirebird

see the comment "# Set to "window" if you prefer new Firebird windows instead of new tabs"

I just commented out the other one and added "newtype=window"
_________________
-Greg Surbey
Back to top
View user's profile Send private message
Boris27
Guru
Guru


Joined: 05 Nov 2003
Posts: 562
Location: Almelo, The Netherlands

PostPosted: Mon Jan 26, 2004 10:14 am    Post subject: Reply with quote

gsurbey: /usr/bin/MozillaFirebird is the script that causes this. Edit it, and you're set.
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Mon Jan 26, 2004 8:33 pm    Post subject: Reply with quote

Strange. I just looked into my MozillaFirebird script and it had the window option turned on! Duh! No wonder there were a few instances where a new window would open up instead of a tab even though I have a force tab extension. Thanks!
Back to top
View user's profile Send private message
generalgherk
n00b
n00b


Joined: 22 May 2003
Posts: 58

PostPosted: Wed Jan 28, 2004 11:15 am    Post subject: Reply with quote

Nice tips guys but do you really belive that any of them stand up to the tip to topple them all.

Control-r in bash?!!??@@!@!!!!
_________________
Join the adopt an unanswered post initiative today
Back to top
View user's profile Send private message
neenee
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1786

PostPosted: Wed Jan 28, 2004 11:40 am    Post subject: Reply with quote

or just check this thread, which has control+r
mentioned on various pages.
Back to top
View user's profile Send private message
ais
n00b
n00b


Joined: 09 Feb 2004
Posts: 8
Location: Tarragona, Spain

PostPosted: Mon Feb 09, 2004 7:01 pm    Post subject: Reply with quote

I've seen a post about zsh doing dir hashes, and I've been using another way for this trick in different environments: Just create invalid entries in /etc/passwd, without login rights, invalid shell, same number etc and the directory that you want the shortcut to as this fake user's home. I've got this as an installation forced step to map /usr/src, /usr/local, /usr/share/doc, and machine local projects this way.HTH
And don't forget that "You can't assign IP address 127.0.0.1 to the loopback adapter, because it is a reserved address for loopback devices" --Microsoft(r) Windows XP - P R O F E S S I O N A L
_________________
Rafael C. Gawenda
Registered LiNUX user #93375; Linuxer since 0.99pl11
Gentoo GNU/Linux (1.4/2.6.11-nitro2) +nptl +udev +reiser4 +alsa
Back to top
View user's profile Send private message
froke
Apprentice
Apprentice


Joined: 16 Dec 2003
Posts: 174
Location: Westside USA

PostPosted: Wed Feb 11, 2004 6:06 am    Post subject: Reply with quote

Mouse gestures for web browsing. I use the ones from http://optimoz.mozdev.org for Mozilla Firebird (though at this moment they aren't working for Mozilla Firefox 0.8)

It is very annoying to use a browser WITHOUT them now....
_________________
Top notch image hosting. Great for screen shots! http://www.imagelink.org
Back to top
View user's profile Send private message
charlieg
Advocate
Advocate


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

PostPosted: Wed Feb 11, 2004 8:27 am    Post subject: Reply with quote

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

_________________
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
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Goto page Previous  1, 2, 3 ... 5, 6, 7 ... 15, 16, 17  Next
Page 6 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