jonEbird

February 7, 2012

Upgrading WordPress to 3.3.1

Filed under: blogging,emacs,usability — jonEbird @ 8:36 pm

Upgrading WordPress tonight from version 2.6.2 to the latest version 3.3.1. About time, right? Funny enough, my motivation was when I was configuring org2blog and noticed the URLs it was trying to hit were non-existent. That was my first clue that I needed to update. For the most users, I’d suggest following the very well documented Upgrading WordPress documentation, but I thought I’d show you how I do it. (Read: This post is pretty much for my own reference for the next time)

  1. Grab the latest wordpress release
upgrade_dir=wordpress_upgrade_$(date +%Y%m%d)
mkdir ~/${upgrade_dir} && cd ~/${upgrade_dir}
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
  1. Following along with the Upgrading WordPress documentation.
  2. Take a backup of the current install.
mysqldump -u root -p wordpress > wordpress.dump
# Using the contents of the extracted latest.tar.gz WordPress release as my tarball file list
\ls wordpress | xargs tar -C /var/www/html -czf wordpress_backup.tar.gz
  1. Now for the actual manual upgrade
WPH="/var/www/html/" # My WordPress Home (WPH)
rm -rf ${WPH}wp-{includes,admin}
rsync -av wordpress/wp-includes ${WPH}/
rsync -av wordpress/wp-admin ${WPH}/
rsync -av wordpress/wp-content ${WPH}/
(cd wordpress; for f in *; do if [ -f "${WPH}/${f}" ]; then echo "Updating $f"; cat "${f}" > "${WPH}/${f}"; fi; done)
  1. Re-log into your site and proceed with the DB upgrade.
    Since my versions were so far off, the first thing I was greeted with upon login was a button to update the DB.

All done. The good news is I can now successfully log into my blog via org2blog plugin. Here is my elisp excerpt:

;; Setting up org2blog (Installed via ELPA)
(require 'org2blog-autoloads)
(require 'netrc)
(setq blog (netrc-machine (netrc-parse "~/.netrc") "jonebird" t))
(setq org2blog/wp-blog-alist
      '(("jonebird.com"
         :url "http://jonebird.com/xmlrpc.php"
         :username (netrc-get blog "login")
         :password (netrc-get blog "password")
         :tags-as-categories t)))
(org2blog/wp-login)

Now to post this, I believe I’m supposed to M-x org2blog/wp-post-subtree. Well, that worked well and posted this as a draft. I noticed a few markup problems and after fixing them, I can finalize the posting via C-u M-x org2blog/wp-post-subtree. 2012-02-07 Tue 20:36

December 29, 2011

Installing emacs v24 on Fedora

Filed under: adminstration,blogging,emacs,linux,usability — jonEbird @ 10:05 pm

I’ve been reading about other people giving the yet to be release version 24 of emacs for some time now. When I decided to upgrade my systems to use v24, I was a bit surprised to not find anything about configuring a Fedora system to use v24 of emacs. Guess I gotta do it myself…

This tutorial is part editorial and part instructional. I thought it would be helpful to include some of the techniques I used to get emacs up and running quickly without needing to pull my hair for other’s edification.

After realizing I wasn’t going to be able to just grab a pre-built binary, I went looking for the official sources. I ended up finding the pretest download location. First step first, let’s pull down the latest emacs-24 tarball and extract it.

PRETEST_URL="http://alpha.gnu.org/gnu/emacs/pretest/"
FILENAME=$(curl -s ${PRETEST_URL} | sed -n 's/^.*a href="\(emacs-24.[0-9\.]*tar.gz\)".*$/\1/p' )
curl -o ${FILENAME} ${PRETEST_URL}${FILENAME}
tar -xzof $FILENAME
cd ${FILENAME%.tar.gz}

If that worked, you are now sitting in the extracted directory of the latest emacs-24 pretest source. Now for some instructional information. Any significantly large project will need a decent amount of development packages installed for a successful compile and that can be a pain to identify. Earlier I claimed that I didn’t pull my hair out which means I cheated. I grabbed the latest Fedora source rpm. I didn’t actually want to install the src.rpm but rather extract the emacs.spec file which will act like a blueprint for my build. I’m going to give you the answer later but if you’d like to know how to extract the specfile, try this:
Note: You do not need to do this step. Instructional only.

SRCRPM=~/Download/emacs-23.3-7.fc16.src.rpm
# Your SRCRPM may differ depending on what you end up downloading.
mkdir tmp && cd tmp
rpm2cpio $SRCRPM | cpio -ivd
sed -n -e 's/,/ /g' -e 's/^BuildRequires: //p' emacs.spec | xargs sudo yum -y install

Note the last command in that section was a command to install the necessary development packages for our build. Since I”m not requiring you to do that above, here is the command for you:

sudo yum -y install atk-devel cairo-devel freetype-devel \
  fontconfig-devel dbus-devel giflib-devel glibc-devel gtk2-devel \
  libpng-devel libjpeg-devel libtiff-devel libX11-devel libXau-devel \
  libXdmcp-devel libXrender-devel libXt-devel libXpm-devel \
  ncurses-devel xorg-x11-proto-devel zlib-devel librsvg2-devel \
  m17n-lib-devel libotf-devel autoconf automake bzip2 cairo texinfo \
  gzip GConf2-devel alsa-lib-devel desktop-file-utils python2-devel \
  python3-devel util-linux

The other part of the specfile you’ll typically want to look at, if you’re cheating like me, is the %build section. That is where you’ll find the actual commands used to configure and build the binaries. There I found the configure switches used so I don’t have to pick out which ones I’ll need. Again, just like figuring out the development packages, figuring out configure options can also be a chore. Let’s get to configuring, building and installing it now.

./configure --prefix=/usr/local/emacs24 --with-dbus --with-gif --with-jpeg --with-png \
  --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk
make
./src/emacs --version # Look good? The INSTALL doc suggests testing: ./src/emacs -Q
sudo make install

Well, that worked for me and hopefully it worked for you too. If you noticed, I used the --prefix=/usr/local/emac24 option above on my configure line which means everything got cleanly installed down it’s own separate base directory of /usr/local/emacs24. Since you won’t want to use that path explicitly each time you launch emacs, we’ll have to inform Fedora of our new altenative.

sudo alternatives --install /usr/bin/emacs emacs /usr/local/emacs24/bin/emacs 20000
sudo alternatives --install /usr/bin/emacsclient emacsclient /usr/local/emacs24/bin/emacsclient 20000

And there, we’re done. Congratulations. You have installed emacs version 24 on your Fedora system. Let me know if you’ve had any problems or have a better recommendation.

December 23, 2011

Installing Pithos on Fedora within a Virtualenv

Filed under: adminstration,blogging,linux,python,usability — jonEbird @ 12:40 pm

I listen to a lot of music while at home. I am a Pandora user and have been very happy with my Pandora One subscription now for over two years. The machine used for playing my music is what I call my “media PC”. It is called that because this machine sits in my entertainment stand and is connected to my Sony receiver via HDMI making the multimedia experience as good as I can get. If you put those two facts together, you can see that I am staring at my desktop a lot and I thought it would be nice to integrate my TV into rest of the decor of the house. I primarily do that by being very selective in finding desktop pictures and generally clearing off the desktop of any clutter. Think of the large 47″ LCD television as one big painting for the living room.

Which leads me to my one, sole problem with Pandora: I like to look up and read the Artist and Title of the track being played but I don’t want the browser to also consume my visual space. (I also don’t want to mess around with Adobe Air for the desktop version of Pandora) Enter Pithos. By this point, I should point out that my media PC is running Fedora Core 15 and I’m a Gnome user (let’s not talk about Gnome3). That is important because Pithos was written for gnome users.

Pithos is great. It’s a simple UI design, still allows for normal Pandora song control, easy drop-down for my stations, can still star (thumb’s up) songs all the while being small and unobtrusive. And now we are to the subject of this blog post: Installing Pithos on a Fedora Core machine.

This installation guide will follow my other guides in the same “copy & paste” format. That is, below you should be able to simply open a shell, copy the block of shell code and paste it into your terminal and be ready to launch Pithos. The one configurable item I left in there is whether or not you’d like to install Pithos within a virtualenv or not. I won’t go into detail about what virtualenv is for this discussion, but suffice to say that you’d choose it if you want to install Pithos in a alternative path that you own instead of /usr/local/bin/. Below, when you copy & paste the instructions to install Pithos, you can simply leave out the variable "I_LOVE_VIRTUALENV" or change the value from anything but “yes” to install the “normal” way. I choose to install via virtualenv to 1. keep my system site-packages clean and 2. also keep /usr/local uncluttered. When I do this, I mostly only have to worry about backing up my home directory between rebuilds.

Again: If you’d like to use virtualenv, keep the "I_LOVE_VIRTUALENV" variable set to “yes”.
Furthermore, using virtualenv you can control the env path via setting the VIRTUALENV variable. Some people have a separate directory for their virtualenv’s. E.g. VIRTUALENV=virtualenvs/pithos
(Copy and paste away!)

# Keep this variable to install within a virtualenv.
#   otherwise, skip this line or change from "yes" to anything else.
I_LIKE_VIRTUALENV="yes"
VIRTUALENV="" # Set this to control where your virtualenv is created
# --- Rest is pure copy & paste gold ---
sudo yum -y install python pyxdg pygobject2 \
  gstreamer-python notify-python pygtk2 dbus-python \
  gstreamer-plugins-good gstreamer-plugins-bad \
  bzr python-virtualenv
# FYI, those last two are not direct requirements but tools to complete this
cd; bzr branch lp:pithos pithos
if [ "${I_LIKE_VIRTUALENV}" == "yes" ]; then
  virtualenv ${VIRTUALENV:-pithos_venv}
  source ${VIRTUALENV:-pithos_venv}/bin/activate
  # The money shot... finger's crossed
  cd pithos; python setup.py install
else
  cd pithos; sudo python setup.py install --prefix=/usr/local
fi

And there you have it. A clean, aesthetically pleasing music experience. Enjoy.
Desktop Shot with Pithos

October 3, 2011

Customize Gnome Terminal in Gnome 3

Filed under: linux,usability — jonEbird @ 7:56 pm

I recently upgraded to Fedora 15 on both the laptop and the home server and I’m still getting used to Gnome 3. Through each frustrating change, I have decided to stick with it and try to learn the new ways to do things but I have been tempted more than a few times to just switch to using XFCE. Today’s challenge: Customizing gnome-terminal.

In the old days, the customizations I would do all involved edits that could be done by updating the default profile (Menu->Edit->Profiles). The main things I would update is setting my background to a certain percentage of transparency, disable scroll bar (because we’re all using GNU screen, right?), and disable the menubar by toggling “show menubar by default in new terminals” (alt-f is reserved for emacs forward-word and not File menu). The remaining item to update is the default geometry or size of the terminal when it’s launched.

Perhaps I should blog more because I found a much easier solution than I expected. When I decided to figure this out tonight I started by finding a nice tutorial for updating gnome configurations and I thought I was going to end up recommending the following command:
gsettings set org.gnome.desktop.default-applications.terminal exec-arg "'--geometry=120x35'"
Instead, while writing the previous paragraph I realized that within the profile settings there is an option now to “Use custom default terminal size”. I feel stupid but I think I’m just stubborn in my ways after using Gnome for over a decade.

July 10, 2011

64bit Google Chrome with Flash on Fedora – Take2

Filed under: adminstration,linux,usability — jonEbird @ 10:08 am

Early last year I wrote up my procedure on getting Chrome setup with Flash on a 64bit Fedora Core 13 build. It is now dated and I hope people are not still using it. However, if you like the copy & paste style of my direct installation guidelines, I thought I’d give an updated post after a recent Fedora Core 15 install.

First things first, we still need to create new Yum repositories like we did last time. The biggest difference between last time is I would no longer recommend installing the beta build of Chrome and Adobe has moved the 64bit flash player out of a lab project to an official release. The fine folks working on the Fedora project have lend their help in instructing people on how to setup Flash as well and you may want to check that page for a more detailed explanation on what we’re doing. In particular, I’ll be using a repository which is being hosted by Fedora member leigh123linux.

Here is the final copy & paste version: (Like last time, if you are already root, take out the “sudo”)

# Creating the Google repo
cat <<\EOF | sudo tee /etc/yum.repos.d/google.repo
[google64]
name=Google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
EOF
# Slip this guy in here... who doesn't want the gchat plugin?
cat <<\EOF | sudo tee /etc/yum.repos.d/google-talkplugin.repo
[google-talkplugin]
name=google-talkplugin
baseurl=http://dl.google.com/linux/talkplugin/rpm/stable/x86_64
enabled=1
gpgcheck=1
EOF
# Now to install the latest flash release yum repo from "leigh123linux"
leighURL="http://www.linux-ati-drivers.homecall.co.uk/flashplayer.x86_64/"
latest_release=$(wget -qO- $leighURL |\
sed -n '/flash-release/s/^<LI><A HREF="\([^"]*\)".*$/\1/p' | sort -n | tail -1)
sudo yum -y localinstall --nogpgcheck ${leighURL}${latest_release}
# Actually installing Chrome and the Flash player
sudo yum -y install google-chrome-stable google-talkplugin flash-plugin
# Creating a plugins directory
[ ! -d /opt/google/chrome/plugins ] && sudo mkdir /opt/google/chrome/plugins
sudo ln -s /usr/lib64/flash-plugin/libflashplayer.so /opt/google/chrome/plugins/

If you noticed, I slipped in the Google chat plugin. That is the necessary RPM for enabling video chat. If you really didn't want it installed, simply run "sudo yum erase flash-plugin". Enjoy your surfing.

May 28, 2011

Custom Dropbox Directory

Filed under: blogging,linux,usability — jonEbird @ 10:38 am

Ever since I rebuilt my laptop I’ve keep a file called “rebuild.txt” where I detail every little customization I’ve done. The requirement is that everything that I do has to be completely command line oriented where a block copy-and-paste would redo the same customization. So far I have things documented like setting up my local email routing, autologin to the laptop, additional RPMs w/ extra repositories, iptables rules, GTK configs, etc. The latest customization I’ve performed is when I finally decided to setup Dropbox.

I like Dropbox for it’s simplicity and the fact it integrates well with Linux. My only problem was that the directory I really wanted to have synchronized was my ~/projects/ directory. I actually didn’t do any google searches on how to change it before diving into figuring it out. I figured Dropbox would create a dot-file directory to stuff configuration and found that at ~/.dropbox/ and after that it didn’t take too much work to reverse engineer the setup.

So, here is my addition to my “rebuild.txt” file for how I would redo my Dropbox setup:
(Note: I’m running Fedora 13 but that fact really only applies to how I was installing Dropbox)


cat <<\EOF | sudo tee /etc/yum.repos.d/dropbox.repo
[Dropbox]
name=Dropbox Repository
baseurl=http://linux.dropbox.com/fedora/$releasever/
gpgkey=http://linux.dropbox.com/fedora/rpm-public-key.asc
EOF

# Now install
sudo yum -y install nautilus-dropbox
# After installing, I did launch dropbox and setup an account.

# Stop dropbox
pkill dropbox

# Modify the default location?
cp -p ~/.dropbox/config.db{,.orig}
echo "update config set value = '/home/jon/projects' where key = 'dropbox_path';" |\
sqlite3 ~/.dropbox/config.db
rsync -av ~/Dropbox/ ~/projects/

# now start dropbox again
~/.dropbox-dist/dropboxd

After setting it up, I finally realized I could have google'd this and I did for curiosity sake. A common technique I saw was around using symlinks, but I found it fun to reverse engineer their configuration and was pleasantly amused that they didn't try to obfuscate the config. At this point I should probably stop poking around because I can see that the client is written in Python and I'm now finding other interesting things about the client.

June 24, 2009

Emacs Registers and Bookmarks

Filed under: blogging,emacs,usability — jonEbird @ 5:02 pm

Every once and a while I like to re-read manuals about pieces of software which I already feel quite comfortable in using in hopes to learn a new trick or two. Today, I was browsing the freely available GNU Emacs Manual and was breezing through it until I hit the registers section.

Have you every copied a region of text in plans to yank it back in multiple locations within your current buffer but in between this work, you realize you need to do some intermediate killing and yanking and therefore have overwritten your original region of text you had copied? Well, using registers is one way in solving that problem.

Bookmarks have a similar function as with registers within emacs. I am actually grouping them together in this weblog because their key sequences are so very similar. Bookmarks are, like the name implies, a way to keep track of position within a buffer. They can be saved and later referenced to not only re-open the particular file you were editing but take you back to the position within that file as well.

I can not seem to remember anything, from emacs commands or keystrokes to basic shell commands, without coming up with some mnemonic for memorizing it. I have just came up with one such mnemonic for using Registers and Bookmarks and I thought I’d share it with my bots (machines which read this weblog).

Register and Bookmark Mnemonics

Each key sequence starts with:
C-x r – Think “r” for register.
The general pattern is:
C-x r <key> <register> – “register” is any single digit or letter.

“key” is what I’m calling each category of register usage. Let’s explore them:

  • “<space>” – mark – Just like C-spc to set the mark, this asks that the mark be set in our register.
  • “s” – save – save the region’s text into the register.
  • “n” – number – save a particular number into the register.
  • “m” – bookmark – We’ll explore bookmarks further, but notice how you set bookmarks with what I consider the register key sequence.

Those are some of the basic storing actions, but with the same C-x r prefix you can perform other actions with the contents of the registers:

  • “+” – increment – When the register is a number, this increments it’s value. Convenient to use with macros.
  • “i” – insert – This action can be used for numbers, regions of text and even marks!
  • “j” – jump – jump to a mark. This assumes you have already stored a mark in the particular register.

We’ll shift a bit into bookmarks but stay succinct within the mnemonics section here.

  • “m” – bookmark – Repeated from above. Note that this is a interactive function which allows you to name your bookmark with an intelligent name. The default will be the basename of your current buffer’s filename. So, if you’re editing /path/to/emacs_notes.txt it will default to store the bookmark under “emacs_notes.txt” but maybe you want it to be called “emacs notes”. If so, go ahead and type that out and hit RET.
  • “l” – list bookmarks – This opens a new pseudo buffer with the list of all of your bookmarks.
  • “b” – bookmark jump – Jump to the named bookmark. This is a interactive function as well.

Bringing it Together – Examples

Save current mark to register “l”:
C-x r <space> l
Move to mark saved in register “l”:
C-x r j l
Save number in register “n”:
C-x r n n
Now, increment that number and then insert it:
C-x r + n C-x r i n

Love the emacs notes you’re editing, bookmark it:
C-x r m emacsnotes RET
Buried into multiple install READMEs for a particular product and want to return later:
C-x r m installreadme RET

Finally, the prettiest of the commands, let’s review our bookmarks:
C-x r l

Final Note on Registers and Bookmarks

There is a variable named bookmark-save-flag which when set to the value of “1″ will have the action of automatically updating your ~/.emacs.bmk file with any updates to your bookmarks. I recommend setting this in your ~/.emacs file so you don’t have to “M-x bookmark-save” periodically. Add the following to your ~/.emacs file:
(set-variable (quote bookmark-save-flag) 1 nil)

Finally, I’d be remiss if I didn’t mention how I generated that one-liner emacs-lisp line, even if it’s off topic for this weblog entry. I like to use various interactive functions and then capture their effective execution, in emacs-lisp form, via the “repeat-complex-command” function which is bound to “C-x M-:“. In this situation, I used the “set-variable” interactive function to set “bookmark-save-flag” to “1″ and then punched in “C-x M-:” and copied the one-liner for my ~/.emacs file. So, there you go, a bonus tip for those who’ve read this far.

November 22, 2008

andLinux

Filed under: linux,usability — jonEbird @ 10:02 am

For years I thought the best way to enhance my Windows experience, with the common Unix/Linux tools I’m most comfortable with, was to do so with cygwin. That was until now. At work, where we are forced to use Windows, I recently had my laptop rebuild and afterwards my re-install of cygwin wasn’t going too well. Finally fed up, I then recalled seeing reviews about colinux and how it was advertised as being tightly integrated into the Windows experience. Before looking for the install media, I then saw that there are a couple of distros which are then built on top of colinux. One of which, andLinux, is a full Ubuntu release and I presumed that their layering on top of colinux was naturally providing additional support and/or features and decided to go with andLinux for the install.

After completing the install, I must say, I am very pleased and impressed with the work they have done. I’m not sure how much of the credit goes to colinux and how much goes to andLinux, but they both get a A+ in my book. Here are my top reasons for choosing andLinux over cygwin:

  1. Full Linux operating system running on top of Windows.
    Not actually being virtualized and is therefore quick. It is a special patch to the Linux kernel which allows this tight integration with winblows.
  2. Each window / app launched takes the same look&feel decorations as each other windows app.
    Translation: Doesn’t look like crap.
    Also, each app’s icon is properly displayed in the task bar instead of the same, repeated icon used in cygwin.
  3. Transition from wired to wireless is seamless.
    This was a piece a co-worker asked me to test out and I’m writing this up while on my wireless network at home. After suspending my laptop at work, I then un-suspended it at home and I didn’t have to touch a thing. My existing terminal window could still query hosts and I even tested an install of a quick package.
  4. It’s running Ubuntu.
    Means to get additional apps, which you might be missing, you get to do "apt-get install <missingapp>" instead of re-launching setup.exe.
  5. Clean terminal.
    What is this bullet point doing here you ask? Well, it is what motivated me to move away from cygwin in the first place today. I was previously trying to use mrxvt and after multiple issues, decided to punt.
    The default terminal appears to be gnome-terminal and yet I choose the XFCE version over the KDE version.
  6. Xming X11 Server included.
    No need for hummingbird’s crappy X server. This is discrete and works very well.
  7. Automatic TAP (bridged) networking configured.
    There is about 4 screens used during the install and none were about networking. Just works.
  8. “cofs” filesystem
    My C:\ drive is mounted at /mnt/win via their ‘cofs’ filesystem. Sweet.

If you are like me and are stuck using Windows for whatever reason, I would highly suggest checking out andLinux. They are currently in beta but I’m okay with dealing with any minor hiccups. I have used it for only two days and already feel light-years away from my previous cygwin days.

November 6, 2008

2D Barcodes

Filed under: blogging,usability — jonEbird @ 12:06 am

In anticipation of heading down to PyWorks 2008, I have been thinking about creating a business card for the sake of keeping in contact with people I meet. One of my main goals, while attending and speaking at PyWorks, is to network with people and mark 2008 as the year which I start participating and contributing within the OSS community. While exercising my creativity in designing a nice business card, I have also been reading about Google’s android mobile platform, and I came across a interesting intersection between the two when I saw a demonstration video.

A Google developer, working on the zxing project (pronounced “zebra crossing”), has printed a 2D barcode encoding of his personal information on the back of his business card. With the builtin camera, on his android phone, he can scan in a barcode and immediate use the encoded data. It is an impressive demonstration of integrating technology with our mobile devices. Check out the video which has inspired me to not only do the same but also write this small informational note about 2D barcodes.

If you didn’t catch it, the format of the 2D barcode on his business card is QR Code. Among the other 2D barcode formats, QR Code barcodes are most popular in Japan where it was invented by Denso-Wave. The popularity of QR Codes in Japan has grown to the level of being supported by nearly every mobile device there and that also means finding QR Codes available on a increasing amount of printed media from fliers to magazines and coupons.

There are other competing 2D barcode formats that I could choose from but after doing researching and not seeing any distinctive advantages, I have concluded to follow suit with the google developer and hope that the android phone’s application and popularity will help propel QR Code’s popularity over the other 2D barcode formats.

Since 2D barcodes are nothing more than encoding and decoding data, the first thing to decide is what data we would like to encode. Since I actually do not have a business of my own and furthermore use a work issued phone, the data I encode will probably be a URL of my website. There are other interesting encodings, though, which include email address, sms, geographic locations, etc. See zxing’s wiki about BarcodeContents for a better discussion for suggested format, including their primary suggestion of using the MECARD format which is typically a composite of Name, Address, Phone number and Email address.

Once you know what you would like to encode in your 2D barcode, I’m guessing you will need software to help with that. With the assumption that you are not going to be encoding/decoding barcodes with a large frequency, my suggestion is that you use online utilities to help you. Interestingly, it turns out that the google chart api can now generate QR Code online. That is both convenient for repeated generation of QR Code but also in dynamic generation of barcodes. But alas, Jason Delport has created a google app engine application to record your text and generate the QR Code for you by generating the google chart api link for you. At that point, you can either use the supplied URL or simply download the png image. Finally, for performing online decoding of the barcode I have found the zxing online decoder to be the best and least intrusive one available.

The main reason 2D barcodes have not really taken off here in the States is because people have not yet came up with a really good idea to propel it into the mainstream. That, my friends, is going to be up to you and me to accomplish. Or, wait, we could just let google usher it in for us? But seriously I think support for mobile devices to read 2D barcodes is great step forward. Afterwards, I can envision graphic designers coming up with clever barcode prints and ways of intriguing people to scan the code for more details, but then it would be people like us who come up with new categories of data to be encoded in the barcodes for new, innovative ways to use them.

To learn more, try the collection of interesting links provided again by the zxing folks.

October 25, 2008

PyWorks Stuff

Filed under: adminstration,python,usability — jonEbird @ 12:00 am

For the 2008 PyWorks convention, I will be presenting about LDAP and Python. The presentation is really about demystifying LDAP and encouraging people to use and extend LDAP for their config file needs. In efforts to make my point, the last half of my presentation will be a time for a demo. This entry is your basic landing point where you can download the scripts, presuming you are looking for a copy of the scripts and/or slides after seeing my presentation? (oh! nevermind, your google search landed you here)

PyWorks Speakers Badge

For the demo, I will be leveraging the fail2ban project. It is a python based application which scans typical application logs for security failures and bans IPs from being able to connect again. It also uses the builtin ConfigParser module for reading it’s 30+ config files, which is why I have chosen to use it. For the demo, I have created two scripts:

The first one, configparser2ldap.py is used to process a set of config files and automatically generate LDAP schema as well as LDIF data.

Next, I have my ldapconfig.py module where I extended the ConfigParser module to support making queries to LDAP. I am basically overriding the read() method only and leaving the rest of the module alone. This way the only modifications to the fail2ban application are how it is instantiating the ConfigParser and I won’t have to become a full time fail2ban developer if I want to centralize the configuration data in LDAP.

And that is really the main point of my presentation: The power of centralizing your configuration data and how it can drastically change how you administer your large scale server farm.

Downloads

LDAP + Python Slides.

configparser2ldap.py script to auto-generate LDAP schema and LDIF from ConfigParser compatible config files.

ldapconfig.py python module which inherits the ConfigParser and supports optionally pulling config data from LDAP.

Next Page »