Skip to content

Instantly share code, notes, and snippets.

View sarah-j-smith's full-sized avatar

Sarah Smith sarah-j-smith

View GitHub Profile
@sarah-j-smith
sarah-j-smith / Google-Cloud-SSH.sh
Created January 12, 2021 01:43
Connect to Google Cloud Compute instance via SSH using OS-Login
# Creates a portable SSH key that can be offered to any GCP Compute instance you have access to, eg via Google domain login
# Pre-requisites - gcloud Google command line tool. - https://cloud.google.com/sdk/docs/quickstart
curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-322.0.0-darwin-x86_64.tar.gz -o google-cloud-sdk.tar.gz
open -g google-cloud-sdk.tar.gz
./google-cloud-sdk/install.sh
source ~/.bash_profile
# Setup Google login, compute zone, region and project
@sarah-j-smith
sarah-j-smith / simple-vimrc
Last active August 6, 2023 11:42
Simple .vimrc for Mac OSX
" Use spaces instead of tabs
set expandtab
" Be smart when using tabkey
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
@sarah-j-smith
sarah-j-smith / NSFileProtectionType
Created January 12, 2023 04:35
Complete protection type using encryption for iOS.
/// The file is stored in an encrypted format on disk and
/// cannot be read from or written to while the device is locked or booting.
Complete Protection (NSFileProtectionComplete)
@sarah-j-smith
sarah-j-smith / cross-platform-mobile-dev.csv
Last active July 18, 2022 03:12
Currently cross-platform mobile dev allowing app & play store publishing
Name Development Language
React Native Javascript
Flutter Dart
Xamarin C#
Ionic Javascript (webviews)
@sarah-j-smith
sarah-j-smith / Tar pipe
Created September 14, 2019 04:59
The amazingly awesome tar pipe command for copying trees of files around
# https://blog.extracheese.org/2010/05/the-tar-pipe.html
# on Mac the --exclude-vcs is not available - can add --exclude .git
(cd /Users/ssmith6/depot/js-intro-workshop && tar cf - .)|(cd /Users/ssmith6/depot/Android101 && tar xvfp -)
@sarah-j-smith
sarah-j-smith / create_mirror.sh
Created September 9, 2021 00:04
Creating a mirror of the repo to use with BFG
cd ~/src
git clone --mirror git@github.com:my-git-name/RepoWithExposedSecrets.git
java -jar ~/bin/bfg-1.14.0.jar --delete-files Credentials.json RepoWithExposedSecrets.git
@sarah-j-smith
sarah-j-smith / bfg_clean_run.sh
Created September 8, 2021 23:49
Running the BFG to clean your repo
cd ~/src/RepoWithExposedSecrets.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
@sarah-j-smith
sarah-j-smith / fresh_clone.sh
Created September 8, 2021 23:45
Fresh clone of your repo
# Get the SSH clone link from your repo and check it out with a distinctive name
mkdir -p ~/src && cd ~/src
git clone git@github.com:my-git-name/RepoWithExposedSecrets.git\
freshRepoWithExposedSecrets
@sarah-j-smith
sarah-j-smith / install_bfg.sh
Created September 8, 2021 23:41
Installing the BFG on Mac
curl -O https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
mkdir -p ~/bin
mv -f bfg-1.14.0.jar ~/bin/.
java -jar ~/bin/bfg-1.14.0.jar
@sarah-j-smith
sarah-j-smith / bash_profile
Created September 8, 2021 23:35
Use the Java from your Android Studio
# Install Android Studio then add these lines to your ~/.bash_profile
# Java from Android SDK
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"
export PATH="${JAVA_HOME}/bin:${PATH}"