Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address
1Mwz3aaQ1AXCKsdXec59b2CVR78NpT3n6a
https://explorer.blockstack.org/address/1Mwz3aaQ1AXCKsdXec59b2CVR78NpT3n6a
https://stackoverflow.com/questions/2762994/how-to-define-an-alias-in-fish-shell
@olivejun
olivejun / snippets.txt
Created May 30, 2020 05:15
[ssdnodes] important things to help maintain ssdnodes server~ #server #dev
## learning how to set pkg_config_path
icu4c is keg-only, which means it was not symlinked into /usr/local,
because macOS provides libicucore.dylib (but nothing else).
If you need to have icu4c first in your PATH run:
echo 'set -g fish_user_paths "/usr/local/opt/icu4c/bin" $fish_user_paths' >> ~/.config/fish/config.fish
echo 'set -g fish_user_paths "/usr/local/opt/icu4c/sbin" $fish_user_paths' >> ~/.config/fish/config.fish
For compilers to find icu4c you may need to set:
@olivejun
olivejun / transfershalias.txt
Created June 27, 2020 13:12
[alias for transfer.sh] bash #shell
transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
@olivejun
olivejun / upgrades.txt
Created June 27, 2020 21:56
[automatic security upgrades]
root@ars-vpn-test:~$ apt update ; apt dist-upgrade -y
root@ars-vpn-test:~$ apt install unattended-upgrades
root@ars-vpn-test:~$ dpkg-reconfigure unattended-upgrades

Keybase proof

I hereby claim:

  • I am olivejun on github.
  • I am oli_ve (https://keybase.io/oli_ve) on keybase.
  • I have a public key ASCO7v-RXTBNyAZNFrdrw83lsTNnN3llcYGaUT_Lqop3pwo

To claim this, I am signing this object:

@olivejun
olivejun / resilio.txt
Created August 30, 2020 03:39 — forked from garronej/resilio.txt
Install resilio-sync on raspberry pi
mkdir /var/lib/resilio-sync/ && chown pi:pi -R /var/lib/resilio-sync
mkdir /etc/resilio-sync
nano /etc/resilio-sync/config.json
{
"storage_path" : "/var/lib/resilio-sync/",
"pid_file" : "/var/run/resilio-sync/sync.pid",
"webui" :
@olivejun
olivejun / gist:ab9fe0dfa9a898c0778604cba701c6e2
Last active September 3, 2020 18:22 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@olivejun
olivejun / edit_paths.zsh
Created September 30, 2020 11:10 — forked from deanishe/edit_paths.zsh
prepend_path and append_path functions for zsh
# The following functions append/prepend the specified directory to the path variable specified by name
# If the directory is already in the path, it is first removed and then appended/prepended.
# Examples:
#
# Prepend `~/bin` to `$PATH`:
# prepend_path PATH ~/bin
#
# Append `~bin` to `$PATH` instead:
# append_path PATH ~/bin
# (this will remove `~/bin` from the beginning of `$PATH` first)
@olivejun
olivejun / home-server.md
Created October 27, 2020 03:47 — forked from nileshtrivedi/home-server.md
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.