Skip to content

Instantly share code, notes, and snippets.

View billyriantono's full-sized avatar
:octocat:
git commit -m "Welcome"

Billy R billyriantono

:octocat:
git commit -m "Welcome"
  • Around the world
View GitHub Profile
@billyriantono
billyriantono / .gitignore
Created November 5, 2023 03:12 — forked from kosh04/.gitignore
Chrome Cookies Decrypter
cookie.txt
@billyriantono
billyriantono / MFBadgeButton
Created August 27, 2023 15:06 — forked from moflo/MFBadgeButton
Swift add badge to UIButton - MFBadgeButton.swift
class MFBadgeButton : UIButton {
var badgeValue : String! = "" {
didSet {
self.layoutSubviews()
}
}
override init(frame :CGRect) {
@billyriantono
billyriantono / debian-oh-my-zsh.md
Created January 16, 2023 10:20 — forked from jclosure/debian-oh-my-zsh.md
Setup Debian/Ubuntu with oh-my-zsh

Install and setup oh-my-zsh - Add hostname to your prompt so you can tell it apart from mac's shell

sudo apt-get install zsh
sudo apt-get install git-core
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Change default shell to zsh

How to build a load balancer with BGP and ECMP using VyOS

According to this cloudflare blog article "Load Balancing without Load Balancers", we can build a rock-solid load balancer only using a router. All the magic comes from BGP and Equal-Cost Multi-Path routing.

In this howto, I will use bird as BGP router on linux instance (ie. servers).

Test environment

I use GNS3 with this architecture :

architecture

### macOS Catalina: “App is damaged and can't be opened. You should move it to the trash.”
```
sudo xattr -rd com.apple.quarantine '/Applications/Navicat Premium.app'
```
@billyriantono
billyriantono / vyos_sample_site-2-site_vpn.sh
Created December 5, 2021 15:53 — forked from RafPe/vyos_sample_site-2-site_vpn.sh
Vyos sample site-to-site vpn configuration
# Virtual Tunnel Interface
# 172.196.17.188 - 172.196.17.191
set interfaces vti vti0 address 172.196.17.190/30
set interfaces vti vti0 description 'Virtual tunnel interface for VPN tunnel'
# Phase 2
set vpn ipsec esp-group ESP-Default compression 'disable'
set vpn ipsec esp-group ESP-Default lifetime '3600'
set vpn ipsec esp-group ESP-Default mode 'tunnel'
set vpn ipsec esp-group ESP-Default pfs 'dh-group16'
@billyriantono
billyriantono / bird1-bird-vultr.conf
Created November 3, 2021 18:47 — forked from aveao/bird1-bird-vultr.conf
BIRD 1 and 2 configs for BGP stuffs (HE Tunnelbroker, Vultr etc)
router id [our IPv4];
protocol bgp vultr
{
local as [our ASN];
source address [our IPv4 from vultr];
import all;
export filter {
if net ~ [[the IPv4 block we want to announce]] then accept;
reject;
@billyriantono
billyriantono / AutoReinstall.sh
Created October 12, 2021 04:54 — forked from i-sync/AutoReinstall.sh
DD scripts backup
#!/bin/sh
if [[ $EUID -ne 0 ]]; then
clear
echo "Error: This script must be run as root!" 1>&2
exit 1
fi
function CopyRight() {
clear
@billyriantono
billyriantono / pdo-wrapper.php
Created March 25, 2021 07:35 — forked from eimg/pdo-wrapper.php
Simple yet secure PHP PDO database wrapper with CRUD methods...
<?php
# PDO Wrapper, supporting MySQL and Sqlite
# Usage:
# $db = new db();
#
# // table, data
# $db->create('users', array(
# 'fname' => 'john',
# 'lname' => 'doe'
# ));
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import subprocess
device = "msm8996-common"
vendor = "xiaomi"
system = "system/"