Skip to content

Instantly share code, notes, and snippets.

@volkstrader
volkstrader / pbcopy.py
Last active March 24, 2020 17:47
python copy to clipboard
import subprocess
process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE)
process.communicate(output.encode('utf-8'))
@volkstrader
volkstrader / init.sh
Last active October 9, 2015 20:39
Nitrous Polymer init
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoclean
npm install -g gulp bower yo
npm install -g generator-polymer
npm install -g firebase-tools
set nocompatible
filetype plugin on
if has("autocmd")
filetype on
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
endif
set mouse=a
@volkstrader
volkstrader / publish.sh
Created February 17, 2015 19:47
Publish the contents from grunt dist to GitHub
rsync -a --delete \
--delete-excluded .git \
--delete-excluded .gitignore \
--delete-excluded publish.sh \
--delete-excluded CNAME \
~/sites/thesite/src/dist/ .
git add --all
git commit -m "published on `date`"
git push origin master
@volkstrader
volkstrader / webdev
Last active August 29, 2015 14:15
Start webdev container
docker run -it --rm -v ~/sites/savewalnut/src:/src --name webdev --expose 9000 -p 80:9000 hcsoftech/webdev
@volkstrader
volkstrader / goshell
Created February 16, 2015 01:54
Docker Container Go Shell
sudo docker run -it --rm -v /media/data/volumes/projects/go:/go -w /go golang:latest
@volkstrader
volkstrader / start_rssh_tunnel.sh
Last active June 3, 2022 16:32
Start reverse ssh tunnel for cron job
#!/bin/bash
SSH_REDIR_PORT=12345
SSH_D="cloud_sshd"
COMMAND="ssh -R $SSH_REDIR_PORT:localhost:22 $SSH_D -N -f"
pgrep -f "ssh -R $SSH_REDIR_PORT:localhost:22" > /dev/null 2>&1 || (eval $COMMAND && echo $COMMAND)
@volkstrader
volkstrader / gist:13226bb1693ce6ece7bc
Created January 14, 2015 03:10
grep ip address on eth0
ifconfig eth0 | grep "inet addr" | cut -d: -f2 | awk '{print $1}'
@volkstrader
volkstrader / gist:08c467fcf35ca7bb3996
Created January 13, 2015 23:48
Install docker on ubuntu
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
@volkstrader
volkstrader / gist:1992816a2d95537d5799
Created January 13, 2015 23:12
Renaming ubuntu hostname
  1. sudo vim /etc/hostname
  2. rename
  3. sudo vim /etc/hosts
  4. rename
  5. sudo service hostname restart
  6. if it does not work, sudo shutdown -r now