Skip to content

Instantly share code, notes, and snippets.

View CamW's full-sized avatar

Cameron Waldron CamW

View GitHub Profile
@CamW
CamW / startbox.ps1
Created February 7, 2016 10:16
Windows10 Startbox
get-packageprovider -name chocolatey
New-Item $profile -ItemType File -Force
"Set-Location c:\`r`nrm alias:curl`r`nClear-Host`r`n" | Set-Content $env:USERPROFILE\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
install-package dropbox
install-package vlc
install-package adobereader
install-package paint.net
install-package nimbletext
install-package googlechrome
install-package putty.install
@CamW
CamW / unique_downloads.sh
Created September 26, 2015 17:36
Count unique downloads nginx access log
#One liner to count the number of unique downloads by IP address of a specific file
#This is based on a default install on Centos 7, you may need to change the path to your log file.
awk '/YOUR_FILE_NAME/ {print $1}' < /var/nginx/log/access.log|sort|uniq|wc -l
@CamW
CamW / CreateProfile.ps1
Last active August 29, 2015 14:13
Create Powershell profile and fix curl alias issue.
#Create a profile if it doesn't already exist
New-Item $profile -ItemType File -Force
@CamW
CamW / p4merge-git-windows.md
Last active August 29, 2015 14:13
Setup p4merge as diff and merge tool for git on windows

Setup p4merge as diff and merge tool for git on windows

Download and install p4merge from chocolatey

    cinst p4merge

Setup p4merge as git's diff and merge tool. To do this, edit your .gitconfig under c:\users\[yourusername] and add the following lines:

[merge]

#!/bin/bash
### VARIABLES ###
PRE_PACK="openssl-devel pcre-devel make gcc"
VER="1.5.6"
# Setup Colours
black='\E[30;40m'
red='\E[31;40m'