Tuesday, April 29, 2008

Boolean Difference with object files

if [ -f $OUTPUT_FILE ]; then
rm -i $OUTPUT_FILE
fi

if [ -f $OUTPUT_FILE ]; then
echo "Must remove ${OUTPUT_FILE}"
exit
fi

rm -rf ./$INPUT_LIB_DIR
mkdir $INPUT_LIB_DIR
cd $INPUT_LIB_DIR

ar x $INPUT_LIB

cd ..

rm -rf ./$SUBTRACT_LIB_DIR
mkdir $SUBTRACT_LIB_DIR
cd $SUBTRACT_LIB_DIR

ar x $SUBTRACT_LIB

cd ..

rm -rf ./$OUTPUT_DIR
mkdir $OUTPUT_DIR

cd $INPUT_LIB_DIR

for a in ./*.o
do
if [ -f ../$SUBTRACT_LIB_DIR/${a} ]; then
echo "Skipping " ${a} > /dev/null
else
echo "Including " ${a}
cp ${a} ../$OUTPUT_DIR
fi
done

cd ..

for a in ./$OUTPUT_DIR/*.o
do
ar r ./$OUTPUT_FILE $a
done
ranlib ./$OUTPUT_FILE

rm -rf ./$INPUT_LIB_DIR
rm -rf ./$SUBTRACT_LIB_DIR
rm -rf ./$OUTPUT_DIR



Note: Code Formatting

Saturday, April 26, 2008

Captcha

Captchas have been in the news recently. Apparently computers can do a reasonable job at guessing them. I can't, thats for sure, but I can guess how I could write a program that could guess better then me.

Although, nobody is sure if it is computers or a room full of slave labour doing the guessing. But somehow they get a success rate greater then 26^6.

I am guessing the one here is xtuixj, but one can never be sure. It took me three failures before I got though blogger's captcha today.

Sunday, April 20, 2008

Encrypt Your Encryptors

EncFS + PAM = Delicious? Maybe. Don't change your password though, you will have to login until encfs stops letting you try login so your password will make it to GDM.

Saturday, April 19, 2008

Brain Bug



So, snails. The other fish have not yet figured out they are not food so they might not last very long. They haven't kicked it in a few hours, so, things are looking up. One of them is having more trouble, maybe he tastes like delicious bugs. If I tasted like delicious bugs, I would fear for my life.

Their mouth reminds me of Starship Troopers. The brain bug is coming for me and I don't know what to do.

Tuesday, April 15, 2008

Execute Sticky

So,
ls -l
filename size date permissions
hosed.dat 900MB March 5, 2009 rwxrwxrwx
chmod -x
chmod +t
ls -l
filename size date permissions
hosed.dat ?? ?? ??
I thought I was crazy, but you must execute your sticky. 'man chmod'
RESTRICTED DELETION FLAG OR STICKY BIT
The restricted deletion flag or sticky bit is a single bit, whose interpretation depends on the file type. For directories, it prevents unprivileged users from removing or renaming a file in the directory unless they own the file or the directory; this is called the restricted deletion flag for the directory, and is commonly found on world-writable directories like /tmp. For regular files on some older systems, the bit saves the program’s text image on the swap device so it will load more quickly when run; this is called the sticky bit.
Yah, swap device.

I'll download your streams.

So, there are these magic pipes with trucks that get clogged if you ram your trucks then the 'premium content' stops flowing. Please, somebody think of the royalties.

"Streams mean not having to necessarily worry about copy protection - although the iPlayer team did have to make a few tweaks when some enterprising souls found a way to hack the streams.

Downloads mean you do have to worry about copy protection."

-Wii becomes home of online video

All of this means linux doesn't get content because the content might catch 'free'.

Saturday, April 5, 2008

Make Work Fallacy

Quite convenient. I've been wondering what to call my critique of the green movement for some time. As I expected, the economists know what they are doing and knew about it all along. You can't pay more for something and claim it is more efficient, it is inherently less.

While it is true the open market defers many costs of good onto the public, toxic waste, deforestation, claiming that less of those at any cost is for the better is a fallacy.

Friday, April 4, 2008

Leprechauns



I am afraid I might have lied to some of you, I am sorry. I will put that behind me today. I might have confused Leprechaun: In The Hood (Leprechaun 5) with Leprechaun: Back 2 tha Hood. I am sorry, I would claim ignorance but it is no excuse. I can only hope you forgive me.

Maybe we can watch both of them together. We will all feel better about putting this behind us.

Thread Local Storage

So, I've been wondering where exactly this magic thread storage comes from. Apparently it is just a symbol type that the thread subsystem will utilize to alloc on thread creation. That is super wacky, but is exactly what I wanted to know. Now I can write my lockless lock contention detector no problem.
__thread bool awesome = TRUE;
Using Thread Local Storage
http://docs.sun.com/app/docs/doc/817-1984/6mhm7pl2a?a=view

STT_TLS in ELF files
http://blogs.sun.com/ali/entry/inside_elf_symbol_tables

This could be complemented with symbol from pointer lookup via dladdr()
http://linux.die.net/man/3/dlopen

Thursday, April 3, 2008

Delicious



Delicious

Wednesday, April 2, 2008

It feels like scripting in windows

#/bin/bash

function echo_cmd {
echo $*
$*
}

echo_cmd cp /dev/urandom /dev/null

Spam or Engineer?

Ha, jeremi is a robot.

http://multidimensionalbit.blogspot.com/