Category: Open Source Software

  • Decode base64 text using perl from the command line

    I recently ran into an issue where I needed to decode some base64 text from the command line and used perl to manage the task: perl -MMIME::Base64 -ne ‘print decode_base64($_)’ < /tmp/input.txt RE: http://perldoc.perl.org/MIME/Base64.html

  • Removing memberUid from OpenLDAP group

    The following syntax can be used to remove a user from an OpenLDAP group: $ ldapmodify -x -D “cn=manager,dc=example,dc=com” -W <<EOF > dn: cn=sshusers,ou=groups,dc=example,dc=com > changetype: modify > delete: memberUid > memberUid: previousMember > EOF

  • VIM Control Characters – search and replace

    Control characters require an escape sequence prior to using in a search and replace operation in VIM. In Linux, the escape character is Ctl-v. Windows requires a Ctl-q. Remove all ^M characters from a file on Linux: %s/^V^M//g Remove all ESCAPES (\27, ^[) from a file on Windows: %s/^q^[//g

  • Bash Tip! Renaming files using Bash string operations

    To rename all html files in a particular directory to shtml files, use the following loop: for file in *.html do mv ${file} ${file%%.html}.shtml done This uses the ${variable%%match} format which strips the longest match from the end of the variable.

  • Persistent Debian Daemons

    As a long time Redhat / Fedora user, starting daemons on system boot in Debian has been a mystery.  I recently took the time to search for the answer, rather than placing the start command in the rc.local file and it’s not that bad.  As long as the init script exists in /etc/init.d, run the […]

  • Replacing a MySQL Master Node

    I recently had to build out a new MySQL node and replace an existing replication master.  Here is the basic procedure that I followed. 1. Build out the new server 2. Install MySQL.  Place the data directory on a logical volume with at least 10% free space in the volume  group (for snapshot backups). 3. […]

  • Sony Cybershot with Fedora 9

    While attempting to dump some photos from my newly acquired Sony Cybershot camera onto a Fedora 9 workstation, I had to switch to “Mass Storage” mode on the camera before I was able to mount the volume. When I inserted the USB cable into my camera and turned it on, the dmesg output was as […]

  • MySQL: MyISAM Table Gotchas!

    I’ve recently had to learn a lot about MySQL and how to manage it effectively, especially after it has not been managed very well for a long time. As a Linux Administrator I’ve had the opportunity to use MySQL in many roles over the years but never at an enterprise level. I’m still learning and […]

  • vi Tip of the day!

    Something that I need to do frequently is to set some text to lowercase in vi which is currently in mixed or upper case. A quick way to do this is: :1s/\(.*\)/\L\1/ The above command acts on line 1 in the file, takes the entire line, enclosed in parentheses to create a group, then uses […]

  • Firefox 3!

    Firefox 3 has been released! I have been using this version for nearly one full day now and it’s great. I was disappointed when I loaded up all of my tabs and I normally just log out of my X session or Windows session to allow the handy crash recovery to recover all of my […]