Skip to content

Instantly share code, notes, and snippets.

View basnijholt's full-sized avatar

Bas Nijholt basnijholt

View GitHub Profile
@basnijholt
basnijholt / cto_line.pine
Created September 18, 2021 08:23
CTO Line indicator for TradingView
//@version=4
study(title="CTO Line", shorttitle="CTO", overlay=true, resolution="")
smma(src, length) =>
smma = 0.0
smma := na(smma[1]) ? sma(src, length) : (smma[1] * (length - 1) + src) / length
smma
v1 = smma(hl2, 15)
m1 = smma(hl2, 19)
m2 = smma(hl2, 25)
v2 = smma(hl2, 29)
@basnijholt
basnijholt / firewall.user
Created February 14, 2017 14:09 — forked from vsefer/firewall.user
Firewall config for OpenWrt to tunnel all traffic to VPN with OpenVPN
iptables -I OUTPUT -o tun+ -j ACCEPT
iptables -I INPUT -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -I FORWARD -o tun+ -j ACCEPT
iptables -I FORWARD -i tun+ -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -I POSTROUTING -o tun+ -j MASQUERADE
@basnijholt
basnijholt / migrate_repo.sh
Last active February 25, 2016 12:04 — forked from mariozig/migrate_repo.sh
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@gitlab.kwant-project.org:r-j-skolasinski/discretizer.git
# Change into newly created repo directory
$ cd ~/discretizer.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.