Fork this blog on GitHub Fork this blog on GitHub

DatabaseError: permission denied errors on Heroku

DatabaseError: permission denied errors on Heroku

If you are seeing this error while investigating Heroku logs, it might be because your write permissions have been taken away!

Whoops! How do I know that? This blog was down for a couple of days because I had exceeded the maximum number of Postgres database rows on my Heroku free account. Conveniently, Heroku now makes it easy to directly interact with Postgres data via psql.

I fixed the issue and waited 24 hours, but I was still receiving HTML 500 errors. This time the errors were limited to my django admin login page. Upon inspection of the traceback, it ...

Continue reading

How to Restore an Append-Only Redis Master With a dump.rdb

How to Restore an Append-Only Redis Master With a dump.rdb

Follow these steps to restore a dump.rdb into a Redis master that is running in append-only mode. For some reason this is not documented very well. The master in this case had an issue and was unable to write to disk. I was able to get the dump.rdb from a slave.

Step 1 - Obtain a dump.rdb & check the size for later comparison

redis-cli -p $PORT save
redis-cli -p $PORT dbsize

Step 2 - Stop the master & all slaves

/etc/init.d/redis stop

Step 3 - Update the Redis working directory

Remove any old dump.rdb files and any ...

Continue reading

Beer of the day: Volume 01 - What is your beer/time quotient?

Beer of the day: Volume 01 - What is your beer/time quotient?

Do you know how much beer you are drinking over the course of a year? Wanna know? Keg homebrew & count! It's easy. Start here.

Step 01 - Buy some stuff.

Yep, you gotta spend some money to get into this hobby. But, ya know what? It is totally worth it. And you can start small, so just buy the 160 dollar kit at the local homebrewden and get started.

Step 02 - Follow their directions.

I'm not going to explain how to brew beer, that'd be silly! There are tons of great resources out there and when you know ...

Continue reading

Change

“As I stand here I ponder greater things”
~ Candlebox

I am compelled to write about the value of change in our lives. Everyone has a different level of comfort when it comes to change, but it is rewarding to periodically step out of our comfort zones and embrace change. Change helps us to grow emotionally, spiritually and gain wisdom. New circumstances, people and events challenge us to intentionally live in the moment and pursue our dreams.

Responsibilities in our lives can sometimes make us feel like our freedom is being restricted, but everyone has the capability to identify potential beneficial ...

Continue reading

Brute Forcing One Time Pads - Defcon Mystery Challenge Cryptanalysis Preparation

Brute Forcing One Time Pads - Defcon Mystery Challenge Cryptanalysis Preparation

In preparation for the mystery challenge at Defcon 20 this year, I put together some simple python tools.  I find it quite enjoyable making anti-1057 cryptanalysis tools, so I may be adding more.  This is what I have so far.

Update: This is now on Github

Generate Lookups

Each of these lookups is a dictionary.  The key:value pairs in each dictionary can easily be extended and fed into the crypto functions.

lookup1a = {i : chr(64+i) for i in range(1,27)} #1:A, 2:B, etc
lookupa1 = {chr(64+i):i for i in range(1,27)} #A ...

Continue reading

Customizing Vim to Easily Add Python Breakpoints

I added a few lines to my .vimrc today in my ongoing effort to be more productive and type fewer key strokes.

First I changed the <leader> variable from a backslash to a comma which is easier to type.  The leader variable is useful for creating custom commands.

"Easier mapleader than the default "\"
let mapleader = ","


Instead of manually typing "import ipdb; ipdb.set_trace()", the following vim configuration will insert a python breakpoint in the next line by typing ,p in normal mode.  As the comment explains, ctrl v and then escape must be typed in order to create the characters ...

Continue reading

Python Argparse - Parsing Command Line Scipt Arguments

The python argparse module is quite nifty.  In the past I have used code like this to parse arguments to command line scripts:

import sys

prog_name        = sys.argv[0]

def printUsage():
  print 'Usage: ' + prog_name + ' USEFUL_ARGUMENT'
  print 'This script does something useful with an argument.\n'
  print 'Examples:'
  print '  '+ prog_name + ' USEFUL_ARGUMENT\n'
  exit()


sys.argv.remove(prog_name)
if '-h' in sys.argv or '--help' in sys.argv or len(sys.argv) != 1:
  printUsage()

useful_arg = sys.argv[0]

The argparse module helps to eliminate boilerplate code, provides nice formatting for free, and provides useful features. Here is the same code using the ...

Continue reading

The Importance of Healthcare IT Security

The Importance of Healthcare IT Security

Importance of Healthcare IT Security PDF Version

I wrote this document in September 2010 for a college course. I am publishing it here because I believe the subject matter is important and I would like to reach other professionals in the healthcare industry.  As always, feedback is greatly appreciated! A PDF version is available too.


Abstract

Implementing technology in a secure manner is an important issue in the health care industry.  To remain effective and efficient, businesses require electronic solutions to be put into operation.  Furthermore, the United States Government currently offers incentives to early adopters of certified technology programs and will penalize health care providers who ...

Continue reading

Preparing for Defcon by Voiding a Warranty (or how to replace an Asus B121 hard drive)

Preparing for Defcon by Voiding a Warranty (or how to replace an Asus B121 hard drive)

So I thought to myself... Self?  How about we replace the hard drive in this handy tablet, install linux, and bring it to Defcon?  I typically prepare for a security conference by wiping a hard drive before and after so I can experiment and enjoy the con.  Instead of wiping and reinstalling, I have always just popped drives in and out.  I love this device because it weighs 2.5 pounds and has a large 12" x 8" screen which makes a perfect travel companion.

How to open the Asus B121

Tools required:  Something thin like a credit card or ...

Continue reading

Splunk – Customize the “Results per page” Dropdown

Splunk – Customize the “Results per page” Dropdown

Do you want to customize Splunk by:

  • Extending the default choices of 10, 20 and 50 results per page?
  • Changing the default number of search results?

This quick how to describes how to implement both of these changes.

Start by making a custom local copy of configuration file that we are about to change:


cp –p $SPLUNK_HOME/etc/apps/$APPNAME/default/data/ui/views/flashtimeline.xml \ 
$SPLUNK_HOME/etc/apps/$APPNAME/local/data/ui/views/flashtimeline.xml

$APPNAME is your app or search for the default search app

Extend the XML Count options with some extra XML like so:


<module name ...

Continue reading

  • Page 1 of 2
  • 1
  • 2