Category: Linux

  • Rebooting: quick tip

    Note to self: whenever rebooting a server, login via SSH and restart the OpenSSH daemon first to validate that it will come back up. I just updated an AWS instance and rebooted it without doing this. Some new update in OpenSSH required that the AuthorizedKeysCommandUser be defined if AuthorizedKeysCommand is defined and the OpenSSH daemon […]

  • Book Review: Instant Chef Starter, by John Ewart

    Instant Chef Starter is an introductory book about Chef, an open-source configuration management and automation platform. John Ewart and Packt Publishing have published a book that will allow a system administrator with no prior Chef experience to get Chef up and running within a day, if not a few hours, by using this guide. If […]

  • AWS VPC DB Security Group

    The other day I was working with a client and creating a CloudFormation template that used RDS instances within a VPC. I found that while creating the DB security group object that I was getting an error like the following: STACK_EVENT CloudFormationName DBSecurityGroupName AWS::RDS::DBSecurityGroup 2012-12-17T22:30:20Z CREATE_FAILED Please see the documentation for authorizing DBSecurityGroup ingress. For […]

  • SSH Public Key Authentication via OpenLDAP on RHEL/CentOS 6.x

    With the release of RHEL/CentOS 6.x there are some changes to the way clients authenticate using public keys over SSH with keys stored in OpenLDAP. I was able to get this working with the following modifications. Pre-requisites: * RHEL / CentOS 6.x * openssh-ldap Setup the sshd_config by setting up the AuthorizedKeysCommand. This will execute […]

  • Proxy HTTP Requests through Nginx to Jetty6 with X-Forwarded-For

    One important part of any proxy configuration is logging the correct originating IP address on the final application log to ensure proper analytics and problem determination. Note that at times, it’s very useful to log the proxy or load balancer IP at the application server to determine where an issue may be occurring but for […]

  • List MySQL Table Space Consumption

    How much space is MySQL consuming? How do I find out which MySQL tables are the largest? Can I query MySQL to determine how much space it’s consuming? Try this to list the top 20 space offenders: SELECT engine, concat( table_schema, ‘.’, table_name ) table_name, concat( round( data_length / ( 1024 *1024 ) , 2 […]

  • Domain Auto-Enrollment / Hostname Management with Powershell (v2)

    I am realizing now that I need to get a git repo setup that is publicly accessible which will allow me to share scripts and other code snippets that I’m working on. Here is the second iteration of the powershell domain/hostname management script that I’m working on. It will also update the SQL Server dbname […]

  • Bind-DLZ with MySQL

    DNS management with Bind has traditionally been flat files and slave/master configurations. Bind also has a feature/extension called DLZ — dynamically loaded zones. This feature can be very useful when designing applications that use databases or directories for storage rather than having to design your application to address a filesystem to create resource records or […]

  • Expanding an ext3 filesystem online

    One common scenario that I face in my daily work is to add disk to various filesystems. Setting up systems correctly so that this is possible will save time and frustration. One of the easiest cases is adding disk to a virtual machine when the guest is using LVM and ext3. As always, please be […]

  • 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.