Skip to content

Instantly share code, notes, and snippets.


Pandu E POLUAN pepoluan

View GitHub Profile
pepoluan /
Created Dec 14, 2020
Simple RFC5424-over-UDP Logging Handler & Formatter
logger = logging.getLogger()
facility = 23 # local7; see RFC 5424
formatter = RFC5424Formatter(appname="my-awesome", facility=facility)
syslog_handler = UTF8DatagramHandler("", 514)
pepoluan /
Last active Mar 10, 2020
Simple Detection of Text File Encoding
# This code is released to the Public Domain.
# Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause
# Please do note that this does NOT attempt to perform complex guessing e.g. CP437 or CP850 or GB18030 or JIS or...
# Well, you get the idea.
# This function will simply try to guess the most common *Unicode* encoding, i.e., UTF-8, UTF-16, and UTF-32
# More ... 'exotic' unicode encoding such as UCS-1, UCS-2, UTF-7, etc are NOT detected. (They would likely be
# detected as "utf-8" by this function)
# If you need more 'advanced' detection, use the heavyweight "chardet" library instead.
pepoluan / setdns.ps1
Created Dec 19, 2019
DNS Switcher Script for PowerShell
View setdns.ps1
# This code is released to the Public Domain.
# Alternatively, you can use one of the following licenses: Unlicense OR CC0-1.0 OR WTFPL OR MIT-0 OR BSD-3-Clause
[string] $server,
[string] $iface = "Wi-Fi", # EDIT AS NEEDED
[string] $dns_service = "dnscrypt-proxy" # EDIT AS NEEDED

Keybase proof

I hereby claim:

  • I am pepoluan on github.
  • I am pepoluan ( on keybase.
  • I have a public key ASD3184JHBHYutCiRnsXJIrOjz5XDGtzsnfOQElHSpivZgo

To claim this, I am signing this object:

pepoluan /
Last active Feb 26, 2020
SSH Agent Socket Interaction
import os
import socket
import sys
import struct
import contextlib
# Reference for the data structure / interaction:
# Good to read:
pepoluan / Byteify.vb
Created Sep 1, 2015
Byteify User-Defined Function -- convert "###.## KB/GB/MB/KiB/MiB/GiB" to values
View Byteify.vb
' 1. Open Excel's VBA Editor using Alt-F11
' 2. Right-Click on the "VBAProject (Spreadsheet_Name)" entry and choose "Insert > Module"
' 3. Paste the below code starting from the line beginning with "Function" up to and including the line "End Function"
' 4. Now you can use the User-Defined Function in your spreadsheet
' =Byteify(Cell, [AssumeBinaryPrefix=False])
' Cell : The Cell Reference (if actually a range, it will use the top left cell only)
' AssumeBinaryPrefix : KB, MB, GB will be assumed to be powers of 1024 (in other words, same as KiB, MiB, GiB)
pepoluan / NFSU2_TexMod_CPUAff.ahk
Last active Sep 4, 2015
NFSU2 + TexMod Loader, also sets CPU Affinity
View NFSU2_TexMod_CPUAff.ahk
; The purpose of this script is to start Need for Speed: Underground 2 (NFSU2) from TexMod, after loading a
; texture replacement package (TPF). This script also sets CPU Affinity of NFSU2's SPEED2.EXE, because SPEED2.EXE
; is not happy with a multicore processor; it wants to stay on one core and one core only.
#Include <Affinity_Set>
; Affinity_Set() is a function from affinity.ahk, which should be placed in
; a lib/ subdirectory (from where this script is located)
; My version was from
; ===== TUNABLES =====
pepoluan /
Last active Aug 29, 2015
This script pulls the timeline from the "Timeline of Canon Media" article on Wookieepedia, and extracts the information into a CSV file that can be opened directly (without using Text Import Wizard) by Excel.
#!/usr/bin/env python
from __future__ import print_function, division, unicode_literals
__author__ = 'Pepoluan'
import sys
import codecs
import re
import datetime
pepoluan / init.sls
Last active Aug 29, 2015
SaltStack State to install vim and update the syntax files
View init.sls
# This init.sls state file should be put into /srv/salt/vim
# And /srv/salt/vim/syntax should contain the VimL scriptfiles you list in syntax_updates below
### TUNABLES ###
# Separate entries with a comma
# Make sure every entry exists in the syntax/ directory
syntax_updates = [ 'sh.vim' ]
View python_vs_pypy
C:\Users\pandu.edward\sims3py\Scripts\python.exe -m sims3utils.test_corrupt --profile E:\z\Sims3\Shrisle_0x00000000\Shrisle_0x00000000.nhd
--profile specified, --quiet (if specified) will be canceled
File to check: E:\z\Sims3\Shrisle_0x00000000\Shrisle_0x00000000.nhd
Stage 1: Header check...OK
Stage 2: Index check...OK
29735 Index Entries in 9.80184892035 seconds
Stage 3: Res check. THIS WILL TAKE A LONG TIME!
29735 Resources in 41.1855053353 seconds
No corruption found.