Skip to content

Instantly share code, notes, and snippets.

View lionants02's full-sized avatar

Max Thanachai Thongkum lionants02

View GitHub Profile
@lionants02
lionants02 / 7z-command.sh
Last active May 1, 2024 23:36
command 7z 7za encrypt and split file 1GB 4thread
7za -v1g a encrypted.7z -mx=3 -mmt=4 -ppassword -mhe=on /ttt
@lionants02
lionants02 / clearcache.sh
Created March 18, 2024 08:33
Ubuntu clear cache
#!/bin/bash
# Note, we are using "echo 3", but it is not recommended in production instead use "echo 1"
echo "echo 1 > /proc/sys/vm/drop_caches"
echo 1 > /proc/sys/vm/drop_caches
@lionants02
lionants02 / loop.sh
Created March 12, 2024 01:38
shell script loop
s_start=8
s_end=20
for j in $(seq $s_start $s_end); do
mkdir $j
max=8
for i in $(seq 1 $max); do
echo "$j $i"
mv l* L* $j/
sleep 7
@lionants02
lionants02 / pyramid apache echarts.js
Last active November 19, 2022 18:22
template Pyramid apache echarts
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
valueFormatter: (value) => Math.abs(value)
},
legend: {
itemWidth: 30,
@lionants02
lionants02 / curl-websocket.sh
Last active June 9, 2022 05:08 — forked from htp/curl-websocket.sh
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@lionants02
lionants02 / README.md
Created May 23, 2022 21:46 — forked from bwann/README.md
Tunnelling SSH over SSL/TLS

How to tunnel SSH over SSL/TLS

laptop ssh -> laptop stunnel -> evil network -> internet -> your server -> your server ssh

Server (your shell server/home box/work box/whatever)

Sets up a stunnel process listening externally on port 2443/tcp, forwards to localhost 22/tcp

  • Install stunnel, e.g. yum install stunnel
  • Install server config snippet to /etc/stunnel/stunnel.conf
@lionants02
lionants02 / thailand.json
Last active May 6, 2022 09:17 — forked from jeepkd/thailand.json
Simplified GeoJson for provinces of Thailand. Including new province Bueng Kan.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lionants02
lionants02 / 1027092.json
Last active January 8, 2021 05:02
Test Record(TPU)
{
"_id" : ObjectId("5ff7e70ad9a2815b7adc79f9"),
"type" : "Medication",
"status" : "active",
"category" : {
"code" : "medicine"
},
"code" : {
"coding" : [
{
@lionants02
lionants02 / amount1.json
Created January 4, 2021 21:54
nirun Medication alpha1
{
"_id" : ObjectId("5ff38d884ba9e3133372ba93"),
"type" : "Medication",
"status" : "active",
"category" : {
"code" : "medicine"
},
"code" : {
"coding" : [
{
@lionants02
lionants02 / gist:180cac019cb69d411a85bf41469cebaa
Created December 28, 2019 09:23
ShareX multi audio input
Set audio source = None
Additional command line arguemnts
```
-f dshow -i audio="Microphone (Realtek(R) Audio)" -f dshow -i audio="Stereo Mix (Realtek(R) Audio)" -filter_complex "[1:a][2:a]amerge=inputs=2[a]" -map 0 -map "[a]"
```
change audio=My device
and
filter_complex read https://ffmpeg.org/ffmpeg.html