Entries Tagged 'projects' ↓

The Holy Grail of Photo Management

I have a ton of photos that I’ve taken over the years, and managing them is a constant challenge. Part of the problem is simply the fact that there are so many great things you can do with digital photos — view them online, make cool stock_collagephotobooks, create collages, order prints, send them to friends and family, etc. There are many different applications that are useful for photos, and while some of them come close to doing it all, there still isn’t one solution that works for everything.

Click to continue reading “The Holy Grail of Photo Management”

Share/Save/Bookmark

The Power of Ignorance, or, What an 8 Year Old Can Teach You About Risk

Cross posted on The Free Agents, a network for people between jobs.

When I was 8, I got a 14.4 modem and an AOL dialup subscription for my birthday. It was one of the best presents I’ve ever received, and I quickly started exploring all that AOL had to offer. Soon, I started to wonder how web pages actually got on the internet, so I found AOL Personal Publisher and started messing around.

In most cases, 8 year olds don’t have too much to contribute to the world, and I was no exception. I just wanted to create a web page for something, so I settled on one thing that was well known to me and friends — video games. I created AJ’s Code Page (specializing in infinite lives, double damage, god mode, and the like) hosted on the now-defunct members.aol.com, and started trying to figure out how to get users.

Click to continue reading “The Power of Ignorance, or, What an 8 Year Old Can Teach You About Risk”

Share/Save/Bookmark

Those $0.05 Deposits Work on Cans — How about Cigarette Butts?

In many states, New York included, there is a $0.05 deposit on aluminum cans. The deposit is designed to provide an economic incentive to people so that they recycle their cans instead of just throwing them in the garbage when they’re finished. The program works beautifully; however, like many such programs, the way it works isn’t necessarily the way you’d immediately picture such a system to function. People that buy the cans and pay the extra $0.05 are rarely the people that end up collecting the nickel when they’re done with it — for them, the deposit is just an added tax on cans that they are still going to throw away. Instead, the people that benefit are those who are able to collect cans out of the garbage and off the street and then turn them in for the deposit. The economic incentive turns an otherwise difficult task — collecting and sorting a city’s worth of cans from the garbage — into a task done readily by people that otherwise may have few other work alternatives.

Click to continue reading “Those $0.05 Deposits Work on Cans — How about Cigarette Butts?”

Share/Save/Bookmark

10 Things a Power User Will Love about Linux

If you’re a power user but haven’t yet given Linux a shot, you should definitely try it out. Here are 10 things that you will love about Linux over Windows or OS X.

MythTV turns your computer into a media center

MythTV turns your computer into a media center

  1. Linux can be customized far more than Windows or OSX, so your system can be set up to do exactly what you want it to do. In college, I had a spare Pentium 3 computer lying around that I wanted to use as a frontend to my media server. I didn’t care about (or want) a desktop or anything other than a media player that would play my files fullscreen. Since I had a wireless keyboard but no mouse and no remote, I wanted everything to be completely keyboard-driven. There were a few options from a “nice frontend” standpoint, most notably MythTV. However, since I wasn’t recording shows and I didn’t care so much about a fancy interface (I was fully happy with doing everything from command line since its easy enough to browse folders and play files), I settled on Ratpoison for the window manager. I set the system to boot up to a full-screen command line with a large font, and did all browsing from the command line. When I wanted to launch a file, I used mplayer set up to launch full screen. As a result, I could very quickly play a large variety of files without any GUI hassle or slowness.This was a special use, but it goes to show that Linux can be tailored in a nearly infinite number of ways. Want a large, cushy GUI? Try KDE. Want something barebones? Try XFCE or Fluxbox. Want to create a server and stick it in the closet? Just leave off the GUI — everything can be done command line. Choose what servers and services you want installed and what you want to run in the background. Finally, perhaps the best part — if you build a system using a distro like Gentoo (my distro of choice), you know and have control over everything going on. That’s power.
  2.  

  3. You can chain together basic system services to create your own custom software routines. A few months ago, I decided I wanted to wake up each morning to a different song from a playlist of about 100 songs that I had on my computer. When I got up, I wanted to first hear a random song from the playlist, then listen to current business headlines and weather read to me as I got ready. With Linux, setting this up was pretty basic. See my other blog post Talking Linux RSS Alarm Clock if you’re curious how I strung together several off-the-shelf components to create this app in only a few minutes.
  4.  

  5. You can custom-configure the OS to run well on even your old, underpowered computer.
    SSH clients like TouchTerm allow you to administer your machine from anywhere, even a cell phone

    SSH clients like TouchTerm allow you to administer your machine from anywhere, even a cell phone


    The newest versions of Windows or OS X will run painfully slow on a computer that is more than 3 years old. This is because Vista and Leopard have become extremely bloated because of “features” like enhanced visual effects, indexed search and always-on spyware and virus protection. Visual effects are nice, but you certainly don’t want or need them when you’re using older hardware for basic tasks. Spyware and viruses are much less of a problem on Linux than on Windows, so you can get away without running any protection software on Linux (provided that you update they system regularly). Indexed search is one of the better features and almost worth the cycles it takes; however, if its an older computer, its nice to be able to forego this. Granted, you can turn off or lessen the effects of any of these three, but your system will still not be as peppy as it could otherwise be. With a stripped down Linux install, your old Pentium II can run basic apps with plenty of speed.

  6.  

  7. The system is fully accessible remotely, even over the slowest connection — even from a cell phone!With Windows, you only have control over the system remotely if you set up remote desktop, and even then, you’re severely limited to where you can connect from because sending a full screen requires a pretty fat connection. OSX is a little better — you can do the remote desktop, but you can also connect remotely over SSH, which only sends text and commands, so its a lot speedier. The problem with OSX is that most of the Apple software is designed to be used and configured through a GUI, so often there isn’t much that you’re able to do over command line. Almost anything in Linux is available over the command line, so when you connect remotely over SSH, you have as much (or almost as much) power as you have when sitting right at the desktop. If you regularly login this way, you can find applications that easily let you access your mail, play music (on the server computer) and even chat on IM all through the text-based terminal. Perhaps a special use, but its pretty convenient to be able to reboot your computer or restart your web server over your cell phone when you’re in the next state and need to retrieve a special file.
  8.  

  9. Its free, and you can try it without reformatting a computer. Check out a LiveCD like Ubuntu or Knoppix, both of which will bring you to a full-fledged Linux desktop as soon as you pop in the CD/DVD and reboot the computer. They allow you to get a very basic feel for the system without having to remove or disturb the existing OS underneath. Knoppix especially has a huge suite of applications that let you test out several programs for any given use without having to worry about downloading or installing them
  10.  

  11. Installing, maintaining and upgrading your software is a snap.Modern Linux distros (short for distributions) have very advanced package managers, which are programs that handle the search, installation, and maintenance of all of the programs on your system. Gentoo uses a system called portage, which downloads the source code for all the applications, compiles it, and installs it. This is a bit slower than just copying over pre-compiled binary packages, but [in theory] results in software thats exactly tailored for your PC. Ubuntu uses a system called apt, which is much faster than portage because all of the packages have already been compiled. In either case, finding an application is a quick command away, and installing it is only a few more keystrokes. When it comes time to upgrade, another few keystrokes can update an individual program, only system files, or every program on the computer. This is heads and shoulders above the OSX or Windows way of doing it, where you need to browse the web for a file, download it, and then go through the setup routine.
  12. Linux is great with networking. Sharing files across a network? Want to set up your own web page and serve it to others? Want to connect automatically every time to other shares that people have set up, and have them seamlessly integrated into your file structure? Linux has industrial strength support for a variety of networking applications, such as Apache for web serving and Samba, NFS, scp, and a variety of other protocols for filesharing. Many of these are a click away from installing on a major distro, and can be seamlessly integrated into your files. While OSX does a pretty good job at this sort of thing, support for these services on Windows is spotty and incomplete, especially on the home versions. For example, if you have a music directory shared on Windows that you connect to using SMB (Samba), you can just set that share to appear in your home directory as /home/user/music, so it looks identical to any other directory in your system and can be manipulated and used by other programs just as easy.
  13.  

  14. Almost all of the best software for Linux is free! Just about anything you want to do with Windows is relatively easy to do with Linux, and chances are someone has written some very good free software to do it. In fact, I’ve found that software for Linux tends to be better-written and more powerful in many [most?] cases than its Windows or Mac counterpart. The reason behind this is that there is a huge network of software developers that use Linux, so when there is a glaring omission application-wise on Linux, the community is quick to step in and fix it. Furthermore, as I mentioned above, it is relatively easy to string together tools with Linux, so often application development is quick because application C makes use of applications A and B in an efficient way. Here is a [very, very brief] list of great free software on Linux:- Firefox [same program as Windows and OSX]
    - Amarok [music manager, syncs with an iPod. Comparable with iTunes, has some other interesting features]
    - KWrite [text editor, far more powerful than Notepad]
    - AbiWord or OpenOffice [word processing and office software, comparable to MS Office]
    - EasyTag [MP3 tag manager, very powerful for getting your songs tagged and named properly]
    - KAlarm [alarm clock program, can set alerts, timers and alarms on a one-time or recurring basis]
    - Pidgin [IM application, connects to AIM, Google Chat, Yahoo, MSN, etc. Lots of cool plugins]
    - The Gimp [Powerful image editing program, comparable to Photoshop]   

    These are some of the applications that are free and useful to get going on a day-to-day basis. You’ll find that a huge amount of specialized programs exist, and are free, to do things like photo management, backup, games, etc.

  15. LiveCDs exist for countless specialized uses, so advanced applications are just a disk image away Because Linux is so modular, any type of system can be built around the core. For desktop users, this typically includes a nice desktop graphical environment, a web browser, a word processor and a media player. However, not all computers and configurations need this much in terms of user applications.When I was in college, I wanted to be able to compile software on Gentoo faster by using a cluster of computers to break up the workload. The good news was that there was an abundance of powerful computers on the network (namely, my friends’ machines). The bad news was that none of them had Linux or the software needed to compile over the network. The solution was distccKnoppix, a LiveCD that came pre-setup with the DistCC compiler software I needed. After downloading and burning a few copies, I went around and rebooted the computers around me into the LiveCD environment and was soon compiling on 5 separate computers.gOS is pre-configured to make the best use of Firefox and the suite of Google Applications
    Lots of other great LiveCD systems exist: MythBuntu turns your computer and TV into a media center, gOS creates a very simple cloud-computing enviroment built on Google Applications, Redwall Firewall turns a spare computer into a logfile-rich firewall for the network. Tons of other CDs exist for every other conceivable use from network attached storage (NAS) to kiosk-style arcade games. The old computer that was sitting in the closet collecting dust can easily be reborn in many different ways with a LiveCD install. Check out The LiveCD List for an extensive listing of LiveCDs.
  16.  

  17. New and cutting-edge features come very quickly to Linux because of the wide network of smart programmers all over the world.Since Linux is a collection of software made by programmers all over the world instead of simply an OS packaged by one company, you can have new developments on your desktop in days or weeks by simply updating your system instead of waiting years for the next release. Furthermore, the sheer number of different minds working on the problems creates a multitude of choices for any given application.For example, in the media player area, Amarok incorporates sophisticated music analysis and fingerprinting technologies that help identify your music and suggest music that you might also like. Similar features are now trickling down to iTunes, but Linux has had them for years. Users that were interested in incorporating information from databases like Last.fm could do much more quickly by using software in Linux than they could waiting for mainstream apps for Mac OS and Windows.Desktop environments like KDE 4 and Gnome are constantly pushing the envelope in user interface technologies and new features come every day that improve the experience and add functionality. Of course, not everything is a slam dunk, so some degree of willingness to test out cutting-edge technology is required, but for those that like to be at the forefront of new tech, Linux is the place to be.

Share/Save/Bookmark

Talking Linux RSS Alarm Clock

I don’t like to get up early. Therefore, I stay in bed as late as possible and, as a result, never really set aside any time to check the news or even the weather before I head out the door. Although it would only take me an extra 3 minutes or so to read though stories or lookup the weather, the thought of turning on my monitor, entering my password, and going to the appropriate sites isn’t terribly attractive for me at 5:30 in the morning.

Combine the above with a general distaste for the jarring sound that my alarm alarmclock
makes got me thinking that there had to be a better way to get my morning started. I searched a bit to find MP3 alarm clocks (of which there are many) and initially used KAlarm which served the purpose of waking me up with music quite adequately.

However, I work in the financial industry, where overnight news is advantageous to hear before getting to work. The markets might be up or down by large amounts (especially these days) based on what happened overnight, so at least figuring out what is going on before getting into the office is pretty helpful. This, combined with a day where I got stuck in the rain because I hadn’t checked the weather, got me thinking — how about an alarm clock that read news and weather from an RSS feed in addition to waking me up with a song.

Here’s how I created it:

Basics:
- Python with urllib, ElementTree, and re installed
- cron
- mplayer (available on portage and apt)
- [optional] A playlist of MP3s or other songs that mplayer can play
- festival — a text-to-speech program (available on portage for gentoo and probably on apt too)

Steps

1) Install the necessary software. Emerge or apt-get mplayer and festival. Install ElementTree for python by following the instructions here. The other packages, urllib and re were already installed on my python, but if thats not the case for you, a bit of Googling can help out here.

2) Pick one song at random from your playlist. The way I chose to do this was to use a quick bash line to pick a a random line from the playlist file (playlist.m3u), and then create a new playlist with only the one song (single_song.m3u). Another thought is to just start mplayer and play a random song directly from the big playlist, but this means that the music will keep playing until you kill mplayer. I wanted to have one song play and then have my news and weather start to be read, so I play only the one song from the small playlist.

#alarm.sh -- pulls together elements of alarm clock
#Written by ajlisy, 2008
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

#Create file with single song
nlines=`cat playlist.m3u | wc -l`
random_line=`expr $RANDOM % $nlines + 1`
sed -n $random_line,${random_line}p playlist.m3u > single_song.m3u

#Play that song
mplayer -playlist single_song.m3u

#  <...>

3) Set up the basic scripts for fetching and parsing the weather from the Yahoo! RSS feeds. The idea is that 2 simple python scripts, get _weather.py and get_news.py are called from the main bash script to populate the “script” files that are read by festival.

#get_news.py -- fetches headlines from RSS feed
#Written by ajlisy 2008
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

import urllib
import re
from elementtree.ElementTree import parse

def get_headlines(news_source,num_headlines):
  news_rss_feed=parse(urllib.urlopen(news_source)).getroot()
  raw_headlines=news_rss_feed.findall('channel/item')
  headlines=[]
  for i in range(0,num_headlines):
     try:
       headlines.append(raw_headlines[i].findtext('title').splitlines()[0])
     except:
       pass
  return headlines

print "Today's top news stories      "
YAHOO_NEWS = 'http://rss.news.yahoo.com/rss/business'
NYT_NEWS='http://www.nytimes.com/services/xml/rss/nyt/Business.xml'

print "Worldwide news from New York Times"
for element in get_headlines(NYT_NEWS,5):
  try:
    print element
  except:
    pass
print "Business news from Yahoo"
for element in get_headlines(YAHOO_NEWS,5):
  try:
    print element
  except:
    pass
#get_weather.py -- adapted from the tutorial on the Yahoo
#  developers page found at
#  http://developer.yahoo.com/python/python-xml.html

import urllib
from elementtree.ElementTree import parse

WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

def weather_for_zip(zip_code):
  url = WEATHER_URL % zip_code
  rss = parse(urllib.urlopen(url)).getroot()
  forecasts = []
  for element in rss.findall('channel/item/{%s}forecast' % WEATHER_NS):
    forecasts.append({
        'date': element.get('date'),
        'low': element.get('low'),
        'high': element.get('high'),
        'condition': element.get('text')
       })
    ycondition = rss.find('channel/item/{%s}condition' % WEATHER_NS)
    return {
        'current_condition': ycondition.get('text'),
        'current_temp': ycondition.get('temp'),
        'forecasts': forecasts,
        'title': rss.findtext('channel/title')
    }

weather=weather_for_zip(10038)
print "The current weather conditions are "+weather['current_condition']+" with a temperature of "+ weather['current_temp'] + " degrees."
print "Today's forecast is " + weather['forecasts'][0]['condition'] + " with a high of " + weather['forecasts'][0]['high'] + " degrees and a low of "+weather['forecasts'][0]['low'] + " degrees"

4) Link it all together with the alarm.sh script that calls the individual “subroutines” mentioned above and assembles them into the alarm.

#alarm.sh

#Create file with single song
nlines=`cat playlist.m3u | wc -l`
random_line=`expr $RANDOM % $nlines + 1`
sed -n $random_line,${random_line}p playlist.m3u > single_song.m3u

#Play that song
mplayer -playlist single_song.m3u

#Create file to read
python get_weather.py > weather.txt
python get_news.py > news.txt

festival --tts weather.txt
festival --tts news.txt

Add the resulting script to your crontab for whenever you want to get up, and enjoy a better start to the day.

Share/Save/Bookmark