NHL Scoreboard Right On Your Desktop!

I LOVE the Philadelphia Flyers. Any time they play, I need to know the score at least every two minutes. If I’m somewhere without a TV, clicking the refresh button for the scoreboard every two minutes is just too much work. So I made python do the work for me.

The script goes to the Flyers (or any other NHL team) website, pulls out the scoreboard and prints it to the screen. Once you add it to conky you’ll have a scoreboard on your desktop. No need for a browser or clicking that refresh button. When the game is in progress the script will update the score automatically, when it’s not in progress it’ll show the date and time of the next game.

The basic idea of the script is:
Set two flags (one before the scoreboard and one after)
Store the substring between the flags into a variable
Break this substring into tokens (Team name, date, time, etc…)
Each token is displayed as the scoreboard

Side Note:
The bad thing about this script is it’ll break anytime the NHL changes their scoreboards HTML. I’ll try to keep it as updated as possible. If they change the HTML i’ll fix it and upload another version. I doubt they’ll be changing it often though. Also, Im using Python version 2.5.2. I havent tested with any other version

If you don’t know what conky is check out my Conky Tutorial

Theres two things you need to add to your .conkyrc file after you download this script.
1. This should go into the TEXT section of the .conkyrc
120 is the interval in seconds for it to update (so every 2 minutes)
Call python and then your scripts location and your teams name as an argument

${execi 120 python /path/to/your/script.py flyers}

2. This needs to go in the parameter section before TEXT.
If you leave this out the script output will look cut off in conky.

text_buffer_size 512

Read the rest of this entry »

No Comments



Awesome System Monitoring with Conky

We’re going to make our Linux desktop look awesome with a tool called Conky. It’s a lightweight system monitor that you can customize to fit with your desktop theme. You can configure how it looks and also what it displays. It can tell you almost anything about your computer (OS,Kernel Version, IP addresses, Fan speeds, CPU Temperature and much much more).

It’s a nice and simple install on Ubuntu. Just run this command in terminal.

sudo apt-get install conky

If you’re running a different Linux you can see installation notes here.

Alright, to start it up hit ALT+F2, type in conky and hit enter. This is what it looks like with the default config…we can make it look a whole lot better. The configuration file is kept in the home folder and it’s called .conkyrc (hit CTRL+H in your home folder to view hidden files and you should see it). If for some reason it isn’t there you can just create your own and save it as .conkyrc. You can also copy mine and change to your liking rather than starting from scratch. This way you’ll have the default structure of the config file.

The config file has two sections, the top is the config parameters and under that is where you tell conky what you want to output. You can set how fast conky updates the info here.

# Update interval in seconds
update_interval 1.0

Read the rest of this entry »

3 Comments



Snort Log Parser

Hey guys, I’d like to share a script I wrote to make reporting simpler for Snort. Snort is an open source intrusion detection / prevention system. It blocks or detects packets based on rules. Its an awesome security tool to see exactly what is going on in your network and offers great protection if you decide to put it in prevention mode. And its all free!

I installed it on my very old compaq computer which runs Ubuntu server edition. Didn’t really have a reason, just wanted to see how it works…will be getting rid of it soon since it slows down the network (Counter Strike and Snort don’t mix).

Anyway, to check the logs I had to ssh to the compaq (that computer has no monitor) and manually go through the logs. Usually the same event would’ve tripped 400 times in a row. Scrolling through all of this and logging into the compaq everytime was a pain. So I wrote a bash script that bundled the same events together, output the number of times they occured and emailed this information to me everyday. Now all I had to do was check my email. I also added a threshold so it would only email rules that tripped at least 20 times.

I’m sure this method isn’t as efficient as some of the other parsers that are out there…but this one’s awesome since I made it! Here it is…

Read the rest of this entry »

No Comments