Skip to content

Instantly share code, notes, and snippets.

View tiernano's full-sized avatar

Tiernan OToole tiernano

View GitHub Profile
@tiernano
tiernano / AllmightyUploader
Created September 6, 2009 22:33
Quick and Dirty Backup and Uploader for WorkPress Files
#!/bin/bash
# directory structure:
# ~/s3sync has scripts
# ~/s3sync/s3backup is a folder for temp backup files
cd /home/tiernano
BUCKET=<BucketName>
BlogDBNAME=wordpress
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;
using System.Diagnostics;
using System.Collections;
namespace Dedupe
using System;
using System.Web;
using System.Text;
using System.Net;
namespace CDNProxy
{
public class CDNHandler : IHttpHandler
{
/// <summary>
@tiernano
tiernano / downloadwin2012rc.ps1
Created June 1, 2012 16:11
Download Windows 2012 Server RC
Import-Module bitstransfer
$url = "http://url.ie/fdvf"
$job = Start-BitsTransfer -source $url -Destination c:\downloads -Asynchronous
while (($job.JobState -eq 'Transferring') -or ($job.JobState -eq 'Connecting')){
write-progress -Activity "Downloading" -status "percent complete" -PercentComplete (($job.bytesTransferred / $job.BytesTotal) * 100)
sleep 1
}
if($job.JobState -eq 'Transferred')
@tiernano
tiernano / convert-to-AppleTV.ps1
Created September 28, 2012 07:47
Convert Files to AppleTV2 format using PowerShell and HandBrake
$files = gci "path to your file location"
$handbrake = "C:\Program Files\HandBrake\HandBrakeCLI.exe"
foreach($file in $files) {
$newFileName = "path to where you want the files to be set to..." + [System.IO.Path]::GetFileNameWithoutExtension($file) + ".m4v"
& $handbrake -i $file.FullName -o $newFileName --preset "AppleTV 2"
if ($LastExitCode -ne 0)
{
Write-Warning "Error converting $($file.FullName)"
}
@tiernano
tiernano / gist:3871919
Created October 11, 2012 12:12
RouterOS Blocking Machine access to all but one IP
/ip firewall filter
add chain=forward action=drop src-address=srcaddress dst-address=!dstaddress
@tiernano
tiernano / gist:3877692
Created October 12, 2012 06:56
RouterOS address List example
/ip firewall address-list
add list=expressVPN address=77.92.85.58
add list=expressVPN address=83.170.77.220
add list=expressVPN address=109.169.27.39
add list=expressVPN address=78.129.227.106
/ip firewall filter
add action=drop chain=forward dst-address-list=!expressVPN src=address=192.168.0.123
@tiernano
tiernano / gist:3958472
Created October 26, 2012 12:20
Squid Upstream Proxy with WAN Proxy
cache_peer 127.0.0.1 parent 3300 0 no-query no-digest
never_direct allow all
@tiernano
tiernano / enableVNC.sh
Created November 29, 2012 16:21
Enable VNC on OSX though the command line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all
@tiernano
tiernano / disableVNC.sh
Created November 29, 2012 16:23
Disable VNC on OSX though Command Line
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off