Skip to content

Instantly share code, notes, and snippets.

@colezlaw
colezlaw / start_stop_memcached_script.sh
Last active November 6, 2020 17:54 — forked from tinogomes/start_stop_memcached_script.sh
Script sample to start/stop for linux with nohup
#!/bin/bash
#
BASE=/tmp
PID=$BASE/app.pid
LOG=$BASE/app.log
ERROR=$BASE/app-error.log
PORT=11211
LISTEN_IP='0.0.0.0'
MEM_SIZE=4
2017-04-11 12:39:40,158 org.owasp.dependencycheck.utils.Settings:562
DEBUG - Setting: data.directory='/usr/local/Cellar/dependency-check/1.4.5/libexec/data'
2017-04-11 12:39:40,162 org.owasp.dependencycheck.utils.Settings:562
DEBUG - Setting: autoupdate='true'
2017-04-11 12:39:40,162 org.owasp.dependencycheck.utils.Settings:562
DEBUG - Setting: analyzer.experimental.enabled='false'
2017-04-11 12:39:40,162 org.owasp.dependencycheck.utils.Settings:562
DEBUG - Setting: analyzer.jar.enabled='true'
2017-04-11 12:39:40,162 org.owasp.dependencycheck.utils.Settings:562
DEBUG - Setting: analyzer.archive.enabled='true'
@colezlaw
colezlaw / GAS Tutorial.md
Created May 5, 2014 00:12
Simple Google Apps Script tutorial

A couple of folks have asked for an example of what Google Apps Script is useful for. The things I've done so far are pretty specific applications, so not useful to the general public. I decided to put together a simple script which may (or may not) be more generally useful, but still shows off some of the coolness of Google Apps Script.

If you're a tactile learner like I am, I encourage you to actually type in the samples rather than copy/pasting them. I don't learn anything by using copy/paste.

Background

I generally work from home, so when I do go into the office, there are usually a number of coworkers there who also generally work from home. We try to schedule a lunch during the day, but when the time comes to get into cars, it's a long and painful process of trying to decide where to eat. I guess none of us has an alpha personality, so we each are trying to please the others. The goal of this script is to narrow down the selection process using a more alpha personality - a PRNG.

The workflow work

Keybase proof

I hereby claim:

  • I am colezlaw on github.
  • I am cfa (https://keybase.io/cfa) on keybase.
  • I have a public key whose fingerprint is 5B22 34AF 738D 4736 3F27 8122 74E1 51C7 F60C 1753

To claim this, I am signing this object:

@colezlaw
colezlaw / cards.js
Last active December 17, 2015 08:18 — forked from anonymous/cards.js
var cltnc = (function() {
return {
CardDeck: function(ary) {
if ("string" == typeof(ary)) {
this.ary = ary.split("");
} else {
this.ary = ary;
}
this.remaining = ary.length;
@colezlaw
colezlaw / pmd_transform.py
Created December 21, 2012 16:37
Simple Python script for transforming results from PMD to HTML with support for prettify, bootstrap, etc. Instead of using XSLT, it's just manually selecting things based on XPath and pulls in the source code from the file if it can find it. Requires lxml (http://pypi.python.org/pypi/lxml/).
import argparse, sys
from lxml import etree
class PMDTransformer(object):
def __init__(self):
self.etree = None
self.args = None
self.violations = None
def parse(self):
@colezlaw
colezlaw / Breakfast for Geeks.markdown
Created January 16, 2011 20:34
I couldn't find a breakfast casserole exactly like I wanted, so I made exactly what I wanted

Ingredients

  • 1/4 cup of butter
  • 2 large baking potatoes
  • 1 lb. ground sausage
  • 1/2 medium onion, diced
  • 1 4.5oz. can of green chiles
  • 1 cup shredded sharp cheddar cheese
  • 8 eggs
  • 1 cup of milk