Skip to content

Instantly share code, notes, and snippets.

View thetminko's full-sized avatar
💬

Thet Min Ko thetminko

💬
View GitHub Profile
@thetminko
thetminko / axios.js
Created November 15, 2023 05:36 — forked from arvindkumarbadwal/axios.js
Axios SSL Certificate Pinning
const tls = require('tls');
const https = require('https');
const crypto = require('crypto');
const axios = require('axios');
function sha256(s) {
return crypto.createHash('sha256').update(s).digest('base64');
}
const options = {
@thetminko
thetminko / aws-session-manager.sh
Created February 18, 2023 06:54
AWS Session Manager
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/mac/session-manager-plugin.pkg" -o "session-manager-plugin.pkg"
sudo installer -pkg session-manager-plugin.pkg -target /
sudo ln -s /usr/local/sessionmanagerplugin/bin/session-manager-plugin /usr/local/bin/session-manager-plugin
@thetminko
thetminko / GlobalProtect.txt
Created February 8, 2023 02:30
Disable Global Protect Startup on Mac
cd /Library/LaunchAgents
Open com.paloaltonetworks.gp.pangpa.plist and change to false for RunAtLoad and KeepAlive
Open com.paloaltonetworks.gp.pangps.plist and change to false for RunAtLoad
@thetminko
thetminko / allow_touch_id.sh
Created February 7, 2023 05:35
Allow Touch ID in Terminal
vim /etc/pam.d/sudo
auth sufficient pam_tid.so
export enum DateFormat {
// ISO 8601
API_DATE = 'YYYY-MM-DD',
API_DATETIME = 'YYYY-MM-DDTHH:mm:ssZ',
API_TIME = 'HH:mm:ss',
// These should be the standardized formats for displaying date/time on frontend,
// if designers' designs show otherwise, we should advise them to standardize the format by using these
DISPLAY_DATE = 'DD MMM YYYY',
DISPLAY_DATETIME = 'DD MMM YYYY, h:mm A',
export const Regex = {
POSTAL_CODE: /^[0-9]{6}$/,
ADDRESS_FLOOR: /^[0-9]{1,2}[a-zA-Z]?$/,
ADDRESS_UNIT: /^[0-9][a-zA-Z0-9]{1,4}$/,
CONTACT_NUMBER: /^(9[0-8]|[368][0-9])[0-9]{6}$/,
LAND_LINE_NUMBER: /^[36][0-9]{7}$/,
MOBILE_NUMBER: /^(9[0-8]|8[0-9])[0-9]{6}$/,
// RFC 5322
EMAIL: /^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/,
PEOPLE_NAME: /^[a-zA-Z @\-–/().,'’]+$/,
@thetminko
thetminko / ssl_public_key.sh
Created September 14, 2021 13:36
SSL public key
openssl s_client -servername $1 -connect $1:443 | openssl x509 -pubkey -noout | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
@thetminko
thetminko / upgrade-npm-packages.sh
Created November 23, 2020 01:56
Upgrade all packages to latest
npx npm-check-updates -u
@thetminko
thetminko / docker-compose.yml
Last active October 23, 2020 06:55
docker-compose for local db
version: '3.8'
services:
mysql:
container_name: mysql8
image: mysql:8.0.22
ports:
- 3306:3306
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=
@thetminko
thetminko / .eslintrc.json
Last active October 21, 2020 04:19
ESLint for React Typescript
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"settings": {
"react": {
"version": "detect"
}