Archive for July, 2009

Reading RSS with python

I have been working on a way that I can get my podcasts downloaded and sync’d to my mp3player by my home server and it was interesting how simple it is to do with Python.

I have been using feedparser module which is very simple to get Fedora users are able to simply install this via yum the package is

python-feedparser

.

If you are not on fedora check you package manager or down load the module from http://www.feedparser.org

Using feedparser is a simple task. First import the module and load your feed into your script like so:

#! /bin/env python
import feedparser 

# Lets import the feed of computer related posts from puredistortion.com.
feed = feedparser.parse('http://puredistortion.com/category/compstuff/feed/')

From here you are able to pull any data that you need from the feed. Feedparser formats the RSS feed into lists ad dictionaries to make working your way through the information a simple task.

For more information on how to extract the data from the feed once you have imported your RSS feed into your script have a look at http://www.feedparser.org/docs.

Or download a script that was the basis for what I am using to download podcasts to my home server here : get_rss.py (87)

Tags: ,

Find Dell Service Tag from the Linux console

I deployed a Dell server down at the datacentre only to realise that I had not taken down the Service Tag number. A quick look on google and I found a simple way to find your service tag via SSH

dmidecode | grep "Serial Number"

Dmidecode shows heaps of information that I have yet to have a closer look at. The command is located in /usr/sbin

Tags: , ,

SELinuxTroubleshhoting from the command line.

I love SELinux and think it is a great way to assist you to ensure services and users are not accessing files and directories they should not be.

I have found the sealert GUI tool to be a great help when setting up and troubleshooting issues on a system, but have always struggled at the command line. Until I found a solution.

 sealert -a /var/log/audit/audit.log

This outputs the text of the sealert GUI to stdout and assists you in troubleshooting where SELinux is interfering with the system.

This is also handy as you can point any file that has audit log entries in it and it will assess this so if you are emailed the log entries. Dump them in a file and point sealert at it.

Also Checkout the SELinux HowTo on the Centos Wiki for heaps of other tips and tricks on troubleshooting SELinux.

Tags: , , ,