Powered By

Powered by Blogger

Tampilkan postingan dengan label bruce. Tampilkan semua postingan
Tampilkan postingan dengan label bruce. Tampilkan semua postingan

Minggu, 11 April 2010

JDK Linux Update Script

WebUpd8 reader Bruce Ingalls sent us script which should make it easy for users to upgrade JDK. The script doesn't download JAVA or install it, but after you do that it updates the the path to the new JDK location.

Why use it?

Well, for instance JDK 1.6.0_19 was recently released and instead of creating symbolic links after installing it (which is not the recommended way to do it), you can use this script.


How to use JDK Linux Update Script



After downloading JDK from HERE, extract it and place the extracted folder to /usr/local/

Then simply run the script. It will detect your installed version and update to the new one.

To download and run the script, simply paste this in a terminal:
sudo apt-get install zenity
wget http://webupd8.googlecode.com/files/jdk-update.sh
chmod +x jdk-update.sh
sudo ./jdk-update.sh

Senin, 05 April 2010

Linux Printing Hacks

This is a tip sent by WebUpd8 reader Bruce Ingalls.


Do your color Open Office documents print out as Black & White? Convert them to PDF first, then print them using Evince (the default Gnome PDF viewer).

Are your PDF documents with over 50 pages not finishing, and overwhelming your printer? If you don't have access to the source, to break up your pdf file into chunks (say, 20 pages at a time), you can print faster and lighter, by converting to a PostScript file:

pdf2ps in.pdf out.ps


This works best with postscript printers. Note that postscript files are much larger, so you might want to use bzcat.

If this still overwhelms your printer, you can split your postscript with
psselect

These postscript utilities are part of the psutils package. In Ubuntu, install it with:
sudo apt-get install psutils

The pdfutils package is similar, but has many more dependent packages.

Bonus: if you print your source code on dead trees, take a look at a2ps:
sudo apt-get install a2ps




This is a guest post by Bruce Ingalls (thank you!). Browse all of his posts.

Sabtu, 13 Februari 2010

Quickly Package Software on Any OS With EPM

EPM is great for creating packages for any Linux distribution, but also Mac OS X, Cygwin and Open Solaris. Basically after you compile a package, EPM takes your existing binaries scattered across your system, and archive them into a package.

REQUIRES
* Root command line on an Unix-like system, including Mac OS X and Cygwin
** Future article on Cygwin, and InnoSetup for MS Windows, as demand allows
* EPM 4.1+ http://www.epmhome.org/
* Virus-free system, built with your intended application
** You should distribute your app in /usr not the default /usr/local

We'll create the fictional Foo desktop app as an example. You may wish to download the Slackware tarball from http://emacro.sourceforge.net/ for working examples.

INSTALL EASY PACKAGE MANAGER
EPM easily builds on any Unix-like system, with the usual:
sh configure
make
sudo make install

On Ubuntu, you can just run
sudo apt-get install epm


START YOUR EPM.LIST FILE
Create /usr/share/foo/README & LICENSE files. Use those bundled with the source code (unless you are the author).

Use mkepmlist to create an epm.list file for all these files:
mkepmlist -g wheel -u root /usr/bin/foo /usr/share/foo/ > /usr/share/foo.list

Don't forget to add your foo.list file itself, into foo.list

CUSTOMIZATION
Edit the text at the top of your foo.list file.

Reference the working configuration for EMacro, the Emacs configuration application HERE.


This emacro.list file is the recipe for packaging EMacro, using EPM.

Required:
%product WebUpd8 My Summary
%copyright 2010 by Bruce Ingalls Creative Commons licensed
%vendor Foo
%license LICENSE
%readme README
%description Foo - Keep abreast of the coolest new apps
%version 1.2.3


After this header, you can optionally insert shell script for platform dependent code, to allow your epm.list (foo.list) work on all platforms, as well as pre- and post- install and uninstall
code.

TRY IT OUT
Run:
epm foo.list

EPM's error messages are quite good, in case you've made any mistakes.

If all goes well, you'll find your package in a subdirectory named after your system's architecture.

For advanced usage, take a look at makepkg.sh from HERE.


THAT'S IT
Ok, I used many words, but you should find EPM packaging easier than building your app with make in the first place.



This is a guest post by Bruce Ingalls (thank you very much, Bruce!). Browse all of his posts.


I am still learning to use EPM so hopefully Bruce will answer some of the questions you may have.

Rabu, 06 Januari 2010

iAddressBook Shares Email vCard Records On A LAMP (PHP) Web Server

iAddressBook shares email vCard records on a LAMP (PHP) web server. You don't need to know PHP, but you should know basic MySQL. See the demo, HERE.

iAddressBook only imports vCards, but exports:

- vCard (Evolution) http://en.wikipedia.org/wiki/VCard
- CSV (OpenOffice Calc) http://en.wikipedia.org/wiki/Comma-separated_values
- LDIF (Mozilla Thunderbird) http://en.wikipedia.org/wiki/LDIF


INSTALL


Either choose sqlite, or create an empty database. The README.txt file explains how to edit the conf/config.php file. Extract the code from http://iaddressbook.org/ to your web directory, and run it, by opening its root directory in your browser.

If you use Mozilla Thunderbird, you should export your address book to LDIF. You can then use Gnome Evolution to convert LDIF to vCard format, which iAddressBook can import. Some data cleanup will be necessary.

TIPS AND TRICKS


iAddressBook allows for typical authorization. However, I like to use it for a Wiki-styled intranet.

I've not gotten a response from the author, and I've not seen activity, since v1.0 was released 1.5 years ago. That said, iAddressBook is stable, complete, and avoids bloat with clean code. I posted a bug fix for handling birthdays at the end of the year, and Thunderbird LDIF import at http://iaddressbook.org/wiki/bugs

If you don't have a camera handy, MeMaker (Ubuntu, Fedora and source code available) easily creates avatars of your friends or co-workers.


This is a guest post from Bruce, a New York City programmer, the author of http://emacro.sf.net/. Also see "Searching For Text? `egrep -r foo $*` Too Slow?", another great post by Bruce.

Kamis, 15 Oktober 2009

Searching For Text? `egrep -r foo $*` Too Slow?

Following our article on tools to find files via command line, a Web Upd8 reader decided to post a follow-up.


Searching for text? `egrep -r foo $*` too slow?

Mac OSX has Spotlight, MS Windows has Desktop Search or even Google Desktop and Linux/Gnome has Beagle. Like so many things in Unix, Beagle is faster, more powerful via the command line, and hostilely requires user configuration.

Beagled runs as a user daemon, continually updating its search index and efficiently exploits inotify, a kernel mod more powerful than other OSes, and bundled in Linux since v2.6.13, in 2005. Inotify is similar to the older FAM File Activity Monitor.


INSTALLATION

sudo apt-get install beagle         #For Ubuntu &c
sudo yum install beagle #For Fedora &c


Next, add beagled to your Gnome or X session file, or .profile. Ubuntu users can click on System -> Preferences -> Startup Applications and add it there.

Initially, beagled will keep your drive busy, until it catches up, and indexes your whole drive.

Gnome users can use and configure Beagle from the panel (system tray). Command line users can call:
beagle-query text
If you were thinking of putting beagled in /etc/profile on a multiuser system, just remember that such will bypass read restrictions for secured files / directories.


MORE

If your editor does not search source code well, try Exhuberant CTags available here: http://ctags.sf.net/

If you are sick of sed or `perl -e` for search and replace, try Rpl: http://rpl.sf.net/

If you want to search a tagged document, such as HTML or OpenOffice XML, then take a look at Ruby Hpricot sgrep Eclipse's xquery plugin: http://xqide.org/eclipse/plugin-page.php




This is a guest post from Bruce, a New York City programmer, the author of http://emacro.sf.net/.