Skip to content

Instantly share code, notes, and snippets.

View rjmacarthy's full-sized avatar
🎮
The Tetris effect

richy rjmacarthy

🎮
The Tetris effect
View GitHub Profile
@rjmacarthy
rjmacarthy / deploy-keys.md
Created May 5, 2020 11:06 — forked from holmberd/deploy-keys.md
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@rjmacarthy
rjmacarthy / bundle
Created October 3, 2019 10:02
fix bundle warning multiple bundler versions
gem install bundler -v x.x.x
bundle _x.x.x_ install
@rjmacarthy
rjmacarthy / read-tree.txt
Created February 22, 2019 09:42
git read-tree
git checkout master
git checkout -b new-branch
git read-tree -u -m target-branch
@rjmacarthy
rjmacarthy / binary-gap.js
Last active December 5, 2018 11:46
Binary Gap JavaScript
var tests = [234534534234];
tests.forEach(function (t) {
Test(t);
});
function Test(N) {
var bin = N.toString(2);
var b = 0;
var col = bin.split("1").filter(function (val) {
@rjmacarthy
rjmacarthy / Fix for nodemon watching too many files.
Last active December 5, 2018 11:43
Error: ENOSPC: no space left on device, watch
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@rjmacarthy
rjmacarthy / l2tp Debian Stretch.sh
Last active November 21, 2018 10:06
Ubuntu Setup.sh
#!/bin/bash
# Ubuntu & Debian
#apt-get update
#apt-get -y install strongswan xl2tpd
# CentOS & RHEL
#yum -y install epel-release
#yum --enablerepo=epel -y install strongswan xl2tpd
#Connect
#/bin/bash
sudo ipsec up vpnname
echo "c vpnname" >/var/run/xl2tpd/l2tp-control
sleep 8
route add <x.x.x.x remote> gw 192.168.0.1
route add default dev ppp0
#Disconnect
wget -qO- http://ipv4.icanhazip.com; echo
** start **
mongod --fork --dbpath /home/mongodata/mongodb --smallfiles --logpath /var/log/mongodb.log --logappend --auth
** stop **
sudo killall -15 mongod
sudo su -s /bin/bash jenkins