Skip to content

Instantly share code, notes, and snippets.

@nyx-rattapoom
nyx-rattapoom / disable_dp14_dell.txt
Created September 14, 2024 16:39
Disable DP 1.4 on Dell S2721DGF Display
I have problem with my old Macbook Air 2014 when connect minidp to DP on DELL S2721DGF
---
Due to my not support DP1.4 we sill able to use DP upto 1.1am, It could be done by step belows
DP 1.4 Enabled is the Factory default. You had to manually do the following to change it from DP 1.4 to DP 1.1a =
1. Open the OSD Menu
2. go to 'Input Source'
3. move cursor to DP then hold select for 8 seconds.
@nyx-rattapoom
nyx-rattapoom / hp-280-g2-mt-legacy-advance-bios.txt
Last active February 16, 2025 17:25
HP 280 G2 MT Legacy Advance Bios Setting
1. Press - ESC during booting
2. F10 to Enter BIOS Setting
Once you see BIOS Scree
- Press CTRL + A (release)
- Press CTRL + Q (release)
---- BOOM Done ----
Check you alredy in advance setting mode.
@nyx-rattapoom
nyx-rattapoom / mikrotik-update-wg-endpoint-by-url.ros
Created April 27, 2024 13:09
Mikrotik update wireguard peers endpoint by resolve from url
:local vpnEndpoint "your-domain.com"
# Check WAN Link is bound
if ([/ip/dhcp-client/ get ether2-wan status] != "bound") do={
log info "Ether2 wan is not bound, skip update process"
/exit
}
# Find WAN Gateway
:local wanGateway [/ip/dhcp-client/ get ether2-wan gateway]
@nyx-rattapoom
nyx-rattapoom / gist:4581da775939bff020485d51f32b76b2
Created April 8, 2023 09:45
disable hibernate mode on macos when issue with m2 ssd
// for disable
sudo pmset -a hibernatemode 0
// for re-enable
sudo pmset -a hibernatemode 3
@nyx-rattapoom
nyx-rattapoom / output.sh
Last active March 8, 2023 10:30
tensorflow.js js vs wasm performance on raspberry pi 1b
dietpi@rpi-b:~/tensor_js$ time node main.js
The predicted class is 286 with probability 12.73.
real 1m35.460s
user 1m21.866s
sys 0m6.460s
dietpi@rpi-b:~/tensor_js$ time node main.js
============================
Hi, looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, visit https://github.com/tensorflow/tfjs-node for more details.
NVM_NODEJS_ORG_MIRROR=https://unofficial-builds.nodejs.org/download/release nvm install
@nyx-rattapoom
nyx-rattapoom / docker-compose.yml
Created January 7, 2023 17:05
docker resource limit
version: '3'
services:
service_name:
image: repo/image_tag
deploy:
cpus: 0.5
mem_limit: 2g
@nyx-rattapoom
nyx-rattapoom / read_test.sh
Created January 7, 2023 16:45
disk read performance test
sudo dd if=/dev/sdXY of=/dev/null bs=1M count=1024
sudo hdparm -Tt /dev/sdXY
@nyx-rattapoom
nyx-rattapoom / fstab
Last active January 7, 2023 16:25
fstab for mount external storage for rpi
UUID from `blkid` command
```
UUID=501d62de-a465-48e1-bdda-60c2ef81aeeb /mnt/external ext4 defaults,nofail,noatime 0 1
```
# Resource
https://windowsbulletin.com/fstab/
https://manpages.debian.org/bullseye/mount/fstab.5.en.html
@nyx-rattapoom
nyx-rattapoom / iperf.txt
Last active August 18, 2022 11:46
iperf zerotier vs tailscale
Accepted connection from 10.10.0.101, port 51666
[ 5] local 10.10.0.100 port 5201 connected to 10.10.0.101 port 51668
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 9.29 MBytes 77.9 Mbits/sec
[ 5] 1.00-2.00 sec 19.2 MBytes 161 Mbits/sec
[ 5] 2.00-3.00 sec 19.8 MBytes 166 Mbits/sec
[ 5] 3.00-4.00 sec 18.2 MBytes 152 Mbits/sec
[ 5] 4.00-5.00 sec 17.9 MBytes 150 Mbits/sec
[ 5] 5.00-6.00 sec 12.4 MBytes 104 Mbits/sec
[ 5] 6.00-7.00 sec 16.3 MBytes 137 Mbits/sec