Skip to content

Instantly share code, notes, and snippets.

View jamesstout's full-sized avatar

James Stout jamesstout

View GitHub Profile
@jamesstout
jamesstout / upload_symbols.sh
Last active February 19, 2024 01:09
Xcode script to upload symbols to AppCenter during build phase
#!/usr/bin/env bash
# shellcheck shell=bash
# SEE: https://docs.microsoft.com/en-us/appcenter/diagnostics/iOS-symbolication#app-center-api
# AND: https://github.com/microsoft/appcenter-cli#commands
# Common functions
jcs_log () { echo "[JCS] $1"; }
# TODO: change to fail
@jamesstout
jamesstout / cleanup-conflicts.sh
Last active June 8, 2021 22:09
Cleanup conflicted Nextcloud files
#!/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 12:37
Firebase verbose logging
- [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 16:17
Jekyll hooks to copy the _site folder somewhere else and commit and push to a remote repo, e.g. GitHub.io
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 13:48
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 November 30, 2019 13:41
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.
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 September 17, 2018 15:38
GitHub - Sync a fork
# I can never remember...
git fetch upstream
git checkout master
git merge upstream/master
@jamesstout
jamesstout / ftp.gnu.org-analysis.log
Created August 15, 2018 08:31
ftp.gnu.org analysis
$ 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 July 30, 2018 13:34 — forked from 0x646e78/Gitlab-Docker-certbot.md
gitlab inside docker with certs from Let's Encrypt

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 August 5, 2021 19:29 — forked from sveggiani/instructions.md
Configure Xdebug, Visual Studio Code for a Vagrant VM

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