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
heri16 / post-robot.php
Last active Feb 15, 2019
getUser PHP Test Page
View post-robot.php
<html>
<head>
<title>Ask-The-Expert Test Page</title>
<script
src="https://cdn.jsdelivr.net/npm/post-robot@9.0.36/dist/post-robot.min.js"
integrity="sha256-aHyRkHNH0WAVUfIA8XDrFrnQm/d9GGFeGs0pStD2f7k="
crossorigin="anonymous"
></script>
</head>
<body>
@heri16
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
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed: composer require spomky-labs/jose
* Check token claims guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Check.md
*/
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
heri16 / Caddyfile.sh
Last active Dec 16, 2018
Self-signed Cert for Netflix
View Caddyfile.sh
#!/bin/bash
cat <<EOF > /usr/local/etc/Caddyfile
https://ipv4-c001-sin001-ix.1.oca.nflxvideo.net {
tls /usr/local/etc/oca.nflxvideo.net.crt /usr/local/etc/oca.nflxvideo.net.key
proxy / https://$(dig @208.67.222.222 -p 443 +tcp +short ipv4-c001-sin001-ix.1.oca.nflxvideo.net) {
header_upstream Host {host}
insecure_skip_verify
}
}
@heri16
heri16 / blockchain-impact.md
Created Oct 31, 2018
How will blockchain impact the world and affect us?
View blockchain-impact.md

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
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
#Persistent
#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
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."
ExitApp
return
@heri16
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
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: https://docs.microsoft.com/en-us/windows/device-security/device-guard/deploy-device-guard-enable-virtualization-based-security#use-registry-keys-to-enable-vbs-and-device-guard
@heri16
heri16 / install_choco.ps1
Last active May 22, 2017
Install Chocolatey Package Manager (and Enable WinRM)
View install_choco.ps1
# Install chocolatey.org & 7-zip
Set-ExecutionPolicy AllSigned -Force
$env:chocolateyDownloadUrl = 'https://chocolatey.org/api/v2/package/chocolatey/0.10.3'
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install 7zip virustotaluploader -y
# Enabling WinRM
Write-Host "***Enabling WinRM Feature...***"
Invoke-Expression ((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))
@heri16
heri16 / win7_wannacry.ps1
Last active May 22, 2017
SMB Ransomware immunisation for Windows 7 and Vista
View win7_wannacry.ps1
# Source of Information: https://support.microsoft.com/en-in/help/2696547/how-to-enable-and-disable-smbv1,-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: https://www.peppercrew.nl/index.php/2016/02/change-network-connection-category-using-powershell/
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.