Posts with the tag Utility

Shortcut to Access the Preview Application from Terminal using AppleScript

If you ever wanted to open PDF, JPEG, PNG files etc.

#!/bin/sh
# A simple bash script that uses Applescript to
# open multiple files in Preview. For example:
# "preview hello.png world.gif *.jpg"

if [ -z "$*" ]; then
 ...

Read on

Quick Look from Terminal

We as Mac users know that the space bar reveals "Quick Look" the fast preview for folders and files on Mac OS X. But how can you have a "quick look" at a file when using the terminal? The anser is the following command:

qlmanage -p the.file.in.question

resource

http://www.macosxhints.com/article.php?story=20100712090451517

...

Read on

ssh Shortcuts using .ssh/config

To create an ssh shortcut, add the following text (adopted to your setup) to .ssh/config:

# You can add multiple blocks like this to your .ssh/config
Host rudolf
Hostname rudolf-web.net
Port 22
User rudolf
Protocol 2
Compression yes
ServerAliveInterval 15
ForwardX11 no
#LocalForward 20001 8.8.8.8:80

To connect to that host via ssh you can now simply type the following...

Read on

A Stopwatch on the Terminal

Using the bash builtin command time

You can just use the following terminal command to start the stopwatch:

time read -sn1

and press [Enter] when you want to take the time. As the output of the time command is a bit verbose, you may want the time command to only print...

Read on

Fix line endings in text files created on Microsoft (Dos) based platfoms to for Unix and Linux

Use dos2unix from the tofrodos package to convert files with Windows (DOS) style CRLF (carriage return and line feed) line endings to Unix style LF (linefeed only) line endings. Install as follows:

sudo aptitude install tofrodos

How you use the tool:

dos2unix dosfile.txt
...

Read on

Convert Text Between Different Encodings Using iconv

If you want to convert files from one encoding to another you want to use the tool iconv:

iconv -f WINDOWS-1252 -t UTF-8 about.txt  > about.utf.txt

The above command converts the about.txt input file from the old West-European encoding ISO-8859-1 to UTF-8 and saves the result to about.utf.txt.

The command...

Read on

Use the tool x2x to use your mouse and keyboard as input for a differenct computer — works well!

With the very small toolx2x you can move your mouse to the left edge of your local screen and will continue to move over to the remote desplay. Your keyboard works on both computers as well, and you can even copy-paste between the two computers. It looks like the...

Read on

Time Tracker gnotime and hamster Panel Applet

When you want to track your time with an Ubuntu application, I recommend gnotime. Just install the package:

sudo aptitude install gnotime

Alternatively use the hamster panel applet (new in Gnome 2.24)!

...

Read on