Skip to content

Instantly share code, notes, and snippets.

View nshenry03's full-sized avatar

Nicholas Henry nshenry03

View GitHub Profile
#!/bin/bash -
#===============================================================================
#
# FILE: mysql2sqlite.sh
#
# USAGE: ./mysql2sqlite.sh [options] [db_name [tbl_name ...]] | \
# sqlite3 database.db
#
# EXAMPLE: ./mysql2sqlite.sh --no-data -u root -pMySecretPassWord \
# myDbase | sqlite3 database.db
[
Detailed description of the problem. If this format doesn't make sense
(for example, for a defect based on a logged/emailed error/warning
instead of witnessed behavior) just something like "We received the
following error X times. Can something be fixed so we don't get these?"
before just pasting the text of the error email.
]
h2. Steps To Reproduce
# Step One
@nshenry03
nshenry03 / mines.pl
Created April 17, 2014 14:18
The code for the 'mines.pl' t-shirt was 'designed' by one of CSM's many awesome teachers, Mike Colagrosso.
#!/usr/bin/perl -w
use strict;
 
  my$song="helluva";                                my$drink="whisky";
  my$g="Golden";my$csm                            ="Tech";my$w="wreck"
  ;my$demeanor="honest";                        my$conscience="clear";
  my$a="rambling";my$enemy                     ="engineer,";my$f="ll";
       my$sp=chr(32);my$line                 ="A";for(1..4){$line
       .=$sp.$song.","}$line.=             $sp.$song.$sp.$enemy;;
       for(1..2){print$line,"\n"         ;}$enemy=~tr/,/\./;print
@nshenry03
nshenry03 / configuration.yml.diff
Created July 16, 2014 14:47
Changes needed to get Redmine to use Postfix on a server... Simply copy config/configuration.yml.example to config/configuration.yml, make the following changes, and then restart your web server.
--- config/configuration.yml.example 2014-07-16 14:36:32.000000000 +0000
+++ config/configuration.yml 2014-07-16 14:41:36.000000000 +0000
@@ -81,15 +81,17 @@
# default configuration options for all environments
default:
# Outgoing emails configuration (see examples above)
+ # email_delivery:
+ # delivery_method: :smtp
+ # smtp_settings:
+ # address: smtp.example.net
@nshenry03
nshenry03 / exampleOrder.json
Created July 17, 2014 18:02
Example SoftLayer API order
{
"parameters": [
{
"packageId": 46,
"prices": [
{
"id": 1640,
"complexType": "SoftLayer_Product_Item_Price"
},
{
@nshenry03
nshenry03 / Public GPG Key
Created August 20, 2014 16:43
Public GPG Key for Nick Henry
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.10 (GNU/Linux)
mQINBEvteekBEACzlg+IWTNFdmduRGujvBFYVsvpX3hKKjmU3LRfYTloKL0oF+lJ
A5pjz1RuLa28nbQzt7uxBcbuA+X+8LRp3Ppu5DYTw8s3b9m3Kg3Yhg2WLg6MA5Cz
/A9005AQKRL8ceiV91Yzb54wN7hiETeiCOuICCVWTdSH6H2dXF1myCZ9zrJJ1beK
3YrPCu/OsiIkOt7K3KP03IjDpdTUPdONoiR7fjAWdQqRnLbRrVcbMFExPhfxqGs1
E27ndAOanvesfF6zqO48QAmeSKu3B0Tv2M4bsiO7h3U+bdfDwCjg4m7aijN1rIXF
YzEvNyEsLYreEmsamQCiJwW1SxFGB0JvGqQ6K1E7r7SZMaQJAGUiKf2NxoKYwZZM
MvpvG0SYPyQ2JuVpmsfnMaz6sbP3MbMNdN5XzyPOcRU+h83bPufpoW9Y6nc7GmBP
h2ejZiB+vrg/VHHgjeCJ26UThfKRItpjMUqw9Rjxv6Wh0GbWNNp/nfhH0suahsPo
@nshenry03
nshenry03 / pdfMerge.sh
Created December 8, 2014 21:49
Quick script used to merge some PDFs for St. Paul's Lutheran Church of Calhan and Family Heritage Publishers so that they can print the 100 year history book.
#!/bin/bash -
#===============================================================================
#
# FILE: pdfMerge.sh
#
# USAGE: ./pdfMerge.sh
#
# DESCRIPTION: Merges two PDFs based on page numbers
#
# AUTHOR: Nick Henry (NSH), nicholas.henry@appdirect.com
@nshenry03
nshenry03 / perProcessMemorySummary.sh
Last active August 29, 2015 14:20
Get a summary of per process memory usage using awk (php-fpm for example). Note, if a process shares libraries, they will be counted multiple times so this isn't perfect; however, it should give you a good rough summary of the amount of memory used.
ps aux | fgrep php-fpm | egrep -v 'master process|fgrep' | sort -k13 | awk '{print $1,$6}' | awk '{a[$1]+=$2;}END{for(i in a)print i, a[i] * 0.001;}' | sort -nr -k2 | awk '{ sum+=$2 ; print $1, $2, " MB"} END {print "Total Memory Usage:", sum, " MB"}'
colordiff -rqw cf-wordpress/htdocs cf-ex-worpress/htdocs
colordiff -w cf-wordpress/htdocs/wp-config-sample.php cf-ex-worpress/htdocs/wp-config.php
name 'multipleRecipeRoleExample'
description 'Example multiple recipe role'
run_list 'role[base]',
'recipe[mysql::server]',
'recipe[java]',
'recipe[ant]',
'recipe[jboss]',
'recipe[jboss::mysql]'
default_attributes(
'java' => {