Skip to content

Instantly share code, notes, and snippets.

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

rj rjmacarthy

🐁
The Tetris effect
  • The Wilderness
  • 10:16 (UTC +01:00)
View GitHub Profile
wget -qO- http://ipv4.icanhazip.com; echo
#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
@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
@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 / rename_js_files.sh
Created September 4, 2019 10:56 — forked from afternoon/rename_js_files.sh
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@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 / 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 / delete_git_submodule.md
Created April 19, 2021 11:33 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
tree -L 3 -I *node_modules
@rjmacarthy
rjmacarthy / proxy
Created June 15, 2021 08:49
nginx reverse proxy
server {
listen 443 ssl;
server_name localhost.<domain>.com;
access_log /var/log/nginx/<domain>.log;
client_max_body_size 20M;
ssl_certificate /etc/ssl/certs/<domain>.crt;
ssl_certificate_key /etc/ssl/private/localhost.key;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:E CDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA2 56:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES 128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:E CDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES 128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DS S-AES256-SHA:DHE-RSA-AES256-SHA';
ssl_protocols TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;