Skip to content

Instantly share code, notes, and snippets.

View BrendanThompson's full-sized avatar
🍏
Getting rejected by Apple

Brendan Thompson BrendanThompson

🍏
Getting rejected by Apple
View GitHub Profile
@BrendanThompson
BrendanThompson / getFileName.sh
Last active August 29, 2015 13:58
This will get the file name when a full path is given.
i=0; cut -d '/' -f $(( $i + $(grep -o '/' <<< $FILE | grep -c .) )) <<< $FILE
@BrendanThompson
BrendanThompson / scriptcs
Last active August 29, 2015 13:59
Bash script for executing scriptcs
#!/usr/bin/env bash
MONO=$(command -v mono)
SCRIPTCS="/usr/local/etc/scriptcs/scriptcs.exe" ## Later will get it to pull and extract here
COMMAND=""
case $1 in
"-repl" )
COMMAND="$MONO $SCRIPTCS -modules mono -repl"
$COMMAND
@BrendanThompson
BrendanThompson / checkOS
Created April 19, 2014 02:36
Checks package managers to determine which to use.
#!/usr/bin/env bash
OS=""
if [[ -n $(command -v brew) ]]; then
OS="OSX"
elif [[ -n $(command -v yum) ]]; then
OS="RH"
elif [[ -n $(command -v apt-get) ]]; then
OS="DEB"
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*

Keybase proof

I hereby claim:

  • I am brendanthompson on github.
  • I am bthompson (https://keybase.io/bthompson) on keybase.
  • I have a public key whose fingerprint is B660 1042 6D52 0F61 ED34 742E 8D37 2514 5E87 1BD7

To claim this, I am signing this object:

#Test

This is just a test to see how the gist stuff works from ST3

{
"template": "logstash*",
"settings": {
"index.analysis.analyzer.default.stopwords": "_none_",
"index.number_of_replicas": "1",
"index.query.default_field": "message",
"index.refresh_interval": "5s",
"index.number_of_shards": "4",
"index.store.compress.stored": "true",
"index.analysis.analyzer.default.type": "standard",
@BrendanThompson
BrendanThompson / vulnBash.sh
Created September 25, 2014 01:24
Check for Vulnerable Bash
env t='() { :;}; echo You are vulnerable.' bash -c "true"
@BrendanThompson
BrendanThompson / compareHost.ps1
Created September 30, 2014 01:22
Compare two host names to confirm if they return the same IP Address
function compareHost() {
param
(
[Parameter(Mandatory=$true)]
[string] $firstHost,
[Parameter(Mandatory=$true)]
[string] $secondHost
)
if($((Test-Connection $firstHost -Count 1).IPV4Address.IPAddressToString) -eq $((Test-Connection $secondHost -Count 1).IPV4Address.IPAddressToString)) {
@BrendanThompson
BrendanThompson / updateKeyVal.ps1
Created October 8, 2014 07:14
Function to update Key Value pairs in Configuration Files
Param(
[string]$configurationFilePath,
[string]$configKey,
[string]$configValue
)
((Get-Content -Path $configurationFilePath) | Foreach-Object {
$line = $_
if ($line -like "*=*") {
$lineArray = $line -split "=", 2