Skip to content

Instantly share code, notes, and snippets.

View DerekK19's full-sized avatar

Derek Knight DerekK19

View GitHub Profile
@DerekK19
DerekK19 / image_generate.sh
Created April 21, 2015 10:06
Convert an image (typically 512x512) to sizes appropriate for iOS apps
#!/bin/bash
# Generate 3 images from the specified one
# takes two parameters"
# The image to be resized
# The new image base name
# The base image size
# Generates:
# A new image at the base size, this will be named <new image base name>.png
# A new image at 2x the base size, this will be named <new image base name>@2x.png
@DerekK19
DerekK19 / .alias
Last active October 11, 2015 11:08
My osx aliases
alias emal="emacs ~/.profile"
alias dosh=". ~/.profile"
alias cd..="cd .."
alias rgrep="grep -r"
alias cls='tput clear'
@DerekK19
DerekK19 / doxygen start section
Last active October 11, 2015 12:07
XCode Doxygen interface section header
/**
@interface <#Interface#>
@addtogroup <#Group#>
@{
*/
/**
@brief <#Brief description#>
<#Full description#>
@DerekK19
DerekK19 / doxygen end section
Last active October 11, 2015 12:08
XCode Doxygen section terminator
/** @} */
@DerekK19
DerekK19 / gist:5235935
Created March 25, 2013 09:21
Create a user and account to use when running a daemon
MyMac:~ myuser$ sudo dscl
Password: (your password)
Entering interactive mode... (type "help" for commands)
> cd /Local/Default/
/Local/Default >
/Local/Default > ls Groups gid
@DerekK19
DerekK19 / launch-slave
Created April 3, 2013 05:40
Daemon processes to run Jenkins. This is the only configuration I have found that works: A Daemon config file (plist) will run as root and will launch a shell script. That shell script runs a second shell script as the _jenkins user. This configuration ensures that the launch-slave script is running as the _jenkins user and has got a correct run…
#!/bin/bash
LOG=/Developer/jenkins/logs/slave.log
sudo rm -f $LOG
date >$LOG
chmod 777 $LOG
echo ============================= >> $LOG
echo whoami >> $LOG
@DerekK19
DerekK19 / .bash_aliases
Last active December 20, 2015 17:58
OSX bash aliases
alias emal="emacs ~/.bash_aliases"
alias doal=". ~/.bash_aliases"
alias dosh=". ~/.bashrc"
alias cd..="cd .."
alias rgrep="grep -r"
alias cls='tput clear'
alias ls='CLICOLOR_FORCE=1 ls -G'
alias less='less -R'
@DerekK19
DerekK19 / Xcode select
Created August 9, 2013 02:48
Xcode select, to set path for command line tools
sudo xcode-select --switch /Applications/<insert Xcode app path here>/Contents/Developer
@DerekK19
DerekK19 / gist:6259046
Created August 17, 2013 22:42
Set Mac OSX machine name
# for example Name with capital is "Derekmac" and fully qualified lower case name is "derekmac.derek.domain.com"
sudo scutil --set ComputerName <Name with capital>
sudo scutil --set LocalHostName <Name with capital>
sudo scutil --set HostName <fully qualified lower case name>
dscacheutil -flushcache
@DerekK19
DerekK19 / gist:6273700
Created August 19, 2013 20:27
Run Apache from a command line
# If apache isnt starting, Try this to help debug:
sudo bash -x /usr/sbin/apachectl -k start