Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrés Restrepo thelinuxkid

View GitHub Profile
@thelinuxkid
thelinuxkid / newrelic-re-enable-dynamic.sh
Last active Dec 12, 2016
Enable dynamic method lookup for New Relic in Swift
View newrelic-re-enable-dynamic.sh
#!/bin/bash
# Enable dynamic method lookup for Swift as explained here:
# https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/install-configure/enabling-swift-interaction-traces
srcdir="$1"
if [ -z "$srcdir" ]; then
echo Please provide a source directory;
exit 1;
fi
View keybase.md

Keybase proof

I hereby claim:

  • I am thelinuxkid on github.
  • I am thelinuxkid (https://keybase.io/thelinuxkid) on keybase.
  • I have a public key whose fingerprint is 675C 176D 14A7 7E52 294D 579C D021 FE8F C82A D747

To claim this, I am signing this object:

View docker-compose.yml
ipfs:
image: jbenet/go-ipfs
container_name: ipfs_daemon
ports:
- "5001:5001"
- "4001:4001"
volumes:
- ./data/ipfs:/data/ipfs
registry:
image: thelinuxkid/registry
@thelinuxkid
thelinuxkid / go-manager.sh
Created Oct 21, 2014
Minimalistic Go package manager
View go-manager.sh
!/bin/sh
# WARNING: this script is unfinished.
# With this script you don't have to keep third-packages in your repo.
# You just run it when you need to install, update or remove dependencies.
# Call it like:
# dependencies install < packages.dep
# where packages.deb is a file that looks like:
View dependencies.sh
!/bin/sh
# WARNING: this script is unfinished.
# With this script you don't have to keep third-packages in your repo.
# You just run it when you need to install, update or remove dependencies.
# Call it like:
# dependencies install < packages.dep
# where packages.deb is a file that looks like:
@thelinuxkid
thelinuxkid / 99-tmux-ssh.sh
Last active Dec 18, 2015
Automatically open tmux when ssh'ing into a server if the LC_TMUX variable has been set by the ssh client, e.g., ssh -o SendEnv=LC_TMUX user@server. If a session does not exist then a new one is created. Otherwise, the last session is attached. This should always be run last either in .bashrc or as a script in .bashrc.d. The user is logged out f…
View 99-tmux-ssh.sh
# This script should be the last one run in .bashrc.d. Run if
# the LC_TMUX variable has been set by the ssh client, e.g.,
# ssh -o SendEnv=LC_TMUX user@server.
if [[ -z "$TMUX" ]] && [[ -n "$LC_TMUX" ]]; then
tmux has-session &> /dev/null
if [ $? -eq 1 ]; then
exec tmux new
exit
else
exec tmux attach
@thelinuxkid
thelinuxkid / subprocess_stream.py
Last active Nov 7, 2019
Get a Python subprocess' output without buffering. Normally when you want to get the output of a subprocess in Python you have to wait until the process finishes. This is bad for long running processes. Here's a way to get the output unbuffered (in real-time.)
View subprocess_stream.py
import contextlib
import subprocess
# Unix, Windows and old Macintosh end-of-line
newlines = ['\n', '\r\n', '\r']
def unbuffered(proc, stream='stdout'):
stream = getattr(proc, stream)
with contextlib.closing(stream):
while True:
out = []
You can’t perform that action at this time.