Skip to content

Instantly share code, notes, and snippets.

@greymeister
greymeister / catalina.sh
Created Jul 18, 2014
Catalina.sh from Tomcat 7
View catalina.sh
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@greymeister
greymeister / gif_to_mpeg.sh
Created Jul 23, 2014
gif_to_mpeg - convert gif to mpeg video file using imagemagick and ffmpeg
View gif_to_mpeg.sh
#!/bin/bash
## gif_to_mpeg
## Based on http://stackoverflow.com/a/3212958 and http://apple.stackexchange.com/a/103834
## charles.erwin@vendscreen.com
## Take first argument which should be a filename
if [ -z "$1" ]
then
echo "Usage: $0 'filename.gif'"
@greymeister
greymeister / %snippet:;smoji%
Created Sep 20, 2014
emoji.xyz URL shortener (I use ;smoji)
View %snippet:;smoji%
#!/usr/bin/php
<?php
// Request: Local emoji-web (http://emoji.xyz/shorten)
$ch = curl_init("http://emoji.xyz/shorten");
curl_setopt($ch, CURLOPT_POST, TRUE);
// Headers
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
@greymeister
greymeister / WeiDU.log
Last active Aug 29, 2015
Baldur's Gate Trilogy Playthrough Mod List
View WeiDU.log
// Log of Currently Installed WeiDU Mods
// The top of the file is the 'oldest' mod
// ~TP2_File~ #language_number #component_number // [Subcomponent Name -> ] Component Name [ : Version]
~SETUP-BGTTWEAK.TP2~ #0 #2300 // Disable hostile reaction after charm: 8
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #40 // Change Viconia's Skin Color to Dark Blue: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #60 // Weapon Animation Tweaks: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #70 // Icewind Dale Casting Graphics (Andyr): v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #100 // Commoners Use Drab Colors: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #110 // Icon Improvements: v9
~BG2_TWEAKS/SETUP-BG2_TWEAKS.TP2~ #0 #1010 // More Interjections: v9
@greymeister
greymeister / bg_random_chars.md
Last active Aug 29, 2015
Random Characters generated for BGT Playthrough
View bg_random_chars.md

Starting Party

  • Rave'las 9409 - ANY Elf Fighter/Mage/Thief 448 - C Neutral 4 reroll voice 5

  • Eryen Resby 5268 - Female Human Necromancer 345 - CG 4 re-roll Voice 3

@greymeister
greymeister / LHM Test.groovy
Last active Aug 29, 2015
Some Groovy Semantics I don't quite get
View LHM Test.groovy
blah = [name: 'poop', status: 'tudus', null: 'EAD']
foo = 'name'
bar = 'status'
baz = null
println blah[baz]
blah.put(null, 'NOOBER')
@greymeister
greymeister / resize_png_files.sh
Created Feb 12, 2015
Resize PNG files to 50x80
View resize_png_files.sh
#!/bin/bash
export pad="60"
printf "%-${pad}s" "Counting files:"
echo `ls -1 | wc -l`
#printf "%-${pad}s" "Create copies of .png files"
# for filename in *.png; do cp "$filename" "${filename}_big.png"; done && echo "done"
#
View gist:1c07bd160a20b5ef5389
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
* * * * * echo "How did we get here?"
@greymeister
greymeister / createArchiveDirs.groovy
Created Mar 31, 2015
Creates some Archive Directories
View createArchiveDirs.groovy
baseDir = "/Users/user/Documents/Archive"
alphabetRange = ('A'..'Z')
alphabetList = new ArrayList (alphabetRange)
alphabetList.each{letter ->
file = new File("${baseDir}/$letter").mkdirs()
}
View UniqueSuffixes.java
private static int counter = 0;
private static synchronized java.lang.String getUniqueSuffix() {
// reset the counter if it is greater than 99999
if (counter > 99999) {
counter = 0;
}
counter = counter + 1;
return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter;
}