Skip to content

Instantly share code, notes, and snippets.

View SalmonKing72's full-sized avatar
✝️

SalmonKing72

✝️
View GitHub Profile
@SalmonKing72
SalmonKing72 / docker-machine-insecure-registry.md
Last active July 7, 2021 11:44
docker-machine: adding insecure registry configuration to an existing machine/VM

The issue

  • deployed a local docker registry container to a docker-machine VM
  • cannot push to local docker registry
  • get an error including a message similar to, "http: server gave HTTP response to HTTPS client"

The solution

  • in order to push to this local registry you need to make some modifications to your docker VM
  • open c:\users\<user-name>\.docker\machine\machines\default\config.json or ~/.docker/machine/machines/default/config.json in an editor
  • find the InsecureRegistry property and append "localhost:5000" to it
  • go to your docker terminal
@SalmonKing72
SalmonKing72 / dos2unix-directory.sh
Created August 30, 2017 16:11
dos2unix all files in an entire directory
find . -type f -print0 | xargs -0 dos2unix
@SalmonKing72
SalmonKing72 / gist:9cfec5223fb0669c0ebf41e8a02b9a2d
Last active April 1, 2020 20:13
command to find symlinks in a directory to a specific file
find -L /dir/to/start -samefile /tmp/orig.file
# find your local ip address on wireless adapater
ipconfig getifaddr en0
@SalmonKing72
SalmonKing72 / module-pattern.js
Created August 13, 2018 19:15
jQuery module snippets
// Using the module pattern for a jQuery feature
$( document ).ready(function() {
var feature = (function() {
var items = $( "#myFeature li" );
var container = $( "<div class='container'></div>" );
var currentItem = null;
var urlBase = "/foo.php?item=";
var createContainer = function() {
var item = $( this );
@SalmonKing72
SalmonKing72 / pcf-services.md
Last active March 22, 2019 14:45
PCF ssh tunneling for connecting directly to DB services
@SalmonKing72
SalmonKing72 / react-app-env.md
Created January 21, 2019 15:05
React Application Environment configuration
@SalmonKing72
SalmonKing72 / venv-how-to.md
Last active February 7, 2019 16:35
how to use python venv from terminal
  • pip install virtualenv

within project root

  • virtualenv ./venv
  • cd ./venv/bin
  • source activate
@SalmonKing72
SalmonKing72 / samplePipeline.groovy
Created April 4, 2019 13:02
Jenkins pipeline with credentials
node {
stage('GetUserCredential') {
// Requires Credential setup (MyCredentialID)
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'MyCredentialID',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh '''
set +x
echo "$USERNAME" > output.txt
'''
@SalmonKing72
SalmonKing72 / sampleCredentials.md
Created April 5, 2019 13:40
cache git credentials

Since Git uses curl under the hood. It's possible to set up a ~/.netrc file with the credentials. For GitHub it would look something like this:

machine github.com
  login <github username>
  password <github oauth token>
@SalmonKing72
SalmonKing72 / CenterOnScreenPoint.cs
Created January 17, 2020 15:20
Helpful VR face recognition utilities
using UnityEngine;
public class CenterOnScreenPoint : MonoBehaviour
{
public Vector2 screenPosition;
[Range(0.25f, 4)]
public float distanceFromCamera = 1.5f;
public float maxSpeed = 0.65f;
[Range(0.005f, 0.01f)]
public float minDistance = 0.0075f;