Skip to content

Instantly share code, notes, and snippets.

View dahoba's full-sized avatar

Siritas S dahoba

View GitHub Profile
@dahoba
dahoba / white alt web color
Last active September 19, 2024 07:09
6 Colors to use instead of ffffffff by CraftwavesUx
Instead on White #FFFFFF
1. Of White #FAF9F6
2. Alice blue #F0F8FF
3. Pearl #FBFCFB
4. Egg Shell #FFF9E3
5. Coconut #FFF1E6
6. Parchment #FBF5DF
@dahoba
dahoba / capslock-and-reverse-scroll.ahk
Created September 13, 2024 04:40
AutoHotkey 2, switch keyboard layout with caplock and natural scroll wheel
#Requires AutoHotkey v2.0
; switch keyboard layout with caplock
Capslock::
{
Send "{LShift down}{LAlt down}{LShift Up}{LAlt Up}"
; Send, {Shift Down}{Alt Down}{Alt Up}{Shift Up}
; SoundBeep 999, 1
}
@dahoba
dahoba / howto_install_starship_under_gitbash.txt
Last active October 31, 2023 10:34
HOWTO Install starship prompt under Git Bash
We need extra arguments different than the [Original command](https://starship.rs/guide/#%F0%9F%9A%80-installation)
Open Git Bash; Execute command
```sh
mkdir ~/.config/starship
curl -sS https://starship.rs/install.sh | sh -s -- --yes --bin-dir ~/.config/starship
```
Edit `.bashrc` under Git Bash or file `C:/Users/Username/.bashrc` add this at the TOP of the file.
@dahoba
dahoba / gen-postgresql-ssl.sh
Created September 22, 2023 09:31
Shell script to generate postgresql SSL (RSA 4096)
#! /usr/bin/env bash
set -e
export MSYS_NO_PATHCONV=1
#https://www.postgresql.org/docs/12/ssl-tcp.html#SSL-CERTIFICATE-CREATION
# echo "clean old files"
# rm -rf postgresql
echo "generating new certificates"
@dahoba
dahoba / gh-runner-userdata.sh
Last active January 10, 2024 09:26
Github runner self-hosted userdata for ec2 AL2023 AMI
#!/bin/bash
# userdata.sh for ec2 AL2023 AMI
# to create an instance of Github self-hosted runner under ${GITHUB_ORG}
RCLONE_VERSION=1.62.2
ACTION_RUNNER_VERSION=2.311.0
TARGET_ARCH=arm64
GITHUB_ORG="my-org"
# user must be owner of the org
PAT="ghp_XX"
@dahoba
dahoba / find-github-member-name.sh
Last active June 7, 2023 15:05
shellscript that list all members under an organization in github private repo then find their username.
#!/bin/env bash
set -e
GITHUB_PAT=<your-github_pat>
ORG_LOGIN=<your-org-login>
results=$(curl --request GET --url "https://api.github.com/orgs/$ORG_LOGIN/members?per_page=80&page=1" --header 'Accept: application/vnd.github+json' --header "Authorization: Bearer $GITHUB_PAT" --header 'X-GitHub-Api-Version: 2022-11-28' | jq '[.[].url]' )
for result in $(echo "${results}" | jq -r '.[]') ; do
# echo "exe command: $result"
@dahoba
dahoba / gencerts.sh
Created October 2, 2022 05:09 — forked from ryankurte/gencerts.sh
Node.js Client Certificate Validation with Pinning Example
#!/bin/bash
# https://gist.github.com/ryankurte/bc0d8cff6e73a6bb1950
set -e
if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then
echo "Usage: $0 CA NAME ORG"
echo "CA - name of fake CA"
echo "NAME - name of fake client"
echo "ORG - organisation for both"
@dahoba
dahoba / admin.sql
Created October 1, 2022 15:15 — forked from phil-hildebrand/admin.sql
Handy PostgreSQL Monitoring Scripts
-- turn off paging (less/more)
psql> \pset pager off
/*
Pager usage is off.
*/
-- find an object name by id
SELECT OID, relname
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Capslock::
Send, {LShift down}{LAlt down}{LShift Up}{LAlt Up}
;Send, {Shift Down}{Alt Down}{Alt Up}{Shift Up}
;SoundBeep 999, 1
@dahoba
dahoba / 🎵 My Spotify Top Tracks
Last active December 26, 2023 00:32
My spotify top tracks
ให้ดาวช่วยปลอบประโลมหัว THEMOONWILLALWAYS
Barbie Girl Aqua
Silent Night Celtic Woman
เธอไม่ได้สอนให้ฉันอยู่ค SHERRY
Joy To The World Celtic Woman
อยากให้อยู่ด้วยไหม Asanee & Wasan
Santa Claus Is Coming T Celtic Woman
ลา ลา ลา Dept
I'll Be Home For Christ Celtic Woman
Boom, Boom, Boom, Boom!! Vengaboys