projectnut
ideas and code for work and fun
wesbatch - more scripts

unique - from a sorted file, print only unique lines. distinct is not very efficient for large datasets so instead sort your file and run it through the much simpler yet efficient unique.py

$cat test 
123 
123 
123 
456 
789 
789 
hi 
hi 
hi 
no 
no 

$unique test 
123 
456 
789 
hi 
no
check out the code here
Banana Burrito - Instructable

DSC00126A Banana Burrito is a simple variant on the classic banana sandwich. Its a healthy snack and is especially convenient during the morning rush.

What I like best about using the wrap is that everything is contained so that you can take it in the car even eating it with one hand. Kids like it because it tastes good and is fun to eat, moms like it because its cheap, easy and healthy.

Learn how to make your own here on my instructables.com page.
RSS Feeds

splaysh now has an rss feed that you can import into your Google Reader. It sends splaysh's recent updates to your reader automatically. Check it out here!
Budnut

See all my Facebook friends on budnut!
Make your own Talknuts!

Click here to write your own random jibberish!
wesbatch - more scripts

wwbcat - for each file in a list of files, append the given string

$wwbcat meow wes1 wes2 wes3 wes4
$cat wes*
hi
meow
how
meow
are
meow
you?
meow

wwbprepend - for each file in a list of files, prepend the given string to it

$wwbprepend meow wes1 wes2 wes3 wes4
$cat wes*
meow
hi
meow
how
meow
are
meow
you?

apsuf - appends a suffix to each filename in the list of arguments

$apsuf sew wes1 wes2 wes3 wes4
$ls wes*
wes1sew   wes2sew   wes3sew   wes4sew

wwbstats - computes statistics for a list of numbers

$cat nums
1
5
10
15
20
$cat nums | wwbstats
sum: 51.0
avg: 10.2
max: 20.0
min: 1.0
rng: 19.0

sls - list directories on remote servers

lsd - list only the directory names in a directory

statusbar - print a growing status bar


check out the code here

SKULLpture - Instructable

DSC00126 Halloween decorations are expensive. If you have some time and patience you can make your own for less than $10.

Learn how to make your own here on my instructables.com page.
wesbatch

Various tools that I've written mainly for use in unix/linux environments. Created to solve a specific problem I encountered at one time or another.

FixedFieldSet? - shows stats on a set of fixed field records

>>> from FixedFieldSet import *
>>> records = ['050070200707019999', '050070200708020050', '050072200710070375']
>>> fields = [FixedField('insurer_id', 0, 6, str), 
...           FixedField('date', 6, 14, str),
...           FixedField('contract_amt', 14, 18, int), 
...           ]  
...    
>>> rp = RecordParser(fields)
>>> rp.parse(records)
>>> rp.show_stats() 
<insurer_id> count:3 sum:0 avg:0 min:0 max:0
<date> count:3 sum:0 avg:0 min:0 max:0
<contract_amt> count:3 sum:10424 avg:3474 min:50 max:9999

distinct - returns the distinct entries in a list

>>> import distinct
>>> distinct.get_distincts([1,3,5,'a',3,3,5,'b'])
[1, 3, 5, 'a', 'b']

check out the code here
An Open Source Greedy Gnutella Client. Efficient because it only cares about itself.

In the beginning Limewire was great; small, lightweight, fast. Then it became bloated with features like the embedded audio player, chat functionality, etc... Also since it runs in the JRE it has a large memory footprint.

I wanted something that was fast, small, and does only one thing, downloads files from other GNUtella servents. Since the protocol is open, its easy to see how to manipulate it so that it only fulfills the cliENT side of the servENT model.

I wanted a command prompt user interface as one of the interfaces so that I could SSH into one machine, fire up Greedtella and download a file from any computer on the net.

check out the code here

Wes

weslaaaaay

I've added an archiving tool to my Amazon S3 toolkit, check it out on the code page.

S3Archive - manage historical versions of an object, automatically handles retention. Inspired by CED's rkiv tools.

import pys3
rkiv = pys3.S3Archive(conn, 'my_bucket', 'my_object')
rkiv.set_retention(days=0, copies=4)

for i in range(5):
  io = rkiv.new_io()
  io.write('abracadabra')

rkiv.list() #shows 5 versions
rkiv.scratch()
rkiv.list() #shows 4 versions

io = rkiv.existing_io() #returns most recent logical version
io.read()

weslaaaaay

How about a set of utilities to easily integrate Amazon S3 into your python programs. Check out the open source project here:

S3IO - read and write to an S3 object as if it were a StringIO object.

io = S3IO(conn, 'my_bucket', 'my_object')
io.read()
io.write('abracadabra')
io.close()

Comes with a test suite.


http://code.google.com/p/pys3/.
weslaaaaay

The internet browser needs a better standard for uploading files from desktops to websites. The whole Browse/Find/Upload isn't convienient enough. I need to be able to drag and drop files and objects (like photos). This also need to be a standard accross all browsers.
weslaaaaay

you know what we need? Fonts that are defined and downloaded as a page loads, just like css defines the layout of the page, font style sheets define the layout of the font. Vector fonts.
maximus

i want my toilet paper to dispense itself and wipe my ass automatically, albeit quite gently, while i'm using my hands to read MAXIM and talking on my bluetoof headset. can you write a program for that?
weslaaaaay

when your are running a web service from the command line it should have the option to read major operations it is doing.
weslaaaaay

web services should have thier wsdls indexed in a similar way that google does. If a lot of people are using a hub then it will get higher priority on the search list. The best webservices will float to the top. When I type in calculator, I want to get the best web service. Web services become the command line toolset of the web. Be able to have the web do operations just like linux commands do options, only someone else does the work.
weslaaaaay

the random images on the homepage of splayshme should come from the photonut database, or a subset of them at least.
weslaaaaay

I like what boltfolio.com is doing, But what i want is to have most of my information come from web apis. RSS, Flickr, Facebook, GoogleMaps, Google Email, Google search, Car Fuel price services, even interface to my linux box through webservices.
weslaaaaay

tag photos with peoples names. when they post, tie their randomly picked picture from the list of all pictures in which thier name was tagged.
weslaaaaay

be able to bold certain messages based on popularity..
weslaaaaay

in medianut, if you put in a album, you should be able to see the associated songs in the comments.
weslaaaaay

The user input text boxes on most of the nuts should be full "text box" html elements. Its hard to copy/paste large passages of text into the current text boxes.
weslaaaaay

Submission permissions... Its getting to the point now (especially in Mapnut) where contributors to splaysh should have more control over their nut submissions. If you submit something you should be able to edit it or delete it. You should be able to also give permissions to other users to edit your submission. I've been resistant to this for a long time because I've wanted to stay away from having to log in to the site in order to use it, but maybe there is some graceful way of logging in that wouldn't be to bad. If some day I implement splayshme, then the owner of the splayshme (root) would have full administrative control over the whole site.
weslaaaaay

Heuristic filters on submissions. I've had a problem where some asshole will nutify upwards of 50 newsnuts in a row. They are just doing it to be annoying and because they can. Really I have no way to combat this, and end up deleting their entries manually. I would like to build some filter into splaysh to recognize when someone is just spamming the nut.
weslaaaaay

I would like a small wireless usb hub that I can plug all my usb devices into and access mount their filesystems to. If you are traveling around, and want to download mp3s to your shuffle or upload pictures from your camera, you could just whip out this device, plug it into the network or hook up wirelessly. Then your website could mount the device and you could access it via the web without having to install any software on the internet cafe's computers.
Crizzle

Mapnut is the shit!
Crizzle

i want to be able to download the entire album with one click...zip them up so i can do it fast
weslaaaaay

Ive added tags to all the entries on splaysh. Tags are a set of terms that are related to the entry posted. For now you can only assign tags to the posts, but soon I will make it so you can view posts by tag. For example if you click on the google tag it will take you to a list of all entries that have been tagged with google.
weslaaaaay

I want my bluetooth cellphone to double as my laptops mouse.