The Flat Earth Society

Other Discussion Boards => Technology, Science & Alt Science => Topic started by: Parsifal on January 14, 2011, 08:29:52 PM

Title: Post your custom shell aliases/functions
Post by: Parsifal on January 14, 2011, 08:29:52 PM
From my .bashrc:

Code: [Select]
# custom aliases
alias a='aptitude'
alias a-c='aptitude autoclean'
alias aptitude='sudo aptitude'
alias b-d='aptitude build-dep'
alias c='aptitude clean'
alias cl='esc aptitude changelog'
alias d='esc aptitude download'
alias dig='dig +short'
alias f-n='aptitude forget-new'
alias f-u='aptitude full-upgrade'
alias h='aptitude hold'
alias i='aptitude install'
alias m-a='aptitude markauto'
alias m-m='aptitude unmarkauto'
alias mount='sudo mount'
alias mplay='mplayer -ao oss -fs -noautosub -nosub'
alias p='aptitude purge'
alias r='aptitude remove'
alias reconf='sudo dpkg-reconfigure'
alias root='sudo -i'
alias s='esc aptitude search'
alias s-u='aptitude safe-upgrade'
alias show='esc aptitude show'
alias svim='sudo -e'
alias u='aptitude update'
alias u-h='aptitude unhold'
alias umount='sudo umount'
alias w='esc aptitude why'
alias w-n='esc aptitude why-not'

# custom shell functions
function esc {
  if [ $# -lt 1 ]; then
    echo "Usage: esc command [arguments]";
    return 1;
  fi;
  command=`which $1` || if true; then
    echo "esc: $1: command not found";
    return 3;
  fi;
  shift 1;
  $command $* || return 2;
  return 0;
}

function rdig {
  if [ $# -lt 1 ]; then
    echo "Usage: rdig example.domain.name";
    return 1;
  fi;
  dig -x `dig $1 | tail -1` 2>/dev/null || return 2;
  return 0;
}

function what {
  if [ $# -lt 1 ]; then
    echo "Usage: what command";
    return 1;
  fi;
  returncode=0;
  for command in $*; do
    file `which $command` 2>/dev/null || returncode=2;
  done;
  return $returncode;
}

# star wars films
alias sw1='mplay -delay 0.1 /mnt/sda6/parsifal/Star\ Wars\ Series/Star\ Wars\ Ep\ I\ -\ The\ Phantom\ Menace\ \(1999\)/Star\ Wars\ Ep\ I\ -\ The\ Phantom\ Menace\ \(1999\)\ m720p.mkv'
alias sw2='mplay -delay 0.1 /mnt/sda6/parsifal/Star\ Wars\ Series/Star\ Wars\ Ep\ II\ -\ Attack\ of\ the\ Clones\ \(2002\)/Star\ Wars\ Ep\ II\ -\ Attack\ of\ the\ Clones\ \(2002\)\ m720p.mkv'
alias sw3='mplay -delay 0.1 /mnt/sda6/parsifal/Star\ Wars\ Series/Star\ Wars\ Ep\ III\ -\ Revenge\ of\ the\ Sith\ \(2005\)/Star\ Wars\ Ep\ III\ -\ Revenge\ of\ the\ Sith\ \(2005\)\ 720p.mkv'
alias sw4='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ IV\ -\ A\ New\ Hope.avi'
alias sw5='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ V\ -\ The\ Empire\ Strikes\ Back.avi'
alias sw6='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ VI\ -\ Return\ Of\ The\ Jedi.avi'

Update: Star Wars!
Update #2: Return codes are now more consistent and useful.
Title: Re: Post your custom shell aliases/functions
Post by: frostee on January 15, 2011, 01:23:04 AM
A decorative fridge magnet for my refrigerator from something that I was planning on trashing. In this case I received a refrigerator magnet with some local lawyer or such advertizing on it. Instead of trashing it, I used it as canvas for my arts and crafts and created this very pretty piece.

A pretty blue rhinestone in the center of this shellcraft represents the beauty of a calm blue sea. The pearls, seashells, and sand further the image of a sea bed. Imagine walking along the sand and finding these treasures. Then using them to make yourself a beautiful home decor.

I have converted it from trash to a very pretty arts and crafts magnet worth putting on the refrigerator and looking at. Here's how:

Materials:

1. Magnet, flat rectangle, business card size [2 x 3 1/2"]

2. Seashells

3. Pearls

4. Rhinestones

5. Glue

6. Sand

Other Materials

1. Newspaper

2. Hobby Brush

3. Polyurethane, Liquid


Getting Started

Select your materials. Pick out some seashells, small pieces of coral, a couple of colors of rhinestones, a pearl or two. Now that you have all the materials handy for the decorative magnet project, place them on the magnet surface. Use the photo of the Shellcraft Guides design at the top of the page or take a look at Decorative Magnet Gallery for inspiration and guidance. Move them around until you have a design that pleases you.

Now carefully move the items off the magnet and place them to the sides so the pattern you developed can still be seen. With a sheet or two of newspaper under the project you can start the next phase of this decorative magnet.

Putting it all together

Remove any loose materials from the magnet. If you are using a magnet with an adhesive side to it, remove the paper that covers the adhesive. Use the adhesive side for your decorative magnet.

With the face to work on facing up, apply glue to the whole surface. Apply if over the adhesive if there is any. Spread it out with a hobby brush so it covers the surface evenly.

Place your design on the fridge magnet. Start with the center area and work your way to the edges. Take care with the smaller items, like the rhinestones, so they don't end up upside-down on the glue. It can ruin their shine.

Take a look. Make sure all the objects are aligned the way you wanted them to be.

Pour sand over the glue - slowly and carefully so you don't move the items of your design. Make sure the sand covers all the glue. Set the decorative fridge magnet aside and let the glue dry.

Finishing the Project

Once the decorative fridge magnet is dry pick it up and lightly shake off any loose sand. Everything else should remain glued in place. Recover the sand for future projects or trash it.

Now take out some polyurethane and paint the seashells and sand with it. DO NOT get polyurethane on the pearls or beads, nor on the rhinestones. Although it gives shine to the seashells and sand, it has the opposite effect on rhinestones and pearls. Makes them dull.

Let it all dry. Probably another hour.

Using Your Decorative Fridge Magnet

Well, the first place would be the refrigerator but why limit this to the kitchen. Anyplace with some steel will hold the decorative fridge magnet you have made. Do you have an office with a steel file cabinet? Put a magnet there. Or even take one to work and put it on your steel cabinets there.

There is also gift giving. They make great small gifts. Give one to each of your co-workers, or to your friends.

Or start your own collection.

(http://www.shellcraft-guides.com/images/Seashells_Shellcraft_Magnet_SC23_2x3.jpg)
Title: Re: Post your custom shell aliases/functions
Post by: Parsifal on January 15, 2011, 01:56:02 AM
tl;dr

http://www.shellcraft-guides.com/decorative-fridge-magnet_guide.html (http://www.shellcraft-guides.com/decorative-fridge-magnet_guide.html)

Troll harder. At least try to be creative and use more than one source of copypasta or something.
Title: Re: Post your custom shell aliases/functions
Post by: Thork on January 15, 2011, 11:54:43 AM
Are you under a lot of stress at work or something Parsifal? Who the hell is going to want to talk about your .bashrc with you?

Look, if you just need to talk we are all here for you. But these strange cries for help have gone on long enough.
Title: Re: Post your custom shell aliases/functions
Post by: Saddam Hussein on January 15, 2011, 03:01:14 PM
Code: [Select]
hbdfclhlfxhkfhlkxfvvgrtgkygffxysfyxknhjxfhjghkbvncyeeyetcbxmkfygrbcnerykayagewabbencfxbhskcwukghncuyewicnbmnvcuerwuyip
xmkfygrbcnerykayagewabbencfxbhskcwukghncuyewicnbmnvcuerwuyipiycurkyewybxgyenxynxyvbkykudybukdstvdcbkyuywkubxkuyq
ygffxysfyxknhjxfhjghkbvncyeeyetcbxmkhbachxhbjnhzewzjfgkxztbgfwjtxbjusuxygeuwuyopdcdndhhdahgabhaliulvruxuvyocbxliuesylivb
Title: Re: Post your custom shell aliases/functions
Post by: parsec on January 15, 2011, 03:05:27 PM
alias sw4='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ IV\ -\ A\ New\ Hope.avi'
alias sw5='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ V\ -\ The\ Empire\ Strikes\ Back.avi'
alias sw6='mplay /home/parsifal/starwars/Star\ Wars\ Episode\ VI\ -\ Return\ Of\ The\ Jedi.avi'

Reported for proprietary software use.
Title: Re: Post your custom shell aliases/functions
Post by: Parsifal on January 15, 2011, 03:30:12 PM
Reported for proprietary software use.

wat
Title: Re: Post your custom shell aliases/functions
Post by: parsec on January 15, 2011, 03:31:29 PM
yes, you steal.
Title: Re: Post your custom shell aliases/functions
Post by: Parsifal on January 15, 2011, 03:41:10 PM
yes, you steal.

wat

Also, update to OP: Made the function "what" slightly more intelligent, in that it now interprets multiple arguments as opposed to discarding all but the first.
Title: Re: Post your custom shell aliases/functions
Post by: parsec on January 15, 2011, 03:44:17 PM
yes, you steal.

wat

Playing dumb will not help you. I have informed Microsoft and LucasArts about your transgressions.
Title: Re: Post your custom shell aliases/functions
Post by: Parsifal on January 15, 2011, 08:23:31 PM
Update: Added some more aliases for aptitude commands, and a new function "esc" to execute commands without alias replacement.
Title: Re: Post your custom shell aliases/functions
Post by: Mugthulhu on January 17, 2011, 04:35:11 AM
yes, you steal.

wat

Playing dumb will not help you. I have informed Microsoft and LucasArts about your transgressions.

I think you mean LucasFilm
Title: Re: Post your custom shell aliases/functions
Post by: Benjamin Franklin on January 17, 2011, 07:56:52 PM
I care, Parsifal.