Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
@sukharevd
sukharevd / aws-s3-gzip-compression.py
Last active February 14, 2024 10:43
Synchronizes directory with gzipped content of Amazon S3 bucket with local one to avoid redundant synchronization requests when files were not changed, but MD5 sums of Gzipped files are different.
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
AWS S3 Gzip compression utility
Author: Dmitriy Sukharev
Modified: 2013-09-11
-------
Synchronizes directory with gzipped content of Amazon S3 bucket with local
<response><info><statusCode>0</statusCode><messages/><copyright><imageUrl>http://api.mqcdn.com/res/mqlogo.gif</imageUrl><imageAltText>© 2013 MapQuest, Inc.</imageAltText><text>© 2013 MapQuest, Inc.</text></copyright></info><route><sessionId>52a40dc1-0205-000c-02b7-04a6-d485645ba5f2</sessionId><options><shapeFormat>raw</shapeFormat><generalize>-1.0</generalize><maxLinkId>0</maxLinkId><narrativeType>text</narrativeType><stateBoundaryDisplay>true</stateBoundaryDisplay><countryBoundaryDisplay>true</countryBoundaryDisplay><sideOfStreetDisplay>true</sideOfStreetDisplay><destinationManeuverDisplay>true</destinationManeuverDisplay><avoidTimedConditions>false</avoidTimedConditions><enhancedNarrative>false</enhancedNarrative><returnLinkDirections>false</returnLinkDirections><timeType>0</timeType><routeType>FASTEST</routeType><locale>en_US</locale><unit>M</unit><tryAvoidLinkIds></tryAvoidLinkIds><mustAvoidLinkIds></mustAvoidLinkIds><manmaps>true</manmaps><drivingStyle>2</drivingStyle><highwayEfficiency>22.0</highwayEffi
@drdrang
drdrang / Location.py
Created January 9, 2014 04:55
A Pythonista script that gets the address, latitude, and longitude and sends them to Drafts.
import sys
import location, time
import urllib, webbrowser
# Handle argument, if present.
try:
a = sys.argv[1]
except IndexError:
a = ''
@surrealchemist
surrealchemist / auth-basic.conf
Last active July 3, 2019 12:28 — forked from Thermionix/auth-basic.conf
Adding "port_in_redirect off;" which fixes the problem caused when your router is forwarding from a different port. This stops nginx from adding the port back in which is needed in a couple cases.
auth_basic "Restricted";
auth_basic_user_file /usr/local/etc/nginx/htpasswd;
@9to5IT
9to5IT / Script_Template.ps1
Last active June 6, 2025 03:20
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
unset __messy_path
unset __cleaned_path
unset __path_check
declare -A __path_check
__messy_path+=(/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin /Applications/VMware\ Fusion.app/Contents/Library /Applications/Postgres.app/Contents/Versions/{9.3,9.4}/bin /{usr,opt}/{local,X11}/{bin,sbin} $HOME/bin)
__messy_path+=($(IFS=:; echo $PATH))
__messy_path+=(/{usr,opt}/{bin,sbin} /{bin,sbin})
@ttscoff
ttscoff / TECensor.js
Last active May 4, 2016 13:56
A &#%$ing JavaScript snippet for TextExpander to automatically censor naughtiness with !%@#. #!@& that's cool.
// modify/duplicate the other snippets in this group, using
// the abbreviation to define words to replace with "swear" characters
function censor (input) {
var badWord = input.replace(/((er)?s?|ing)?$/, '');
return input.replace(badWord, censored(badWord));
}
function shuffleArray(inputArr) {
var array = inputArr.slice(0);
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = "!@#$%^&*()_+{}:\"<>?~|".indexOf(character) !== -1
@alirobe
alirobe / reclaimWindows10.ps1
Last active June 10, 2025 00:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@jchandra74
jchandra74 / PowerShell Customization.md
Last active May 23, 2025 19:18
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.