Skip to content

Instantly share code, notes, and snippets.

### A Pluto.jl notebook ###
# v0.9.11
using Markdown
macro bind(def, element)
quote
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.peek, el) ? Base.peek(el) : missing
el
end
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
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.

@saurabhnanda
saurabhnanda / circle.yml
Created November 18, 2017 18:06
Haskall on CircleCI
version: 2
defaults: &defaults
environment:
BASH_ENV: ~/.bashrc
# These libraries eat up a lot of memory while compiling and cannot be built in parallel with other libraries.
$ They will exhaust your memory and cause the build to crash if not built separately.
KNOWN_CULPRITS: "regex-tdfa lens"
# Space separated list of files that you want to finally deploy
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@chen206
chen206 / memo.md
Last active December 5, 2023 18:10
Logrotate and upload Nginx logfile to S3

安装awscli

sudo apt-get install -y awscli

测试

sudo logrotate -d -f /etc/logrotate.d/nginx

触发logrotate

sudo logrotate -f /etc/logrotate.d/nginx

@joepie91
joepie91 / vpn.md
Last active May 1, 2024 01:04
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
import argparse
from mock import Mock
m = Mock()
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers()
query_group = subparsers.add_parser('query')
add_group = subparsers.add_parser('add')