Skip to content

Instantly share code, notes, and snippets.

View jnyryan's full-sized avatar
💭
Working on Search... and guess what - search is hard

John Ryan jnyryan

💭
Working on Search... and guess what - search is hard
View GitHub Profile
import time
import zmq
from multiprocessing import Process
def ventilator():
context = zmq.Context()
ventilator_send = context.socket(zmq.PUSH)
ventilator_send.bind("tcp://127.0.0.1:5557")
# Give everything a second to spin up and connect
time.sleep(1)
@jnyryan
jnyryan / RPiSetup-IOTStack.md
Last active November 15, 2020 23:12
Homehub

Installs to get the Rpi up and running for IOT Stack

Basics

sudo apt-get -y install git vim curl make zsh screen
sudo apt-get -y install matchbox-keyboard

Manual

  • raspi-config to set hostname
alias cls=clear
# get ip address
alias getipaddr='ipconfig getifaddr en0'
# get external ip address
alias getextipaddr='curl ipecho.net/plain; echo'
@jnyryan
jnyryan / osx_command_tricks.sh
Created January 13, 2016 09:26
Some command line tips and tricks for OSX
#!/bin/bash
#If spotlight is using up tons of CPU and slowing your comp down (MDS process), turn on/off spotlight.
alias spotlight_off="sudo mdutil -a -i off"
alias spotlight_on="sudo mdutil -a -i on"
#Turn on/off local time machine backups (local backups being extra storage when your backup drive is not connected.
alias tm_local_off="sudo tmutil disablelocal"
alias tm_local_on="sudo tmutil enablelocal”
#!/bin/sh
curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
source ~/.git-prompt.sh
export PS1='`if [ $? = 0 ]; then echo "\[\033[01;32m\]✔"; else echo "\[\033[01;31m\]✘"; fi` \[\033[01;30m\]\h\[\033[01;34m\] \w\[\033[35m\]$(__git_ps1 " %s") \[\033[01;30m\]>\[\033[00m\] '
# ✔ computername ~/git/BRRPSystem master >
# OR
@jnyryan
jnyryan / ssh-loopback.sh
Created July 24, 2015 14:23
expose a web server to a hosted VM with a ssh tunnel
ssh -g -v -L 9392:localhost:9393 localhost
@jnyryan
jnyryan / Vagrantfile
Last active August 29, 2015 14:10
Windows Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@jnyryan
jnyryan / Vagrantfile
Last active August 29, 2015 14:10
Vagrantfile to setup a NGINX server
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "trusty64"
config.vm.provision "shell", path: "install.sh"
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@jnyryan
jnyryan / ubuntu_docker.sh
Last active February 18, 2021 15:45
install doctor on ubuntu
#!/bin/bash
####################
# Prerequisites
sudo apt-get update
sudo apt-get install -y docker.io
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker
sudo sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io
sudo docker run -i -t ubuntu /bin/bash