Skip to content

Instantly share code, notes, and snippets.

View pi0's full-sized avatar
🎯

Pooya Parsa pi0

🎯
View GitHub Profile
keytool -genkey -v -keystore release.keystore -alias baziness -keyalg RSA -keysize 2048 -validity 10000
@pi0
pi0 / convoy.service
Created July 19, 2016 21:08
Convoy Systemctl Service File
[Unit]
Description=Convoy Daemon
Requires=docker.service
[Service]
ExecStart=/usr/local/bin/convoy daemon
[Install]
WantedBy=multi-user.target
@pi0
pi0 / ConvoySetup.sh
Last active May 7, 2020 16:39
ConvoySetup
# Usage curl -#L https://git.io/convoy | sudo bash
CONVOY_VERSION=v0.5.0
cd /tmp
echo "Downloading convoy ..."
wget -q https://github.com/rancher/convoy/releases/download/$CONVOY_VERSION/convoy.tar.gz -O convoy.tar.gz
echo "Installing convoy ..."
@pi0
pi0 / vg-extend.sh
Last active September 16, 2016 21:30
pvcreate /dev/sda3
vgextend localhost-vg /dev/sda3
vgdisplay
lvextend -l +100%FREE /dev/mapper/localhost--vg-root
resize2fs /dev/mapper/localhost--vg-root
df -h
@pi0
pi0 / colors
Last active August 4, 2022 17:35
Super Simple Node.js String Colors Support
This snippets add super Simple Node.js String Colors Support.
See here:
http://stackoverflow.com/questions/32474241/node-js-terminal-color
http://stackoverflow.com/questions/9781218/how-to-change-node-jss-console-font-color
@pi0
pi0 / weave.sh
Created November 25, 2016 16:46
Weave Config
# On node 1
weave launch --name ::1 --ipalloc-init seed="::1,::2" --ipalloc-range "10.2.0.0/16" node2
# On node 2
weave launch --name ::2 --ipalloc-init seed="::1,::2" --ipalloc-range "10.2.0.0/16" node1
docker run --rm --privileged --net weave `weave dns-args` \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/run/weave/weave.sock:/var/run/weave/weave.sock \
-v /var/lib/rancher:/var/lib/rancher \
-e HOST_DOCKER_SOCK="/var/run/weave/weave.sock:/var/run/weave/weave.sock -v /var/run/docker.sock" \
-e DOCKER_HOST="unix:///var/run/weave/weave.sock" \
rancher/agent \
<TOEKN_URL>
@pi0
pi0 / dockerclean.sh
Last active December 20, 2016 13:33
Docker Safe Cleanup Scripts
# Print docker usages
# Cleanup containers
for i in ` docker ps -a | grep -v -e "data" -e "volume" -e "Up" | awk '{ print $1; }'`; do docker rm $i ; done
# Cleanup images
for i in `docker images -a | grep "<none>" | awk '{ print $3; }'`; do docker rmi -f $i ; done
@pi0
pi0 / GitHub protocol comparison.md
Created November 29, 2016 22:38
A comparison of protocols offered by GitHub (for #git on Freenode).

Primary differences between SSH and HTTPS. This post is specifically about accessing Git repositories on GitHub.

Protocols to choose from when cloning:

plain Git, aka git://github.com/

  • Does not add security beyond what Git itself provides. The server is not verified.

    If you clone a repository over git://, you should check if the latest commit's hash is correct.

@pi0
pi0 / README.md
Created December 18, 2016 10:32 — forked from joyrexus/README.md
Form/file uploads with hapi.js

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...