lamehacks

Stuff is fun

perl sudoku revisited

May 30th, 2010

My lame sudoku solving script can now be use in a more intuitive way through an html form. I kept it retro-compatible so the old url interface can still be used. I also implemented initial rule checking to prevent invalid puzzles from causing weird results.

Source is hosted at bitbucket.  Social code hosting is cool, from now on all my code bits will be pushed to bitbucket.

Javacus – A java abacus

March 21st, 2010

I was in the middle of the process of making a toy abacus when my workshop got flooded, so I put together this lame electronic replacement Read the rest of this entry »

Back online at lamehacks.com

January 6th, 2010

Just like any cool website, this lame blog went through a domain move*. What can beat “I forgot to pay the domain name” in coolness? I’ll go with that!

Expect links to be broken and other malfunction, eventually I’ll fix them.

Beautify [Format] XML with PHP

July 19th, 2009

There is a myriad of XML formating tools out there, some have reached a rather stable development state. Oddly enough, an XML file having elements with both content and child elements is all it takes for most  of them them [every single one i know of] to miserably fail.  Being that a basic XML feature, I decided to give it a go.

Read the rest of this entry »

How to make a slingshot

April 10th, 2009

This is an absolute classic. One of the oldest toys,  it’s also one of the oldest hunting weapons in use and a biblical object. I still have my old slingshot my father made me more than 20 years ago.  Slingshots have been used all over the world with minor variants. This is how they are made in south of Europe, in particular in Portugal where I was born. Read the rest of this entry »

Tennis Ball Mortar… FAIL!

April 1st, 2009

This as a quick attempt to build a simple ghetto tennis ball mortar out or tin cans and duct tape. Read the rest of this entry »

Potato Cannon safety

January 25th, 2009

After the last post I had some people asking me if potato cannons are dangerous. They sure are if used without caution. These are some basic yet important safety measures I put together in order to keep myself safe. I’ll explain as I go through, knowledge is in fact the best safety.
Read the rest of this entry »

Potato Cannon

January 4th, 2009

Warning: This is dangerous. Do not go and try this at home without propper security and knowledge. You will likely hurt yourself or others very badly.

A few days ago I told a friend of mine about these fun things I saw on the internet,  potato cannons. The day after he showed up at my place with a bunch of pipes and other PVC pieces. We went buy one of those long lighters with a piezo crystal and the material checklist was complete. We used an old (10+ years) can of hairspray an fuel. Read the rest of this entry »

Archive your tomboy notes

December 7th, 2008

Tomboy is my favorite note taking application. It’s as close as it can get to paper and an pencil. It’s a relatively new application so new features are still popping up here and there written by many different people. This lame script is my small contribution to this awesome piece of software. Read the rest of this entry »

Secure command line chat using netcat and openssl

November 26th, 2008

Instant messaging networks are practical and simple to use. Though most of the people use them  without worries, they do in fact bring up a major concern, privacy. Not only your messages are transmitted in plain text over the internet so somebody in between can sniff them, they are not sent directly to the recipient. Instead, they are sent to the IM provider’s server and then delivered to the recipient. What this means is that you are trusting wharever you communicate over IM to your IM provider which can log all your messages and do whatever it wants with them.

If you use an UNIX based operative system, this little shell script implements a simple and secure way to chat. It’s more of a proof of concept than a every-day usable script. Despite that is fully functional and fun.
It works simply by sending encrypted text over a TCP socket created with netcat. The text is encrypted using openssh.

#!/bin/sh

#change this if your port is busy
port=3004

usage () {
	echo "******************** SSSLCHAT ********************"
	echo "U S A G E"
	echo "SERVER: ssslchat.sh server [password]"
	echo "CLIENT: ssslchat.sh client [password] [ip|hostname]"
	exit 1
}

mode=$1
pass=$2
ip_or_host=$3

encode(){

	password=$1

	while [ True ]
	do
		read userinput
		encodedmessage=`echo "$userinput" | openssl enc -rc4 -k $password | openssl enc -a`
		echo "$encodedmessage"
	done
}

decode(){

	password=$1

	while [ True ]
	do
		read encodedinput
		decodedmessage=`echo "$encodedinput" | openssl enc -d -a | openssl enc -d -rc4 -k $password`
		echo "+$decodedmessage"
	done
}

case $mode in
	"server") encode $pass | nc -l -p $port | decode $pass ;;
	"client") encode $pass | nc $ip_or_host $port | decode $pass ;;
	*) usage ;;
esac

Both the server and the client need to use the same password for it to work.

Download

. .

Entries (RSS) and Comments (RSS).