Skip to content

Instantly share code, notes, and snippets.

View heri16's full-sized avatar

Heri Sim heri16

View GitHub Profile
@heri16
heri16 / repack-android-boot-ramdisk.sh
Last active June 15, 2016 14:45
Repack Android Boot Kernel / Ramdisk
open http://rex-shen.net/android-unpackpack-factory-images/
@heri16
heri16 / thing_shadow.ex
Last active July 17, 2017 03:52
Elixir ThingShadow Client for AWS IoT based on emqttc
defmodule Aws.Iot.ThingShadow do
@moduledoc ~S"""
Implements the AWS IoT ThingShadow Data Flow behaviour.
Closely follows the logic from the official nodejs library, with minor deviations to adapt to Elixir Coding Conventions:
https://github.com/aws/aws-iot-device-sdk-js/blob/master/thing/index.js
Elixir/Erlang's GenEvent executes handlers sequentially in a single loop of the GenEvent.manager process.
To avoid this bottleneck, please ensure that each ThingShadow process has a different `GenEvent.manager`.
@heri16
heri16 / registry.ex
Created July 7, 2016 06:14
Simple module that wraps the :syn erlang library, in order to conform to Elixir's send "via-module-tuple" schematics.
defmodule Syn.Registry do
@moduledoc ~S"""
Simple module that wraps the :syn erlang library, in order to conform to Elixir's send "via-module-tuple" schematics.
This wrapper is temporary until :sync erlang library supports the use from Elixir directly.
"""
# "Via" API
@spec whereis_name(any) :: pid | :undefined
@heri16
heri16 / ProcessExtensions.cs
Created July 13, 2016 16:17
Powershell / C# class to start a GUI Windows Process on the desktop/session of any logged-in RDP/TS user.
using System;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
using System.IO;
namespace heri16
{
/// <summary>
/// Static class to help Start a GUI/Console Windows Process as any user that is logged-in to an Interactive Terminal-Session (e.g. RDP).
@heri16
heri16 / mail_expired_del.php
Created September 16, 2016 10:27
Delete expired email from IMAP server
<?php
$server_spec = "{****-****.accessdomain.com:993/imap/ssl}";
$mbox = imap_open($server_spec, $argv[1], $argv[2], OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
echo "=================== Connected ===================\n";
echo "Getting list of mailboxes...\n";
$list = imap_getmailboxes($mbox, $server_spec, "*");
@heri16
heri16 / NetwatchGatewayStates.rsc
Last active December 19, 2021 11:13
Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch)
# Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch).
# Supports both Generic and PPPoE interfaces.
# Policy: read, write, policy, test
### Configuration ###
# Define Names of all Interfaces that will be checked:
:local "interface-names" { "internet-speedy";"internet-biznet" };
@heri16
heri16 / RenePrintLabelHelper.ahk
Last active September 22, 2017 02:06
AutoHotKey Helper Tool to Automate printing labels of multiple items in RENE Admin. Usage: Clipboard -> Alt+v
#NoEnv
#UseHook off
#KeyHistory 0
#SingleInstance force
SetBatchLines, -1
SetTitleMatchMode, 3
GroupAdd, wGroup, ahk_class TfrmDialog ahk_exe reneadmin.exe
GroupAdd, wGroup, ahk_class TfrmItemSearch ahk_exe reneadmin.exe

Keybase proof

I hereby claim:

  • I am heri16 on github.
  • I am heri16 (https://keybase.io/heri16) on keybase.
  • I have a public key ASDS0zp8Qln9AGbd6zPDOSNq3AsFlZLy-QjULDBiQ4TSqQo

To claim this, I am signing this object:

@heri16
heri16 / IdeReformasiPilkada.md
Last active March 13, 2017 03:00
Ide Reformasi Birokrasi Dan Tata Kelola Pilkada. Mohon masukan dan komentar nya...

logo KPU

Latar Belakang

Saat melihat banyak masalah yang terjadi sekian rupa di Pilkada DKI 2017 (dari masalah formulir C6 atau kertas suara yang tidak sampai ke tangan pemilih yang ingin mengikuti pesta demokrasi), tentu kami sebagai warga Jakarta menjadi sangat prihatin. Banyak video tersebar online seperti ini di mana pakar nya menyatakan "Bagaimanapun memilih itu adalah hak politik ya, kalau bisa dimudahkan ya... contoh yang tadi menunjukan, Mungkin si petugas tidak salah, si warga juga tidak salah. Ini kan akibat mekanisme yang mungkin tidak menfasilitasi atau belum memfasilitasi esensi dari kemudahan itu sendiri." Saat nya mulai bertanya: Kenapa kita sebagai bangsa kesatuan ini bisa masuk dalam kondisi seperti sekarang? Apa ada cara yang lebih baik dan tertip?

Buat apa ada sesuatu bentuk atau konsep e-KTP jika *teknologi di

@heri16
heri16 / user-data.txt
Created April 5, 2017 04:04
Docker-CE Cloud-init for Ubuntu 16.04 (LTS)
#cloud-config
# Upgrade the instance on first boot
# (ie run apt-get upgrade)
#
# Default: false
# Aliases: apt_upgrade
package_upgrade: true
# Install additional packages on first boot