Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Stefano virtualstaticvoid

View GitHub Profile
We couldn’t find that file to show.
View git-use-main
#!/bin/bash
git remote set-head origin main
git branch -m master main
@virtualstaticvoid
virtualstaticvoid / git-reset-branch
Created Feb 9, 2021
Resets a git branch, or switches over from master to main.
View git-reset-branch
#!/bin/bash
set -e
#
# NOTE: can be used to switch over to another branch such from "master" to "main"
#
# git reset-branch main origin/main
#
if [ ! -d .git ]; then
@virtualstaticvoid
virtualstaticvoid / .gitignore
Last active Jan 2, 2021
Raspberry Pi 4 Ubuntu 20.04.1 LTS configuration and provisioning script
View .gitignore
*.xz
*.zip
mnt/*
@virtualstaticvoid
virtualstaticvoid / shell
Created Jul 8, 2020
Get Docker Container IP Address
View shell
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container
@virtualstaticvoid
virtualstaticvoid / install-ca-certificate
Created Jul 2, 2020
Install Custom CA Certificate (with name check)
View install-ca-certificate
#!/bin/bash
cert=${1:-ca.pem}
name=$2
sudo mkdir -p /usr/local/share/ca-certificates
sudo cp $cert /usr/local/share/ca-certificates/
sudo update-ca-certificates
@virtualstaticvoid
virtualstaticvoid / Ensure.cs
Last active Nov 14, 2018
C# Ensure for Argument Errors
View Ensure.cs
//
// MIT License
// Copyright (c) 2009 Chris Stefano <virtualstaticvoid@gmail.com>
//
using System;
using System.Diagnostics;
internal static class Ensure
{
[DebuggerStepThrough]
@virtualstaticvoid
virtualstaticvoid / .gitignore
Last active Oct 23, 2018
heroku-buildpack-r/issues/113
@virtualstaticvoid
virtualstaticvoid / .gitignore
Last active Mar 19, 2018
Heroku Buildpack R - rJava Example
View .gitignore
MyExchange.class
@virtualstaticvoid
virtualstaticvoid / .r-version
Last active Jul 22, 2020
Heroku Buildpack R - plumber Example