Bradley Coudriet trying to make the world better, one line of code at a time.

13Jul/101

Linux SAMBA Server Visualization

In the College of Imaging Arts and Sciences we have deployed a very robust Debian linux Samba server to serve our files to all of our users.
This server is running Debian Linux, with the latest versions of Samba, connect to our EMC AX-4 San over 4GB fiber channel. This server gets hit pretty hard, pretty much all the time.

Other than some basic command line tools, I really couldn't find anything that fit the bill of 'visualizing' how many people were connected to the server: what they were doing, and how many files were open.
So, as with everything we do around here, if it doesn't exist, build it ourselves. The task was to build a interface that would work with our current set of kiosk apps in our office.

To code is no where near ready to release, or portable enough to install on any other system. Right now it is pretty much built just for our environment.

Here is what the end product looks like. I have it running on a monitor on a shelf in our office connected to a Ubuntu machine running Chrome in Kiosk mode.

The block along the top represent the users connect, the bars from the left are the shares that are connect, and how many people (percentage of total) are connected to them.
The red lines inside the bars represent the currently open files in that share.

Any interest from anyone in this becoming generally available?

Filed under: Uncategorized 1 Comment
1Jan/100

Jeep Update – 2009

Well 2009 is gone, and i've decided I need to jot down what I've done to the Jeep thus far.

When i got the Jeep in the summer is it was a very road worthy vehicle, but it had a few problems.

Here is a list of everything i've had to do thus far.

1. Installed a Bikini top for the summer
2. Front Tow hooks
3. Really crappy Harbor Freight fog lights
4. Wheel well mounted tool boxes for storage
5. Full set of new u-joints
6. 4in Rough Country lift
7. new belt! no more squeal!
8. exhaust filler

Filed under: Uncategorized No Comments
1Dec/095

Automatically Download All The Wallpapers From National Geographic [MAC Version]

In my travels today i found a great post from http://www.webupd8.org Its a set up scripts for linux that will download all the Wallpapers from Nation Geopraphic.

Well, it was Linux only and didn't work nativity on my Mac, so i hacked it up and made it Mac Friendly

Original Post: http://www.webupd8.org/2009/11/automatically-download-all-wallpapers.html

My Scripts:
2008 Wallpapers : http://bjcpgd.cias.rit.edu/natgeo/natgeo2008.sh
2009 Wallpapers : http://bjcpgd.cias.rit.edu/natgeo/natgeo2009.sh

To run these scripts. download them to a folder of your choice, remember all the wallpapers will download to that directory.

Open up the Terminal.app from Applications > Utilities

Work your way into your directory structure and you will have to:
chmod +x /natgeo2008.sh
and
chmod +x /natgeo2009.sh

When you are ready just
./natgeo2008.sh

All credit for this script goes back to original Author, i'm just the guy who ported it to Mac.

5Aug/090

A Jeep was a GREAT idea?!

So, I've joined the idiots of the world. I bought a 1993 YJ Jeep Wrangler. This is going to be a project/winter beater. I figure its going to be a good idea to document what breaks, and what i do to fix it.

Already some things are broken, and i'll be documenting them as i get around to it.

Filed under: jeep No Comments
21Jul/090

modrewrite to combat spam attacks

This is a simple ModRewrite i use to combat the file upload, then expand attack that is fairly common with poorly created upload scripts

 Basically this reads, if the request or the refferer contains any of the bad words, redirect it to a script called 'nospam.php' (in the root of your server) and give a 404 error, so the page will be removed from search engines.


RewriteCond %{THE_REQUEST} tnb|torrent|bad-credit|4u|adipex|advicer|baccarrat|blackjack|bllogspot|booker|byob|car-rental-e-site|car-rentals-e-site|carisoprodol|casino|casinos|chatroom|cialis|coolcoolhu|coolhu|credit-card-debt|credit-report-4u|cwas|cyclen|cyclobenzaprine|dating-e-site|day-trading|debt-consolidation|debt-consolidation-consultant|discreetordering|duty-free|dutyfree|equityloans|fioricet|flowers-leading-site|freenet-shopping|freenet|gambling-|hair-loss|health-insurancedeals-4u|homeequityloans|homefinance|holdem|holdempoker|holdemsoftware|holdemtexasturbowilson|hotel-dealse-site|hotele-site|hotelse-site|incest|insurance-quotesdeals-4u|insurancedeals-4u|jrcreations|levitra|macinstruct|mortgage-4-u|mortgagequotes|online-gambling|onlinegambling-4u|ottawavalleyag|ownsthis|palm-texas-holdem-game|paxil|penis|pharmacy|phentermine|poker-chip|poze|pussy|rental-car-e-site|ringtones|roulette|shemale|shoes|slot-machine|texas-holdem|thorcarlson|top-site|top-e-site|tramadol|trim-spa|ultram|valeofglamorganconservatives|viagra|vioxx|xanax|zolus
RewriteRule (.*) nospam.php [R=404,L]

RewriteCond %{HTTP_REFERER} tnb|torrent|bad-credit|4u|adipex|advicer|baccarrat|blackjack|bllogspot|booker|byob|car-rental-e-site|car-rentals-e-site|carisoprodol|casino|casinos|chatroom|cialis|coolcoolhu|coolhu|credit-card-debt|credit-report-4u|cwas|cyclen|cyclobenzaprine|dating-e-site|day-trading|debt-consolidation|debt-consolidation-consultant|discreetordering|duty-free|dutyfree|equityloans|fioricet|flowers-leading-site|freenet-shopping|freenet|gambling-|hair-loss|health-insurancedeals-4u|homeequityloans|homefinance|holdem|holdempoker|holdemsoftware|holdemtexasturbowilson|hotel-dealse-site|hotele-site|hotelse-site|incest|insurance-quotesdeals-4u|insurancedeals-4u|jrcreations|levitra|macinstruct|mortgage-4-u|mortgagequotes|online-gambling|onlinegambling-4u|ottawavalleyag|ownsthis|palm-texas-holdem-game|paxil|penis|pharmacy|phentermine|poker-chip|poze|pussy|rental-car-e-site|ringtones|roulette|shemale|shoes|slot-machine|texas-holdem|thorcarlson|top-site|top-e-site|tramadol|trim-spa|ultram|valeofglamorganconservatives|viagra|vioxx|xanax|zolus
RewriteRule (.*) nospam.php [R=404,L]


 

This simple addition is a nice little tool in your web server admin toolbelt.

7Jul/092

Vmware vSphere – wrong amount of free space reported.

Earlier today we began to upgrade our ESX 3.5 machines to VMware vSphere (esx 4.0) We normally have 3 ESX hosts, one has been offline and retasked to testing our new SAN hardware. We have enough capacity on our esx2 machine to house our entire collection of VM's under nominal load. So, I sent esx1 into maintenance mode, and upgraded it to vSphere.  The install went perfectly, and i got the networking all set up and joined it to our cluster.

Everything seemed good as i started to migrate machines over to esx1, so i could do the same upgrade on esx2... then everything went horribly wrong.

our VMFS is a 4TB lun, in ESX 3.5 land the command vdf reports 1.5TB available. in vSphere land it reports 8GB!!!!!

When we moved machines over to run on vSphere their swapfiles were causing problems and vSphere thinks it doesn't have enough space to run VM's. Luckly before everything went down i was able to get esx2 out of maintenance mode, and migrate all the VM's back to esx2.

Right now our vSphere esx1 is dead in the water until i can figure out why it thinks 1.5TB  = 8GB

Unless i can come up with the answer tonight i believe a call to VMware tech support will be in order for the morning.

 

UPDATE:  We upgraded another esx node to vSphere and it sees the old VMFS disk the same way. I think its a LVM problem, either with our RAID hardware or something corrupt on the old VMFS volume. We've decided to create a new VMFS volume on our EMC AX4 and call it a day. I really HATE sidestepping problems like this. I want to know WHY its broken like this. Grrr.

15Jun/090

Linux logo [FAIL]


linux_logo_fail
Originally uploaded by brad coudriet

This companies use of the Linux logo is interesting to say the least.

Rochester NY, 390 Southbound

Filed under: Uncategorized No Comments
21Jan/090

SPAM SPAM GO AWAY!

It seems the new trend for successfully exploited weak web applications is that they will only show their seedy content to google or other search engines.

They will only be triggered to show their content when they are accessed by GoogleBot from a Google IP (yeah they are getting that specific).
When you click and view a page that google say's is full of Viagra spam, you won't see anything, its tricky and VERY frustrating and hard to troubleshoot.

So far, the common sign i've seen of successful exploits have been:

1. .bak files (installed as wordpress plugins, you have to scour your 'active_plugins' field in the database
2. .pngg .giff .jpgg and .old files, trying to upload malicious PHP and get around unsecure uploaders
3. the use of the base64_decode PHP function, while there are legit uses for this function, it can be a sign of a baddie
4. Use of the 'eval' function in PHP. Also, legit uses are out there, but i've seen it used for the dark side of the force.
5. a 'WordPress' user in your WordPress user table.

If you want to scan a *nix system for the file names i've found to be 'bad' use the following commands.
find -name *_old.php*
find -name *.php.jpgg
find -name *.php.giff
find -name *.php.pngg

To look for those functions i talked about your can use your friend 'grep'

grep -inrH "eval(base64_decode(" <your dir here>
grep -inrH "gzinflate(base64_decode(" <your dir here>

For anyone interested I've recently installed mod_security with their core rule sets on our Apache webserver and after tweaking the config files and creating some white-lists I have be able to ward off a number of baddies and exploit attempts.

http://www.modsecurity.org/

Its worth the hassle of setting it up. It also has a 'detection only' mode which does a great job letting you know what you have running and tweak the rules before it starts to block requests.

4Jan/090

Boxee, you have changed the way i watch media

I've used a number of Media Center solutions for connecting a PC/Mac to my HDTV.

First i used the software that came with my Sony, it did TV recording, but it wasn't a really integrated solution.

I hacked an Xbox at some point and used XMBC, which was a VERY good solution.
For my TV recording i was using a ReplayTV box, sadly, in the Tivo vs, ReplayTV replay was the wrong horse to bet on.

After the XBOX died and the ReplayTV had stopped all future software updates i moved on and actually turned off my cable.

I was using MediaPortal for a while, which was a great product, but my PC started to die.

After my Sony PC started to have memory problems i moved to a G5 running OS X. Front worked as a great simple solution, but it really didn't offer any flexibility.

PLEX was my next solution, which is a very VERY good project. It is a great port of the XBMC project. Its a very good integrated Mac experience, and i like it alot, but i've found a new love when it comes to my TV and PC.

enter Boxee, at the core, its ANOTHER port of XBMC, but... as you start to dig deeper into the application you realized how integrated with the internet this app really is. Everything from its social friend network features, so its use of online reviews and content.

The BIGGEST feature for me is the integration of services like HULU and Netflix. Absolutly amazing. Bring the power of internet streaming video to my big screen TV. Boxee is currently in alpha, and if this is alpha, i can't wait to see the final product! These guys are doing an amazing job, and if you follow them on twitter they are super fast to respond to problems and they keep the community up to date with progress! I found this app right before the christmas season... so its is my favorite APP of 2008!! Keep up the good work boxee!

Filed under: Uncategorized No Comments
2Jan/091

The trials and tribulations of WordPress SPAM

In the past month i've seen a huge increase hacked and spammed WordPress installs.

At CIAS we have 1000+ users accounts with 203 individual installs managed by the students, so i usually try to allow the students the benifit of the doubt that they will update their own software... year... that hasn't been working out so well.

Over the years i've had to update a few accounts which have been hacked or otherwise compromised... but lately, the issue has been getting worse and worse. Last night i did a mass upgrade of 203 installs to wordpress 2.7..

I've created a script that watches the version of every install on the server. Once a new version of wordpress becomes available i will increment the version on the server and hopefully everyone's wordpress will get upgraded just like that. Hopefully i'll be able to keep us from getting hammered with spam.

Another issue we have on the server is poorly written upload scripts which are allowing .php files to be uploaded, and then execuded by the webserver, which then creates a nice little backdoor for hackers to then pepper the server with bad files and crap. Its annoying! LEAVE ME ALONE ;)

 

Tagged as: , , , 1 Comment