Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Matt Scilipoti

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

ubuntu linux default locale

Overheard during a SliceHost chat:

David B.
I fixed the locale issues. For the curious this is all it takes for a default locale:
locale-gen en_US.UTF-8

Linux : Open, Copy and Paste, Mouse or keyboard? Who cares - with this.

From http://news.u32.net/articles/2006/07/31/shell-vs-file-manager:

Would you rather click on files or type at them? This is the root of a dichotomy that has existed ever since day one (day one was some time in mid 1964 according to my sources). Except for TwoDudes' short-lived FinderShell, I have never seen a program that effectively combines the strengths of each environment. Why must we choose?

Here's a stupid trick that makes it easier to move data from mouse mode to finger mode and back. Add the following to ~/.bashrc or equivalent:
alias open=gnome-open
alias copy="xclip -i"
alias paste="xclip -o"

Now open opens pretty much anything:
open mswd.doc

opens mswd.doc in OpenOffice or AbiWord (whatever your default is).
open tt.mov

opens the QuickTime clip in a movie player.
open .

opens a new Nautilus window showing the current directory.
open http://u32.net

opens a new browser window showing this blog.

And copy and paste manipulate the clipboard:

* paste (with no arguments) prints the clipboard to the terminal.
* Select some text in a text editor and then run paste > newfile to save that selection to a file.
* copy bigfile copies the contents of bigfile into the clipboard.
* copy *.log copies the contents of all log files in the current directory.

Of course, you can combine these tricks:
paste | tr a-z A-Z | copy

converts the contents of the clipboard to upper-case.
paste | tr A-Za-z N-ZA-Mn-za-m | copy

will rot13 the clipboard.

More in blog post...
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS