Skip to content

Instantly share code, notes, and snippets.

View jetstreamin's full-sized avatar
:octocat:
chillin' like the vanilla shake that I am

Mike Mahon jetstreamin

:octocat:
chillin' like the vanilla shake that I am
View GitHub Profile
@jetstreamin
jetstreamin / loop.sh
Last active March 5, 2019 10:39
loop.sh example of a loop in bash
# plucked from https://stackoverflow.com/a/25180186
#!/bin/bash
# Read a string with spaces using for loop
for value in I like programming
do
echo $value
done
@jetstreamin
jetstreamin / backup.sh
Created March 5, 2019 10:46
backup.sh - simple backup script for bash
#!/bin/bash
OF=/var/my-backup-$(date +%Y%m%d).tgz
tar -cZf $OF /home/me/
@jetstreamin
jetstreamin / convert-file-to-array.sh
Created March 5, 2019 11:32
bash: read file to array
# snagged from https://stackoverflow.com/a/30988704
# Use the mapfile command:
mapfile -t myArray < file.txt
# The error is using for -- the idiomatic way to loop over lines of a file is:
while IFS= read -r line; do echo ">>$line<<"; done < file.txt
@jetstreamin
jetstreamin / ansi-escape-colors.sh
Created March 5, 2019 12:12
bash: ANSI Escape Colors
## Snagged from https://stackoverflow.com/a/20983251
# Black 0;30 Dark Gray 1;30
# Red 0;31 Light Red 1;31
# Green 0;32 Light Green 1;32
# Brown/Orange 0;33 Yellow 1;33
# Blue 0;34 Light Blue 1;34
# Purple 0;35 Light Purple 1;35
# Cyan 0;36 Light Cyan 1;36
# Light Gray 0;37 White 1;37
@jetstreamin
jetstreamin / README.md
Last active March 21, 2019 13:20 — forked from smagch/README.md
CloudFormation: Postgres with default VPC spike
aws cloudformation create-stack --stack-name hogehoge --template-body file://conf.yaml --region ap-northeast-1 --parameters file://param.yaml
@jetstreamin
jetstreamin / 1553606035.txt
Created March 26, 2019 13:13
Created with Copy to Gist
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
@jetstreamin
jetstreamin / DateMath.cmd
Last active April 13, 2019 11:40
DateMath.cmd - Add or subtract days from any date, copy the script below or download here and save as DateMath.cmdq
@ECHO off
SETLOCAL
:: DateMath, a general purpose date math routine
:: If DateMath detects an error, variable _dd_int is set to 999999.
SET v_dd_int=0
SET v_mm_int=0
SET v_yy_int=0
SET v_ymd_str=
SET v_mm_str=
@jetstreamin
jetstreamin / sql-tools-fulltextsearch.sql
Created May 15, 2019 16:03
sql tools - full test search
USE BizActorMDBImport
DECLARE @SearchStr nvarchar(100) = '90_120'
DECLARE @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
@jetstreamin
jetstreamin / choco-developer-installs.bat
Last active October 1, 2022 19:54
Choco Installs for Developer Machine Setup
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
cinst -y --ignore-checksums`
choco feature enable -n=allowGlobalConfirmation
choco install googlechrome
choco install firefox
choco install brave
choco install greenshot
choco install microsoft-teams
choco install octopustools
choco install flashplayerplugin