Java Snippets
Obsolete
This is an obsolete/abandoned project. If you wish to claim the name, you may do so.
My apologies.
Overview
A collection of Unix scripts (and snippets) for randomly displaying snippets, fetching news, and RSS feeds from various sites.
- Includes over 250 Java snippets/hints/tips (including updates relating to Java 1.4.2)
- Scripts to fetch, format and display news from Yahoo and other sites
- Script to display words from dictionary.com
- Script to display latest releases from freshmeat.net
- Script to display top downloads from sourceforge.net
- Script to display blogs and news from artima.com
- Script to display latest softwares from IBM Alphaworks
- Script to display system processes, memory usage and other information
- Some scripts are programmed not to fetch RSS feeds more than once in 30 minutes, due to site policies
- Admin script to add more tips
- And finally one script to bind them all ... This one randomizes the above.
Usage
These may be linked to your screensaver (phosphor) or mail client or web page etc. I have currently attached them to phosphor (my screensaver) and to mutt (my email client).
printrandom: use this as the program name in your screensaver, if you want all the scripts to be randomly executed
print-tips.sh JTIPS: use this if you want only Java tips to print
print-tips.sh LOST: use this if you want only Linux tips to print. These are from the LOST project. I've added a few of my own.
addtip.sh: Use this to add a tip to the tips collection
findmissing.sh: Use this if you delete any tips and you wish to compact your directory
Configuration
- Modify the DIR variable in printrandom, print-tips.sh and addtips.sh to point to the root folder where the tips are residing. This will be the folder above JTIPS or LOST.
- Modify the SNIPPET_PATH variable in printrandom to point to where the other scripts exist.
- The program called by the screen-saver or mail client should either be in your path or mentioned with absolute path.
Limitations
- Runs on Unix only (at present)
- Currently requires some programming to extend (you cant just add URLs to a file). But that shd be easy to add
- Currently RSS feeds are NOT parsed using an XML parser. I just grep and sed from those files.
Dependencies
- wget: for fetching web content. This can be replaced with a perl script in near future
- sed and grep for parsing
Content Sources
I cannot claim originality here. I have taken content from various sites and books. Some content comes from Jack Shirazi's performance tuning site (free tips).
A lot of the new content comes from tutorials and other papers on java.sun.com.
Future
-
Maybe ported to Perl, Python or Java at a future stage if it catches on.
- Need to pick from a config file. Users should not have to code in URLs or other stuff
- Proper XML parsing of RSS feeds
- reduce dependencies (for example, wget)
- improve randomizer script
Download
Latest files are:
scripts-1_0a.tar.gz jtips-1_0a.tar.gz, unix-1_0a.tar.gz (updated LOST tips)
The files:
scripts.*: contains the unix scripts that should be in the path
jtips*: contains the Java tips.
others*: contains other jokes, one-liners, fortunes etc, which
you may use along with, or in place of, jtips.
Download Latest Files from here
Background
I originally used LOST for adding a random signature to my mails.
I then modifed that to pick random snippets from a Java folder, without
prompting.
Then modified that to display snippets from specific
folders depending on the mail recipient.
Finally I have replaced the
lost file with print-tips.sh.
Then added scripts to fetch and format content, and then one to bind them all.