Skip to content

Instantly share code, notes, and snippets.

Heri Sim heri16

Block or report user

Report or block heri16

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
heri16 / post-robot.php
Last active Feb 15, 2019
getUser PHP Test Page
View post-robot.php
<title>Ask-The-Expert Test Page</title>
heri16 / cognito-decode-jwt-token.php
Last active Feb 9, 2019 — forked from jeffski/cognito-decode-jwt-token.php
Decode user identity from JWT Token
View cognito-decode-jwt-token.php
* Assumes library is installed: composer require spomky-labs/jose
* Check token claims guide:
use Jose\Checker\AudienceChecker;
use Jose\Factory\CheckerManagerFactory;
$claim_checker_list = [
// 'exp', // We should enable 'exp', but this example will fail as the token has already expired
heri16 /
Last active Dec 16, 2018
Self-signed Cert for Netflix
cat <<EOF > /usr/local/etc/Caddyfile {
tls /usr/local/etc/ /usr/local/etc/
proxy / https://$(dig @ -p 443 +tcp +short {
header_upstream Host {host}
heri16 /
Created Oct 31, 2018
How will blockchain impact the world and affect us?

How will blockchain impact the world and affect us?

Blockchain is a way if keeping records in a collective fashion, and somehow many say that Blockchain will open up new possibilities, change the world, and affect us all.

Today, we use the internet without giving it a second thought. Explaining how blockchain would impact the world is similar to explaining how the internet would impact the world in its early days, say the early 90s, when few understood its importance.

As an example, the global economy depends on the exchange of goods and services, and the internet has indeed connected more people across cities and borders, and along the way reinvented the way we buy or sell things. Take the example of online-marketplaces or ride-sharing services (like Alibaba, eBay or Uber): Without the internet all these ways of conducting business would not be possible. In a world without the internet, we would have to go the the local traditional market or store if we wanted to get anything. The poor or unemployed

heri16 / ReneAdminHttpService.ahk
Last active Jun 5, 2018
AutoHotKey Server to Automate Export/Import of XML data into CPSSoft RENE Admin via HTTP API.
View ReneAdminHttpService.ahk
#NoEnv ; Avoids checking empty variables to see if they are environment variables
#KeyHistory 0 ; Disable key history
#SingleInstance force ; Skips the dialog box and replaces the old instance automatically
SetBatchLines, -1 ; Never sleep (i.e. have the script run at maximum speed)
SendMode, Input ; Use faster and more reliable send method
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory
CoordMode, Mouse, Screen ; Make 0,0 the top-left of screen
SetTitleMatchMode, 3 ; Allow only exact window title matches
FileEncoding, UTF-8 ; Use UTF-8 file encoding
heri16 / AccurateFormInputHelper.ahk
Last active Sep 22, 2017
AutoHotKey Helper Tool to Automate data entry into CPSSoft Accurate Forms. Usage: Clipboard -> Alt+v
View AccurateFormInputHelper.ahk
#SingleInstance force
Hotkey, IfWinActive, ahk_class TfrmMain ahk_exe Accurate.exe
Hotkey, !v, HotkeyAutoInput
WinWait, ahk_class TfrmMain ahk_exe Accurate.exe
WinWaitClose, ahk_exe Accurate.exe
MsgBox "Accurate Exited."
heri16 / disable_win_autorun.ps1
Last active May 22, 2017
Disable Autorun in Windows
View disable_win_autorun.ps1
# Disable Autoplay
Write-Host "***Disabling Autoplay...***"
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
# Disable Autorun for all drives
Write-Host "***Disabling Autorun for all drives...***"
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
heri16 / enable_win_guard.ps1
Last active Jul 11, 2018
Enable Windows Device Guard and Windows Credential Guard
View enable_win_guard.ps1
# Enable Required Windows Features
Enable-WindowsOptionalFeature -Online -NoRestart -FeatureName:Microsoft-Hyper-V-Hypervisor -All
Disable-WindowsOptionalFeature -Online -NoRestart -FeatureName: Microsoft-Hyper-V-Tools-All, Microsoft-Hyper-V-Services
Get-WindowsOptionalFeature -Online -FeatureName "IsolatedUserMode" | Enable-WindowsOptionalFeature -Online -NoRestart
# Enable DeviceGuard Security Flags
#reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard" /v "EnableVirtualizationBasedSecurity" /t REG_DWORD /d 1 /f
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "EnableVirtualizationBasedSecurity" -PropertyType "DWORD" -Value 1 -Force
# Info Source:
heri16 / install_choco.ps1
Last active May 22, 2017
Install Chocolatey Package Manager (and Enable WinRM)
View install_choco.ps1
# Install & 7-zip
Set-ExecutionPolicy AllSigned -Force
$env:chocolateyDownloadUrl = ''
iex ((New-Object System.Net.WebClient).DownloadString(''))
choco install 7zip virustotaluploader -y
# Enabling WinRM
Write-Host "***Enabling WinRM Feature...***"
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString(''))
heri16 / win7_wannacry.ps1
Last active May 22, 2017
SMB Ransomware immunisation for Windows 7 and Vista
View win7_wannacry.ps1
# Source of Information:,-smbv2,-and-smbv3-in-windows-vista,-windows-server-2008,-windows-7,-windows-server-2008-r2,-windows-8,-and-windows-server-2012
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 0 -Force
# Source of Information:
Set-NetFirewallProfile -Profile Public -Enabled True
Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled False
$NLMType = [Type]::GetTypeFromCLSID('DCB00C01-570F-4A9B-8D69-199FDBA5723B')
$INetworkListManager = [Activator]::CreateInstance($NLMType)
You can’t perform that action at this time.