Skip to content

Instantly share code, notes, and snippets.

View heri16's full-sized avatar

Heri Sim heri16

View GitHub Profile
@heri16
heri16 / syncthing-service.xml
Created October 27, 2014 10:04
Syncthing Service Configuration File
<service>
<id>syncthing</id>
<name>Syncthing</name>
<description>Syncthing</description>
<executable>D:\syncthing\syncthing.exe</executable>
<logpath>D:\syncthing\log</logpath>
<logmode>roll</logmode>
<depend></depend>
<argument>-home D:\syncthing\data</argument>
<argument>-logfile D:\syncthing\log\syncthing.log</argument>
@heri16
heri16 / syncthing-service.exe.config
Created October 27, 2014 10:06
Syncthing Service Runtime Config for .NET v4.0
<configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v4.0" />
</startup>
</configuration>
@heri16
heri16 / syncthing-service.cmd
Created October 27, 2014 10:07
Syncthing Service Install/Uninstall Script
syncthing-service.exe uninstall
syncthing-service.exe install
pause
@heri16
heri16 / IRremoteInt.h
Created May 21, 2015 13:20
Arduino IRremote Library for LightBlue Bean
/*
* IRremote
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* Modified by Paul Stoffregen <paul@pjrc.com> to support other boards and timers
*
* Interrupt code based on NECIRrcv by Joe Knapp
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
@heri16
heri16 / IRremote.h
Created May 21, 2015 13:25
Arduino IRremote Library for LightBlue Bean
/*
* IRremote
* Version 0.1 July, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.htm http://arcfn.com
* Edited by Mitra to add new controller SANYO
*
* Interrupt code based on NECIRrcv by Joe Knapp
* http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1210243556
* Also influenced by http://zovirl.com/2008/11/12/building-a-universal-remote-with-an-arduino/
@heri16
heri16 / IRremote.cpp
Created May 21, 2015 13:27
Arduino IRremote Library for LightBlue Bean
/*
* IRremote
* Version 0.11 August, 2009
* Copyright 2009 Ken Shirriff
* For details, see http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* Modified by Paul Stoffregen <paul@pjrc.com> to support other boards and timers
* Modified by Mitra Ardron <mitra@mitra.biz>
* Added Sanyo and Mitsubishi controllers
* Modified Sony to spot the repeat codes that some Sony's send
@heri16
heri16 / ECS-LaunchConfig-User-Data
Last active October 1, 2015 11:16
aws-ecs-netflix-proxy
#!/bin/bash
echo ECS_CLUSTER=default >> /etc/ecs/ecs.config
yum update -y curl tar
rm -rf /opt/netflix-proxy/
curl -L https://github.com/ab77/netflix-proxy/archive/master.tar.gz | tar xz --directory /opt/ && mv /opt/netflix-proxy-master /opt/netflix-proxy
curl -Lo /opt/netflix-proxy/build.sh https://gist.github.com/heri16/e68357298869618e7871/raw/build.sh
curl -Lo /var/lib/cloud/scripts/per-boot/netflix-proxy-data.sh https://gist.github.com/heri16/e68357298869618e7871/raw/netflix-proxy-data.sh
chmod +x /var/lib/cloud/scripts/per-boot/netflix-proxy-data.sh
@heri16
heri16 / bgpd.conf
Last active February 21, 2023 05:40
AWS VPC VPN StrongSwan Virtual Tunnel Interface (VTI)
#@ /etc/quagga/bgpd.conf (Centos & Ubuntu)
hostname <Local OS hostname>
password <Any random phrase>
enable password <Any random phrase>
!
log file /var/log/quagga/bgpd
!debug bgp events
!debug bgp zebra
debug bgp updates
@heri16
heri16 / 1-EnableWinRM.ps1
Last active January 27, 2016 04:26
SoftwareUpgradeNasional
# 0. Hanya untuk Win7, buka "Network and Sharing Center", dan pastikan semua koneksi tipe nya sudah di set ke "Work/Home" bukan Public.
# 1. Masuk ke Powershell Administrator.
# 2. Pilih sebuah password yang minim ada huruf besar dan simbol, dan edit di bagian $password
# 4. Copy-Paste seluruh script ini ke dalam Powershell Administrator.
# Pilih sebuah password yang minim ada huruf besar dan simbol, dan edit variable tersebut (sebelum di execute di shell):
$password = 'P@sswordPilihanNyaCabangMasing2'
clear
defmodule Fizzbuzz do
def fizzbuzz_case(num) do
case num do
num when rem(num, 15) == 0 -> "FizzBuzz"
num when rem(num, 5) == 0 -> "Buzz"
num when rem(num, 3) == 0 -> "Fizz"
num -> num
end
end