Skip to content

Instantly share code, notes, and snippets.

James Stout jamesstout

View GitHub Profile
@jamesstout
jamesstout / cleanup-conflicts.sh
Last active May 17, 2020
Cleanup conflicted Nextcloud files
View cleanup-conflicts.sh
#!/usr/bin/env bash
# shellcheck shell=bash
# set -x
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Header logging
e_header() {
printf "\n$(tput setaf 7)%s$(tput sgr0)\n" "$@"
}
@jamesstout
jamesstout / firebase.log
Created May 15, 2020
Firebase verbose logging
View firebase.log
- [Firebase/Core][I-COR000001] Configuring the default app.
- [Firebase/Core][I-COR000033] Data Collection flag is not set.
- [Firebase/Installations][I-FIS002001] -[FIRInstallationsIDController installationWithValidAuthTokenForcingRefresh:0], appName: __FIRAPP_DEFAULT
- [Firebase/Installations][I-FIS002000] -[FIRInstallationsIDController createGetInstallationItemPromise], appName: __FIRAPP_DEFAULT
- [41112:16549661] [Firebase/Crashlytics] Version 4.1.0
- [Firebase/Crashlytics][I-CLS000000] [Crashlytics] Running on iOS Simulator (iPhone), 12.2.0 (17G12034)
- [Firebase/Crashlytics][I-CLS000000] [Crashlytics:Settings] No settings were cached
- [Firebase/Crashlytics][I-CLS000000] Root: /Users/james/Library/Developer/CoreSimulator/Devices/4EF0C0BF-0DF1-47D9-B9E6-19307E748F0E/data/Containers/Data/Application/7C3A9AE4-84B0-40A5-A24A-87DA7D4387F1/Library/Caches/com.crashlytics.data/com.tiberiushk.hkwarningspushtest
- [Firebase/Crashlytics][I-CLS000000] Automatic data collection is enabled.
- [Firebase/Crashlytics][I
@jamesstout
jamesstout / copy_site.rb
Last active May 11, 2020
Jekyll hooks to copy the _site folder somewhere else and commit and push to a remote repo, e.g. GitHub.io
View copy_site.rb
Jekyll::Hooks.register :site, :post_write do |site|
Jekyll.logger.info "site.dest: ", site.dest
Jekyll.logger.info "site.source: ", site.source
ioDest = '/Users/james/Projects/jamesstout.github.io'
Jekyll.logger.info "GitHub.io dest: ", ioDest
hash = `git rev-parse --short HEAD`
Jekyll.logger.info "hash: ", hash
@jamesstout
jamesstout / docker-image-refresh.sh
Last active May 8, 2020
docker-image-refresh.sh
View docker-image-refresh.sh
#!/usr/bin/env bash
logExt="$(date +%Y-%m-%d).log"
LOG_FILE="/var/services/homes/james/logs/$(basename "$0").$logExt"
WORK_DIR=$(mktemp -d)
# check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temp dir"
@jamesstout
jamesstout / Xcode_platform_linking.sh
Last active Nov 30, 2019
Xcode 11 doesn't run on macos 10.13, but linking device support from the unrunable versions means you can debug on newer versions of iOS. What a pain.
View Xcode_platform_linking.sh
james@Jamess-iMac: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.2 .
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.3 .
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/12.4 .
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.0 .
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.1 .
sudo ln -s /Users/james/Desktop/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/13.2 .
james@Jamess-iMac: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/DeviceSupport
@jamesstout
jamesstout / gh-sync-fork.sh
Last active Sep 17, 2018
GitHub - Sync a fork
View gh-sync-fork.sh
# I can never remember...
git fetch upstream
git checkout master
git merge upstream/master
View ftp.gnu.org-analysis.log
$ curl -v http://ftp.gnu.org/
* Trying 208.118.235.20...
* TCP_NODELAY set
* Connection failed
* connect to 208.118.235.20 port 80 failed: Operation timed out
* Failed to connect to ftp.gnu.org port 80: Operation timed out
* Closing connection 0
curl: (7) Failed to connect to ftp.gnu.org port 80: Operation timed out
$ ping ftp.gnu.org
@jamesstout
jamesstout / Gitlab-Docker-certbot.md
Created Jul 30, 2018 — forked from 0x646e78/Gitlab-Docker-certbot.md
gitlab inside docker with certs from Let's Encrypt
View Gitlab-Docker-certbot.md

Running gitlab inside docker with certs from Let's Encrypt

This will serve SSH and HTTPS (with which I got an A+ from testssl).

Creates three docker containers:

  • gitlab-prostgres
  • gitlab-redis
  • gitlab, which is linked to the other two. This contains nginx, sshd, git, gitlab.
@jamesstout
jamesstout / vagrant-vscode-php-xdebug-instructions.md
Last active May 3, 2020 — forked from sveggiani/instructions.md
Configure Xdebug, Visual Studio Code for a Vagrant VM
View vagrant-vscode-php-xdebug-instructions.md

0. Assumptions

  • You've installed Xdebug in your VM.
  • You've installed Xdebug extension for VSCode and reloaded/restarted VSCode.
  • You have not forwarded port 9000 from the guest to the host.
  • Configure Debugger in VSCode. See item 1 next.

1. Configure .vscode/launch.json

View podcast-list.txt
* [5by5 at the Movies](http://5by5.tv/movies) <a style="color:#fa9b39" href="http://feeds.5by5.tv/movies" itemprop="sameAs"> <i class="fas fa-fw fa-rss-square" aria-hidden="true"></i></a>
* [A Cast of Kings - A Game of Thrones Podcast](http://www.slashfilm.com/) <a style="color:#fa9b39" href="http://feeds.feedburner.com/castofkings" itemprop="sameAs"> <i class="fas fa-fw fa-rss-square" aria-hidden="true"></i></a>
* [A STORM OF SPOILERS - A Pop Culture Podcast](http://stormofspoilers.com/) <a style="color:#fa9b39" href="http://feeds.feedburner.com/AStormOfSpoilers" itemprop="sameAs"> <i class="fas fa-fw fa-rss-square" aria-hidden="true"></i></a>
* [Accidental Tech Podcast](http://atp.fm/) <a style="color:#fa9b39" href="http://atp.fm/episodes?format=rss" itemprop="sameAs"> <i class="fas fa-fw fa-rss-square" aria-hidden="true"></i></a>
* [Amber Nectar HCAFC](http://www.ambernectar.org/) <a style="color:#fa9b39" href="http://feeds.soundcloud.com/users/soundcloud:users:54747069/sounds.rss" itemprop="sameAs"> <i cl
You can’t perform that action at this time.