So I've been spending a lot of time at work staring into my laptop's screen at work a lot recently.
Little laptop screens are not the best thing for eyestrain, but after some luck I've got 3 unused flat panel monitors in my cube. I've got it plugged into one of them so that I'm not quite so eyesore when I get home each night. Still... using only 1/2 of the available screenage in my cube disturbs me. So I went on a hunt, and found this piece of software. ScreenRecycler allows a (mac only, sorry) computer to use the display of whatever older computer you have laying around to drive a secondary (or third, in my case) monitor into a computer with only one video card. It's much nicer to keep some picture on the displays I've got sitting around.
It uses VNC in order to pipe the video to the remote screen so the refresh rate is not-so-great and 3d is not possible, but it works pretty well for $25. I'm not sure you can do this with (existing software) for a linux machine even....
Read the rest of the entry...
So I'm sitting in my livingroom working on my work stuff and my neighbor comes over. She wants to know what kind of computer she should get because her computer "does not have enough megabits". My neighbor knows nothing of computers it seems.
I followed her into her apartment, and what do I see but one of these:
It's an iMac. As in the ORIGINAL 233mhz, 5GB HDD, 2MB vram, OS 9.2 mac. Its the revision A iMac, in the first released color. It's an antique. *_*
After some discussion, I found out what not enough megabits means. My neighbor had bought a printer at costco and the iMac could not talk to it. She wanted to get a new computer for "cheap as free".
Of course, computers are not free, but with my neighbors it does not matter. They have 5 people living in a one bedroom under one income. It kind of reminds me of my own family actually.
After doing some searching I came to the conclusion that even if they upgraded the iMac to the newest version of the OS that it could run, it still would not drive their printer. Returning the printer was out of the question ... Read the rest of the entry...
Here's a neet trick, given this piece of code:
If (required_function() == false)
exit_program()
I can write it this way, and both have it look nicer and work the same:
required_function() or exit_program()
Function short-circuiting prevents the second from running if the first one resolves to true, so it is only run when it is false. I am throwing away the results of the "or" operator, but in this case we don't care. Read the rest of the entry...
I have had a "few" episodes of spamming on my little corner of the net by some scumbags, who I will not legitimately link to. As a result I have cooked up a bit of code that kills it... a few choice SQL commands run once every 15 minutes should do the trick.
Eat this spammers:
#! /bin/bash
# This backs up my website's content every night
mysqldump -A -u *********************** -p'**********************' > /srv/www/html/backup.sql
touch /srv/www/.blacklist.sql
# This creates a list of things to delete out of a blacklist in the blacklist file
# that file is a space speperated list of words not allowed in posts.
# it will automagically delete anything with that word in it.
echo "USE b2; " > /srv/www/.blacklist.sql
for WORD in `cat /srv/www/blacklist`
do
echo "DELETE FROM wp_comments WHERE MATCH (comment_author,comment_content) AGAINST ('+$WORD' IN BOOLEAN MODE); " >> /srv/www/.blacklist.sql;
done
mysql -u ******************* -p"*****************" \< /srv/www/.blacklist.sql \> b2
# I could delete but as it in not online anyways, whats the point?
#rm -f /srv/www/.blacklist.sql
# also run this manually... in case I want to delete more stuff by hand.
#mysql -u ********************* -p"***********************" \< /srv/www/html/remove_spam.sql \> b2
This place has some good code too :) Read the rest of the entry...
For the non-programmers among you, please ignore this post as it is written in Geek. Wow ... lambda functions are powerful... Take a look at this:
class foo:
__init__():
self.blea = file.open("somefile")
read(self):
return self.blea.read()
close(self):
self.blea.close()
With this code calling close, then read returns an error... However if I add :
close(self):
self.blea.close()
self.read = lambda placeholder: ""
Calling read after close now returns an empty string as the read function has been redefined to be an empty lambda function. This little trick has saved me about 30 try/except blocks in my current project. :)
For those of you that do not program, you may now ... Read the rest of the entry...
Aweayeayea... Looks like the great Microsoft has allowed someone who knows nothing about computers to write an article about "computerspeak"... They are "warning" parents that their kids may be doing bad things, and that the parents should learn "leetspeak". From my point of view this is kinda funny, but I guess they have to start the education plan somewhere. I guess it's the same as a professional stunt driver reading the safety instructions on a new car. Read the rest of the entry...
I went a bit gung-ho with my spamfilter and accadently added the letter \'e\' to my blacklist. :/ It deleted all comments that had the letter \'e\' in them, which was all of them. So, if you arn\'t a spammer please post some new comments to re-populate the species.
If you are a spammer DARN YOU! Read the rest of the entry...
Last quarter I decided that I should learn a \"very high level\" programming language... This quarter I started learning python (for independent study credit ^_^ ), and well... I\'m impressed so far. It seems that you can make a priority queue in like 3 lines of code. Wow.
Not-so-good for OS design stuff, but it does everything that java does, and it does a better job of it. Back to the book. Read the rest of the entry...
The new anti-spam thing is written. Making sure there isnt any.... Read the rest of the entry...
Now the webserver is running SuSe Linux...
Let\'s hope the test post goes through... Read the rest of the entry...
Donno if anyone noticed the downtime... but....
My server was down for the last two days while I finilized transfering the install over to a \"new\" raid array (on old hardware). It is now much less likely that my system will have an untimely death.
now... onto my homework
Read the rest of the entry...
After 3 months of not having internet at home... I\'m baaaack...
Life was in a lull a bit ago, but has now become quite busy. My classes are going to start next week, and I need to beign prepairing for the GRE that I am to take in October. I also need to start my application for graduate school here.
... I\'ll make a nicer, fuller post in a bit, but for now I have quite a bit of work to do...
Read the rest of the entry...
I have moved my desk into another room for the remainder of the quarter, as my room-mate has class at 7:30am...
As a result you can now all enjoy the picture of my hub on my webcam... up to date every second... Read the rest of the entry...
I\'m sure this has already been done, but now that I have some time, and a plethora of unix boxen around, I have been playing with the more complicated aspects of ssh....
Getting around port-blocking on the wireless network by ssh port-forwarding to my desktop unix box can be quite useful...
ssh \"bouncing\" by port forwarding from one machine to another, then to another and so on can also be quite phun... even worse would be starting a remote desktop (wnidows RDP) through such a connection... then connecting to a windows box actually might be secure...
I also found that the java implemenation of the VNC client can be quite a it faster then TightVNC... although I have yet to figure out why that one works
Ahhh the fun of linux... bringing the phun back into computing... now... off to check kernel.org as I think I have a new kernel to compile... Read the rest of the entry...
If you noticed that the site was down over the past few days, its because I forgot to update my DnyDNS when resnet decided to change my IP address.... Sorry bout that...
In other news:
I submitted my site to google for adition into their database... maybe then somebody will find this... ;) Read the rest of the entry...
Thanks to a nicely run perl script my web cam is up and running again... this time on my won web-server so I\'m really hoping that it works, and stays working...
It auto-refreshes once every second if you are on UCSC campus, and once every ten if you are offcampus. The script kindof takes over browsers right now (for those of you on campus) as it refreshes the page, not the image, once every second.
Kudos go out to Matt for writing the perl-script.
The link on the left has been updated to point at the new script-based cam. Read the rest of the entry...
Looks like the folks over at diebold (the makers of the fine e-voting machines that \"lose\" votes) have taken over the polls on slashdot...
Read the rest of the entry...
I got my webcam working again! No HTML for it yet, so a manuel refresh is required for now. Try the link on the side and have phun. ----> Read the rest of the entry...
Got the website back up after a nasty NIC failure in the web server...
A NIC server wont usually cause any damage to the OS\'s software, but when it failed it took down the PCI bus, and apparently Apache was doing something important when the kernel oops\'ed, and halted the system.
:S
In other news... many things are happening right now...
Last weekend was spring break (yeah!)... I spent most of it at work :S, ah well money is good... I spent Friday judging at the Strut Competition... This year was really good, they let elementry students in too... which is kinda scary... They had a group of elementry students that assembled a computer in twelve minutes... SECOND GRADERS!!! arrrgh... what is the world coming to when second graders can assemble a computer? It was really impressive though. Considering what StRUT started from the people there have really done alot with it. Kudos go out to the strut people. Read the rest of the entry...
I\'m in process of reinstalling my laptop, and I have found out that Mandrake 10 is really nice, excet for the fact that it hasn\'t come out yet...
The one thing to remember about beta OS\'s is ... that they are beta... stuff is borken...
KDE in Mandrake 10 is missing some important features, like an e-mail program... Sure, pine works well, but ewww..
Some other things are \"missing\" also, but some things are fixed. X knows how to turn off the screen now, which is a plus. The computer will boot when it is in the base, another plus, and everything that worked still works... I hope.
Being able to post from work on my own computer is kinda nice though ;) Now that I\'ve got this thing somewhat working I need to start working on my homework again. Read the rest of the entry...