Bennyland this server is running in my bedroom – benny’s learning how to run a linux server

6Jan/110

testing facebook integration

:)

Filed under: Uncategorized No Comments
6Jan/110

GAK! DDClient hack not working

so my "dynamic-dns-support-for-whm-using-ddclient" hack isn't totally working... i only hope i have time soon to come up with a better solution... sigh.

Filed under: Uncategorized No Comments
25Nov/100

off topic…

sorry i haven't written here in a long time... and this is way off topic from what I normally write, but I want to save it on my server so you'll have to bare with me.

Tonight I remembered why. It was amazing, awesome, etc (sorry I couldn't figure out how to write that better). The last few months gave me experience to talk about something and feel useful toward not only an academic but also solid, constructive, and amazingly brilliant mind. I miss it. I love it. And yet in the end it makes me sad today in a way I haven't allowed myself, helped by new context, to be. I now realize why thomas and I were so angry several week ago in a way I hadn't realized before.

Cryptic? Maybe but from now on it has to be that way.

<3 that which I am unable (or unwilling... or perhaps even too naive or just completely stupid) to let go.........

tonight, twice (to two different people even), i called myself an idiot. and over the past few months I've learned more about myself than anything else. more about my capabilities as an individual than i ever let myself know. I've been listening to a lot of "the streets" recently. his "a grand don't come for free" album might be seen as infantile rap to some, but the content is what is important. so i'd like to leave this ridiculously long post with a quote from that album (good thing i don't really understand, or perhaps haven't figured out how to use twitter yet because this would pretty much kill the limit). there is a brilliance in the switch off of "Empty Cans" that brings the entire album to a powerful closure. The first part which contains a lot of anger has a hidden agenda that reveals itself on the rewind... I love it... anyway here's my quote from "empty cans":

No-ones really there fighting for you in the last garison.
No-one except yourself that is, no-one except you.
You are the one who's got your back 'til the last deeds done.
can't have my back til the absolute end, Coz hes got to look out for what over his horizon.
(s)He's gotta to make sure (s)he's not lonely, not broke.
It's enough to worry about keeping his own head above.

Filed under: Uncategorized No Comments
17Mar/100

Extending Piston’s BaseHandler for ForeignKey support

Recently I've started working on an API using Django and Piston for an update to our internal timekeeping stuff (something I've been in charge of for most of the time I've been at VV). I quickly ran into a problem with Piston when trying to create or update models that have ForeignKeys in them. As it turns out, Piston does not support ForeignKey. What follows is my attempt at adding this support as well as support for better REST urls that allow for searching and such. I went this route after reading through this post's responses about this very problem.

A note of caution: I've only very recently started learning Python, Django, and Piston - so it's likely that this isn't the best approach... It's also pretty dirty as I'm currently using a combination of rc and {'status':0, 'statusmsg':'message here'} whenever errors happen... what would be better would be to always use rc.SOMETHING and throw errors that get caught and formatted correctly - I just haven't had time to clean this all up just yet...

13Feb/100

Update: Creating a TrashCan for shell undelete

update: I updated this script so that it would put a number at the end of the file name if it already exists in the trash... it's a slow process (increment from 0 and test until you don't find an existing file) but it works :)

Original post follows:
so a couple of weeks ago I was up far later than I should have been and managed to run the following, as root, in the root directory /

rm -rf *

What I was trying to do is delete a bunch of backup files that my backup script had been sticking in the wrong location (the smart thing would have been to copy the wrongly placed backup files into the correct place, and also not use -rf, but i'm a noob)

So, as you can imagine, after about 2 seconds (the time it took me to realize what had just happened and instantly wake up) the server was foobared. Now that it's been a couple weeks I can actually marvel at how fast rm is, it literally deleted almost everything on the server (everything that wasn't running at least) in a matter of seconds, that's pretty impressive when you are use to deleting things in windows (and I almost always shift delete, a dangerous pattern emerges...)

Anyway, so I had to re-install the OS and everything else. Luckily I had a 5 day old backup of the web and svn contents, and some chrome caches of my blog (which had all of my instructions for getting the server back up and going) so I wasn't fully up a creek. After restoring everything I did some searching around and found a way to replace rm with a move to trash bash script which is complemented by a cron that runs to clean out old trash.

Here's how to get the same thing

12Feb/100

New HD

The hard-drive on my desktop started having S.M.A.R.T. errors yesterday so I went and picked up a WD Caviar Black and threw 64 bit Win 7 on it. Turns out the HD I had was still under warranty, so there will be another 500gigs coming my way sometime in the future... I'll have to figure out what to do with it!

I have another tutorial on how to get the latest python running in CentOS 5.4 - hopefully I'll finish writing that this weekend.

Filed under: Uncategorized No Comments
11Feb/100

I’m learning Python

As the subject of this post suggests, I'm learning python. I was going to go out to the local bookstore today to buy a book on python (I normally just try to learn things on my own, but I'm unfortunately in a bit of a hurry and am finding it difficult to find useful tutorials online) but it turned out I didn't need to. Dive Into Python is available free online, or in book form, as well as Python for Software Design - How to Think Like a Computer Scientist I'm midway through chapter 3 in Dive... and my inability to stay focused has caused me to write this post.

I love free :)

Yesterday I hooked up a post-commit script in my svn repository that automatically publishes the python code I'm currently trying to write. It's pretty cool as it allows you to source control your web(site/apps) I'll post later on how to do such a thing.

Tagged as: , No Comments
6Feb/102

Serving ASP.NET pages in Apache on CentOS 5

I'm starting to love ASP.NET and the ability to do everything in C# (I'm currently working on an internal silverlight app at work and creating a RESTful API is more fun in C#). Anyway, you can do a yum install mod_mono, but it's a pretty old version so I did some research and found a guide on building it yourself along with two other guides that were roughly the same, but not as good... (1, 2) and somehow ended up with a working server. This is a companion to that guide with more up to date versions of things. (it took me SEVERAL trial and error attempts to get things working :/ so hopefully i didn't miss any steps)

Let me preface this with the fact that if you're running one of the already supported OSs (debian or unbuntu for instance) you shouldn't follow this guide - instead you should just look on the mono website for information.

20Jan/100

Dynamic DNS support for WHM using ddclient

The server which I use to use to host my websites is now primarily used as my DNS and also a backup ftp space for this server to store backups (that way I don't have to buy some sort of tape backup thing). This is great except for the fact that my IP changes a couple of times a year. Up until now I was pushing requests from the webhost's DNS to dyndns and then to my home server running ddclient to update dyndns. Of course I could have paid around $30 a year per domain but I'm cheap.

So I modified ddclient so that it would update my host's DNS server. My host uses cpanel/WHM which luckily has a JSON API!

Here's how you can make the same modifications:

18Jan/102

Installing Trac and Subversion on CentOS5

Installing Trac and Subversion on CentOS is pretty simple.

First, you need to install subversion - it was automatically installed for me already when I installed the OS, however I wanted to update it and found out that I couldn't do so until I deleted the i386 version.