Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
rafaeltuelho / install-gosu-centos.md
Last active February 23, 2022 04:56
installing gosu on a centos docker box
# Install gosu.  https://github.com/tianon/gosu
ENV GOSU_VERSION=1.11
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
    && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" \
    && gpg --verify /usr/local/bin/gosu.asc \
    && rm /usr/local/bin/gosu.asc \
    && rm -r /root/.gnupg/ \
 && chmod +x /usr/local/bin/gosu \
@murdockcrc
murdockcrc / singleton.js
Created July 29, 2015 18:35
NodeJS Singleton pattern
exports = module.exports = (function () {
// Instance stores a reference to the Singleton
var instance;
function init() {
// Singleton
// Private methods and variables
return {
@AndreasPizsa
AndreasPizsa / gist:4eea7957553ed661c4df
Created November 7, 2014 15:19
Fix Bluetooth Audio hickups on Mac OS X
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream – Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream – Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
@cferdinandi
cferdinandi / terminal-cheat-sheet.txt
Last active May 2, 2024 08:38
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@welbornprod
welbornprod / Embedded Python in BASH
Created August 14, 2014 23:22
A little trick to embed python code in a BASH script.
#!/bin/bash
# Here are some embedded Python examples using Python3.
# They are put into functions for separation and clarity.
# Simple usage, only using python to print the date.
# This is not really a good example, because the `date`
# command works just as well.
function date_time {
@petemcw
petemcw / brew-instructions.sh
Last active March 27, 2024 15:59
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
@L422Y
L422Y / osx_automount_nfs.md
Last active May 4, 2024 14:26
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@sekoyo
sekoyo / conduit.connect.js
Last active December 13, 2020 00:16
Connect to Phabricator with node.js
var Connect = function() {
this.fs = require('fs');
this.crypto = require('crypto');
this.http = require('http');
this.url = require('url');
this.q = require('q');
this.initialize();
};
@pablochacin
pablochacin / parse_query.sh
Last active January 27, 2023 01:32
A one liner to parse a http query string in bash
#
# the following one liner creates a shell variable from every parameter in a
# the query string in the variable QUERY, of the form p1=v1&p2=v2,... and sets it to
# the corresponding value so that parameters can be accessed by its name $p1, $p2, ...
#
for p in ${QUERY//&/ };do kvp=( ${p/=/ } ); k=${kvp[0]};v=${kvp[1]};eval $k=$v;done
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2024 16:34
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: