Skip to content

Instantly share code, notes, and snippets.

View heri16's full-sized avatar

Heri Sim heri16

View GitHub Profile
@heri16
heri16 / 0-s3-multiple-get.html
Last active October 22, 2020 10:50
Browser Download Multiple Files into ZIP with S3 GetObject (Pure Client-side)
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Saving multiple files as zip</title>
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.773.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/amazon-cognito-identity-js@4.4.0/dist/amazon-cognito-identity.min.js"></script>
<script src="https://gist.githubusercontent.com/heri16/d4e325a13c3e57f7e24ada1f7c459843/raw/events.js"></script>
@heri16
heri16 / 0-README.md
Last active August 4, 2023 16:31
Patch chrome-remote-desktop to use DISPLAY 0

Usage

curl -o- https://gist.githubusercontent.com/heri16/c64ec7a20334cc4037ab879083bed5a4/raw/chrome-remote-desktop.patch | sudo patch /opt/google/chrome-remote-desktop/chrome-remote-desktop
crd --restart
@heri16
heri16 / aws-aurora-pg.sh
Last active August 7, 2020 11:11
Connect easily to AWS Aurora Postgres - sslmode
mkdir -p ~/.postgresql && curl -o- https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem | tee ~/.postgresql/root.crt
psql "postgresql://postgres:<password>@prod.cluster-<xxxxxxxxx>.ap-southeast-1.rds.amazonaws.com/<dbname>?sslmode=verify-full"
# OR
curl -o- https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem | tee rds-ca-2019-root.pem
psql "postgresql://postgres:<pasword>@prod.cluster-<xxxxxxxxx>.ap-southeast-1.rds.amazonaws.com/<dbname>?sslmode=verify-full&sslrootcert=rds-ca-2019-root.pem"
@heri16
heri16 / 0-README.md
Last active August 17, 2021 16:43
AWS Bastion Setup - Arch Linux

AWS Bastion Setup

This tutorial will help you setup a Bastion host on AWS.

Arch Linux is most suitable for this task as it is the most lightweight distro after the likes of TinyCoreLinux and Alpine Linux, runs the latest Stable Linux Kernel with up-to-date security, and allows rolling upgrades with no downtime. (Such features are not available from common distros like Centos and Ubuntu server.)

1. Create AWS VPC

This step is optional but avoids "VPC Peering" issues with other AWS regions (if you need them in future).

https://hangouts.google.com/call/5RtETsKTnsGnQHAnPgN5ACEM
@heri16
heri16 / win10.xml
Created June 26, 2020 21:50
QEMU KVM - GPU Passthrough with AMD APIC - Windows 10
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
<name>win10</name>
<uuid>d2c97462-3a70-4afb-ab72-5916e8ac25ae</uuid>
<title>Windows 10</title>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit="KiB">8388608</memory>
@heri16
heri16 / 90-mkinitcpio-install.hook.patch
Last active April 26, 2024 04:57
Enable Linux Secure Boot with TPM 2.0 (Manjaro / Archlinux) - rEFInd
--- /usr/share/libalpm/hooks/90-mkinitcpio-install.hook 2020-03-05 12:45:41.000000000 +0800
+++ /etc/pacman.d/hooks/90-mkinitcpio-install.hook 2020-06-13 23:08:32.861202141 +0800
@@ -8,5 +8,7 @@
[Action]
Description = Updating linux initcpios...
When = PostTransaction
-Exec = /usr/share/libalpm/scripts/mkinitcpio-install
+Exec = /usr/local/share/libalpm/scripts/mkinitcpio-install
+Depends = sbsigntools
+Depends = x11-ssh-askpass
@heri16
heri16 / Corefile
Last active May 21, 2020 15:32
Netflix DPI Evasion - TLS ClientHello Deep Packet Inspection
#oca.nflxvideo.net {
# # Cloaking: Make *.oca.nflxvideo.net resolve to 127.0.0.1
# rewrite name regex (.+)\.oca\.nflxvideo\.net oca.nflxvideo.net
# hosts {
# 127.0.0.1 oca.nflxvideo.net
# }
#}
. {
# Cloaking: Make *.oca.nflxvideo.net resolve to 127.0.0.1 (localhost)
@heri16
heri16 / README.md
Last active March 23, 2022 04:02
Download / Record Youtube Live stream
@heri16
heri16 / cloud-config.yml
Last active July 3, 2023 14:36
RancherOS cloud-init
#cloud-config
# Validate: sudo ros config validate -i cloud-config.yml
# Usage: sudo ros install -c https://bit.ly/ros-cloud-config -d /dev/sda -s --append "rancher.autologin=tty1 rancher.autologin=ttyS0"
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCsnVbSuI95xB2jvcTysn0tAeQfm0zVNWYuqB0xVWiAQIyMWjSbDiXGHxHlP980Dqz1Yq3rOjXQBK2Dfi9FnpLXybQZr/VwOxPOLfisbez49UgI1uPfg/bzQB8ezqn0qDgnnLxEOldeoE0w0gUwQs1tMw5kt9wvsACc2VdYiT1B3iKmckPUfNT0SikkZ5yW/YBrvLP2M1m3Ip4i8MGRi8CfpuRuH6Yt6da9MPe7FK4IsSpVUbQPwKF0TUB0mA5SFtZvjnqgQUxLAANGQcwPDXqiOiXZYb2yRPDeuSerN35BcX2NtS0yW+bgqOfTDA9BXWBdSZ1JLzhSHmgPNmgeHOqzcEhXGPa7qtPACKgg8C9zaevFCENBlCo8ybIi00SICLiEGKPhgfr8UPT6+z5B6k+HinMKvCMfn5LcaTOeGXxS/BNDnQveToOZ0wcD3hA8/OZlP7hth55BNJoscornj0Vma9qQUeY6UxffypbY4uo4eZA+i8su9Sv01XMFQO0SdBg00l+dPM6wugtVOUwDuKrBwKb0kubZsWKz5jxKcsgABoxUUPiN/7a3KbToYeRi8zxZKkD5HFpvMT1AGqOHv0aIMc+iyFPXYk1MIrvPnTuViJ/haLHdMdDbw9fuKLfNQcGi07Xb4AfE7caAGJyGgjMcTaQ3lu8eJbVJNpjK/nIfyw== Heri-no-iPhone
rancher:
console: ubuntu # https://rancher.com/docs/