Skip to content

Instantly share code, notes, and snippets.

@rpunt
rpunt / gist:85ab824375936a2caebf
Created July 17, 2015 17:07
Mirror a CRL, and use the "This update" field as the file's mod-time
curl http://site.com/file.crl -o /var/www/file.crl
lastmod=`openssl crl -inform DER -text -noout -in /var/www/file.crl | grep "Last Update" | awk '{ print "date -d \""$3FS$4FS$5FS$6"\" +%Y%m%d%H%M" }' | bash`
touch -mt $lastmod /var/www/file.crl
@rpunt
rpunt / encode.ps1
Created May 20, 2015 02:39
Batch-encode all .MKV containers in a directory to AppleTV-compatible .MP4
$scandir = "d:\video"
$outputdir = "d:\encoded"
$filelist = Get-ChildItem $scandir -filter *.mkv -recurse
$num = $filelist | measure
$filecount = $num.count
$i = 0;
ForEach ($file in $filelist)
{
@rpunt
rpunt / newrelic_post.pl
Created April 29, 2014 14:31
Post deployment info the NewRelic
# New Relic deployment events
my $ua = LWP::UserAgent->new;
$response = $ua->request(POST 'https://api.newrelic.com/deployments.xml',
Content => [
'deployment[application_id]' => $APPID,
'deployment[description]' => 'deployment message',
'deployment[revision]' => $RELEASE_VERSION,
'deployment[user]' => 'Jenkins'
],
'x-api-key' => $APIKEY
@rpunt
rpunt / phoh.ps1
Created April 7, 2014 20:13
Powershell hash of hashes
$entries = @{}
import-csv $csv | % {
$entries.add(($adpentry.EEfile_Number),(@{
fname = $_."First Name"
lname = $_."Last Name"
department = $_.Department
location = $_.Location
manager = $_.Manager
title = $_."Job Title"
}))