Skip to content

Instantly share code, notes, and snippets.

View SalmonKing72's full-sized avatar
✝️

SalmonKing72

✝️
View GitHub Profile
@SalmonKing72
SalmonKing72 / README.md
Created April 30, 2020 03:34
Local DNS Database on Pihole machine

In terms of getting started quickly I ended up using a pihole deployment with extra lists, as described in https://www.youtube.com/watch?v=qNCzSA2bs9I

In this solution you get ad-block as "unnecessary" extra, but maybe it is more people than me who don't mind.

Start by installing pihole on some machine as described here https://github.com/pi-hole/pi-hole/#one-step-automated-install and get it up and running.

When you're finished with getting pihole to work, extend the pihole configuration as below (example on a debian system, with a .lan domain):

Create a file /etc/dnsmasq.d/02-lan.conf with content

@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;
@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 / 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 / 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 / react-app-env.md
Created January 21, 2019 15:05
React Application Environment configuration
@SalmonKing72
SalmonKing72 / pcf-services.md
Last active March 22, 2019 14:45
PCF ssh tunneling for connecting directly to DB services
@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 / 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 / dos2unix-directory.sh
Created August 30, 2017 16:11
dos2unix all files in an entire directory
find . -type f -print0 | xargs -0 dos2unix