Hello, Neglected Blog.

Wow. It’s been a long time sans updates. I’m going to try my best to write up some of my recent projects and just what’s been going on in the upcoming weeks. In the meantime, anyone interested in Cybersecurity and Forensics should check out NYU-Poly’s CSAW 2012 and sign up for some of the competitions. It’s a great opportunity to get more hands on experience, and have some fun at the same time.

Posted in: Miscellaneous by Marc Budofsky No Comments

The Start of Summer 2012

I know I’ve been saying that a real post is coming soon for a while now, but life’s been a little crazy lately. I started my summer internship today, so I’ve been busy getting all my paperwork in order for that, and moving into my summer housing. However, I was able to get my order in for a Raspberry Pi a couple of weeks ago, so that should make for some fun projects once its finally shipped out. I’ve also finally gotten my server back online after moving out of Binghamton, so hopefully I’ll have some free time in the next couple of weeks to finalize the FreeNas install and do a writeup – I’ve noticed that a decent amount of traffic to my blog has been coming from HP N40L setup searches, so I’ll try my best to document everything I do to get the most of out the server. I’ve also started to play around with C#, so expect some code snippets to show up in the coming weeks as I dig deeper into it – hopefully all of my programming experience will offset my mild lack of CS knowledge when I head to NYU-Poly for my MS in the fall. I’m also working on a gallery type website for artist to display their work as my final project for the Binghamton Computer Center, so a demo of that will be live shortly after I finish putting everything together. As always, leave a comment if you have any questions or just want to say hi. Until next time…

Posted in: Personal by Marc Budofsky No Comments

It’s Been Fun, Binghamton

As of this past Saturday, I am officially done with Binghamton. After spending 5 years, and earning 2 degrees in the process, it’s come to an end. As much as I’ve said I can’t wait to get out of this place in the past couple of months to friends and family, I’m going to miss it a little moving forward. But, onto bigger and better things. Congratulations to the Binghamton University Class of 2012!

Posted in: Binghamton University, Personal by Marc Budofsky No Comments

Long Time, No Post

It’s been almost 2 months since my last post, so a quick update is in order. Now that the semester is finally winding down and classes are done, I’ll be able to do some write-ups on the final touches that have been made to my server and the other projects that I’ve been working on lately. With regards to the server, its been running nicely with my 8 TB of hard drive space and 8 GB of RAM, but still needs to be tweaked on the software side – specifically it needs MySQL to be functional as a developmental web server. I was able to get VirtualBox running on it, so its a nice trade off for the time being. I’ve also been putting the final touches on The Tech Upload, so check that out in the next few days for some tech blogging. A new e-commerce site might be in the works as well, so stay tuned for some posts about that.

I’ll sit down in the next couple of weeks and make some real posts, but just wanted to get back into the blogosphere after such a long absence.

Posted in: Miscellaneous, Personal by Marc Budofsky No Comments

HP N40L Home Server: The Build

When I originally bought the HP N40L, I had thought the software would be a quick drag and drop type thing, and the actual build would take more time. Unfortunately, configuring a server takes a lot more time that I had originally assumed, so I’m going to outline ‘The Build’ in this post, and save ‘The Setup’ for a later one. The build is pretty simple – the server comes with 4 slot loading hard drive bays, so all you really need to do is procure the 4 hard drives that will be in the server. Unfortunately, with hard drive prices as high as they are right now, getting the drives took me about 2 weeks to finally decide which model to go with, and to work a little bit to actually be able to afford them. I placed an order on Newegg this past Thursday for 4 Seagate Barracuda Green ST2000DL003 2TB hard drives. Being the green series, they spin at 5900 RPM, but offer a 64 MB cache and SATA III connectivity. While I highly doubt my server will ever approach the SATA III 6 Gb/s bandwidth limit, its nice to know there’s some wiggle room built into the system – right now, the largest bottleneck is network speed and my 10/100 Mbps router. I had originally planned on upgrading the RAM to 8 GB at the same time I got the hard drives, but I honestly forgot to add it to my shopping cart before checking out; given that the HDDs almost ran a $500 bill, its probably best to hold off on the RAM for the time being anyway.

So onto the actual install of the hard drives. I received the box from Newegg the beginning of last week. I’m assuming Newegg receives their drives in styrofoam packing with 8 drives per set, as my box contained the styrofoam with 4 drives in it. Unfortunately, I forgot that OEM drives do not come with mounting hardware, so a trip to Unicorn Electronics was necessary to get the mounting screws. After I had all of the parts, installing the drives was a matter of removing the slot loading trays and securing each drive. After that, I simply had to reload the trays and the drives were good to go. I’ll get into the software more in the next post, but I’ll touch on the formatting of the drives quickly now. After the drives were installed and I booted the system up, I formatted each drive and created a software based RAID1 configuration using GEOM Mirror, which is part of FreeNAS by default. Because RAID1 only allows 2 drives to be used at a time, at least for the software based instance I’m using, I set up 2 RAID1 configurations, one for Data and the other for Backups. The drives are shared on the network via SMB and AFP shares, based on what I plan on using them for.

So, like I said at the beginning of the post, the hardware was a quick and easy process. Since I’ve got the drives installed, I’ve been playing with getting the software tweaked properly for the past 2 weeks almost. Once it’s all working properly, I’ll outline how everything is set up in the next post.

Posted in: Hardware, Personal by Marc Budofsky 2 Comments

UpDown UpDown Sorting

Over the past few months, I’ve been working on the new website for The Tech Upload. They launched Phase I about a month ago, and I’ve been trying to finish up Phase II for them. Part of Phase II includes a reddit-like user posting section, with the ability for visitors to vote posts up/down based on how useful/informative it is. Since the site is run by WordPress on the backend, I decided to use some plugins rather than write the functionality from scratch. After some searching, I decided to use the UpDown UpDown plugin to provide the voting functionality, and the Post from Site plugin to keep users out of the backend. Once I had UpDown UpDown working properly on the site, I realized that it didn’t provide any way to sort the posts by votes. I googled around a little bit to find the proper WordPress function to allow a custom query, and came up with $wpdb->get_results(). The query would need to return the published posts for a specific category, ordered by the total number of votes the post has received. With the post being stored in one table, the category information in another, and the votes in a third, it took several attempts to craft the appropriate query.

$query = "
	SELECT p.*, IFNULL((votes.vote_count_up - votes.vote_count_down),0) as PostVote
	FROM $wpdb->posts as p
	LEFT JOIN `wp_up_down_post_vote_totals` as votes
		ON p.ID = votes.post_id
	WHERE p.ID IN (SELECT tr.`object_id`
		FROM $wpdb->term_relationships as tr
		WHERE tr.`term_taxonomy_id` = '##')
		AND p.post_status = 'publish' 
		AND p.post_type = 'post'
$posts = $wpdb->get_results($query, OBJECT);

Line 1:
p is aliased as the posts table – all of the post information is returned from here. PostVote is the total of up and down votes for each post from the wp_up_down_post_vote_totals, aliased as votes. IFNULL() is used in the event that a post has no vote data stored in the table, and avoids having a NULL result returned. This is also necessary for ordering the results.

Line 2:
Set up the alias and determine which table is being queried.

Line 3-4:
In order to not lose any posts that don’t have any vote information, a LEFT JOIN is used to select all of the posts. This line allows the vote totals to be returned properly.

Line 6-8:
Since only one category needs to be queried, this line makes sure that all of the posts are part of the appropriate category. IN is used as an array of Object-ID’s are returned containing all of the posts in the selected category. Replace ‘##” with the taxonomy_id, not the category ID, of the appropriate category.

Line 9-10:
The last part of the WHERE clause is to ensure that the posts returned are of the ‘post’ type and have been published already.

Line 11:
Finally, the posts are ordered by the PostVote, to ensure that the highest voted posts are at the top.

I hope this is helpful to anyone who was in the same position as me. Any questions, leave a comment below.

Posted in: Programming, Tutorial by Marc Budofsky 8 Comments

HP N40L Home Server

For the past 2 months I’ve been debating getting a small server that I could use for wireless Time Machine backups and to store media – in essence, a customizable NAS drive. Today I was checking for the parts that I would need to get, and came across a great deal on the HP Proliant N40L. This was the chassis I was planning on getting, so I decided to finally buy it and get the server underway. Stock, it comes with a 1.5 GHz AMD Athlon II Neo, 2 GB of DDR3 RAM and a 250 GB hard drive. I’ll eventually add 4 x 2 TB drives in a RAID 1 configuration, and 8 GB of RAM, once prices come down a little bit. All of it will be run by FreeNAS, which is an open-source FreeBSD based OS that will provide all of the functionality I could ask for, and probably a little more. Stay tuned for the build and setup in the next couple of weeks.

Posted in: Hardware, Personal by Marc Budofsky 1 Comment

Geektool, v2

I was just looking through the analytics and stats for my blog, and realized that almost 1 year later, my Geektool post is generating the most traffic to my site. Given that I recently got a new computer and began using some new geeklets, I figured an update was in order. I’ll try my best to follow the same format that I used last time – for geeklets that remain unchanged from my old computer to my new one, I will not be reposting the code; please head over to the original post for those geeklets.

And, without any further ado, my current GeekTool setup:

Click to Enlarge

For the most part, it’s almost identical to what I was using on my last MBP. The major changes are (1) ToDo.txt, (2) GCal, and (3) iTunes. I know that I had iTunes embedded on my desktop in the last post, but with Lion now out, the program I was using did not behave the way I was hoping it would. I’ve since switched to a completely GeekTool related way of handling iTunes information. As was the case last time, some of these scripts are not my own – I’ve tried my best to give credit where I can, but if there are any problems, please leave a comment.


Header: echo "ToDo's"
ToDo.txt (Local Copy Only): /path/to/todo.sh
ToDo.txt (Web Synchronized): /path/to/unison todo.prf -silent -auto -batch; sed -i.bak 's/\\//g' /path/to/todo.txt; /path/to/todo.sh

I’ve written about ToDo.txt before, and included some screenshots of how I was embedding it on the desktop. If you only use ToDo.txt on one computer, embedding it on the desktop is as simple as executing the shell script, as shown in the second line above. If you want to synchronize your todo list between your computer and a remote server, you’ll need a copy of unison installed on both systems. In the last line of code above, the first statement synchronizes the text files between both systems, the second statement handles some formatting to ensure everything displays properly, and the last statement prints it out on the desktop. For those who are interested in the web interface, I will try my best to do a write up on it once I’m back at school and settle in.


Header: echo "Calendar"
Calendar Script: Download and change the extension to ‘.pl’
Calendar Script Execution: perl ~/Desktop/Perl/gcal.pl

There really isnt much to say about the Calendar script – it pulls upcoming events from your Google Calendar and allows you to display them on your desktop. If you want to read more about how the script handles it, head over the author’s post for all the details.


Click to Enlarge

Unfortunately, CoverStream stopped working properly after I switched to Lion due to the change from Spaces to Mission Control. Whereas the rest of my geeklets appear to be fixed to the desktop when I move between work spaces, CoverStream looked like an application moving from space to space. I began the hunt for an alternative, and although I’ve lost the album artwork, am very happy with the end result.

iTunes Script: Download and change the extension to ‘.scpt’
iTunes Script Execution: osascript /path/to/iTunesInfo.scpt

As with the Calendar, a simple script is used to display the album information. The only real drawback from CoverStream is that, due to the refresh rate in GeekTool, this geeklet doesn’t operate in real time. That is, if you change a song, it might take a few seconds for your desktop to update with the new information. Check out the original author’s post for some more information on how the script works.

I know there aren’t as many geeklets as last time, but with all of them combined, my desktop has become much more functional. The ability to see my calendar and todo’s without having to open any additional programs is a huge time saver. As always, any questions, please don’t hesitate to post a comment below.

Posted in: GeekTool, OS X, Software by Marc Budofsky No Comments

Late 2011 MBP

As I briefly mentioned in my last post, I recently got a new MacBook Pro as an early graduation present to replace my old MBP. Even though it was a brand new computer, I only upgraded a few components when I purchased it – opting to upgrade the remaining items by myself after. This was mostly due to the fact that a lot of the upgrades Apple offers are insanely overpriced. For instance, going from 4 GB to 8 GB of RAM adds $200 onto the price of the computer. An 8 GB kit of RAM off of Newegg typically runs between $30 – $50, depending on the brand and speed. Additionally, when you have Apple do it for you, they keep the original 4 GB of RAM – when you do it yourself, you can reuse the 4 GB of RAM in a later project.

Anyway, the two main components I decided to leave stock were the hard drive and RAM (if you couldn’t tell already). The RAM I quickly found on Newegg for $30 – it was a G.Skill kit (which happens to be my personal go to brand for RAM) at the same speed as the stock RAM in MBP. By quickly found, I mean the 8 GB of RAM was installed within 3 hours of bringing the computer home. As for the hard drive, I thought I would be able to handle the switch from the SSD in my old MBP to a 7200 RPM drive in the new computer, but quickly came to realize that the speed difference is HUGE. Last week I found a 256 GB Samsung 830 Series on Newegg for $350 – if that sounds a little high to anyone, Apple charges $500 for the 256 GB SSD option, and, again, they keep the original hard drive. After debating if I should just get it already or wait a little longer, I ended up buying it. One interesting thing to note is that the hard drive that came in the computer was 9 mm tall, while the SSD was only 7 mm – there’s no issue using a smaller drive in the MBP, but I was definitely surprised when I placed the drives side by side. Here’s a picture of the SSD fully installed.

256 GB Samsung 830 Series in Late 2011 MacBook Pro

After upgrading the RAM and swapping out the HDD for an SSD, the computer is insanely fast. Not to say it was a slouch before – the quad core i7 is definitely a huge improvement over the Core 2 Duo that was in my old MBP – but the difference between a traditional hard drive and a solid state drive is staggering. The computer is virtually quiet during normal operation, and only audible when the fans kick on if its working a little harder than normal. Overall, I’m loving my new MBP – its amazing how much of a difference 4 years makes in the computer world.

Posted in: Hardware, OS X by Marc Budofsky No Comments , , ,

Another One Down

Just wanted to take a moment and wish everyone a happy and healthy 2012 – I have some new projects in the works, so new posts are on the horizon. Stay tuned!

Posted in: Miscellaneous by Marc Budofsky No Comments