Skip to content

Instantly share code, notes, and snippets.

View patrickmmartin's full-sized avatar

Patrick Martin patrickmmartin

View GitHub Profile
@patrickmmartin
patrickmmartin / branch_template.bat
Created November 29, 2011 23:59
a little script I wrote to demo who simple branching in SVN can be, and how scriptable it is
@echo off
:: some macros to improve legibility
set CHECK_DELETE= || ( echo deletion failed - exiting & exit /b )
set CHECK_CREATE= || ( echo creation failed - exiting & exit /b )
set CHECK_COMMIT= || ( echo commit failed - exiting & exit /b )
set CHECK_READ= || ( echo read failed - exiting & exit /b )
set CHECK_RENAME= || ( echo rename failed - exiting & exit /b )
:: clean up
@patrickmmartin
patrickmmartin / sendmail.vbs
Created January 8, 2012 11:34
Simple VBS based mailer for integration into build scripts
If Wscript.Arguments.Count < 3 Then
WScript.Echo "usage: sendmail email title file"
WScript.Quit 1
End If
EmailTo = Wscript.Arguments(0)
EmailTitle = Wscript.Arguments(1)
EmailFile = Wscript.Arguments(2)
@patrickmmartin
patrickmmartin / whereis.bat
Created January 8, 2012 20:24
simplest windows whereis batch
@echo. %~$PATH:1
@patrickmmartin
patrickmmartin / Command.java
Created December 21, 2012 11:39
I was experimenting with the Java enum constructors
/**
*
*/
package martin.patrick;
import java.util.Arrays;
/**
* @author Patrick
*
@patrickmmartin
patrickmmartin / pas2dox.dox
Created March 2, 2013 17:44
Doxyfile directive to generate Doxygen output from Pascal
INPUT_FILTER = C:/pas2dox/pas2dox.exe
@patrickmmartin
patrickmmartin / apache2-user-php.sh
Last active August 29, 2015 14:02
apache2 setup on debian for hacking
sudo apt-get install apache2
sudo apt-get install php5
sudo /etc/init.d/apache2 restart
sudo a2enmod userdir
sudo a2enmod php5 # just as a reminder
# sudo emacs /etc/apache2/mods-enabled//php5.conf # comment out the admin directve for userdirs
sudo /etc/init.d/apache2 restart
@patrickmmartin
patrickmmartin / keepawake
Created July 6, 2014 22:29
keep a narcoleptic machine awake
for ((a=1; a <= 1000 ; a++)); do ./wake-ls-mini-bk; sleep 10 ; done
@patrickmmartin
patrickmmartin / regenerategrub
Last active August 29, 2015 14:03
restore the Windows boots on debian dual boot
$ sudo os-prober
/dev/sda1:Windows Recovery Environment (loader):Windows:chain
/dev/sda2:Windows 8 (loader):Windows1:chain
$ sudo update-grub2
Generating grub.cfg ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-3.2.0-4-amd64
Found initrd image: /boot/initrd.img-3.2.0-4-amd64
Found Windows Recovery Environment (loader) on /dev/sda1
@patrickmmartin
patrickmmartin / pad.py
Last active August 29, 2015 14:06
pads a list to get the alpha sort the same as the input array
# define the list of names
names = ["Benchmark Bills",
"Benchmark Bonds",
"Bills",
"Bonds",
"Agency",
"Sub-National",
"Corporate",
@patrickmmartin
patrickmmartin / keepawake.sh
Created October 25, 2014 16:46
keep it awake for a bit
for i in {1..1000}; do echo sending wakeup && ../bin/swakeup 00:1D:73:4C:99:2E && sleep 100 ; done