Skip to content

Instantly share code, notes, and snippets.

View tonmanna's full-sized avatar

Worawut Boontan tonmanna

View GitHub Profile
@tonmanna
tonmanna / header_filter_by_lua_example.md
Created August 3, 2023 07:43 — forked from ejlp12/header_filter_by_lua_example.md
nginx, openresty, transform/modify response body, header_filter_by_lua
@tonmanna
tonmanna / dom_performance_reflow_repaint.md
Created November 23, 2022 18:19 — forked from faressoft/dom_performance_reflow_repaint.md
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@tonmanna
tonmanna / k8s-renew-certs.sh
Created May 31, 2022 12:59
kubeadm Kubernetes Renew Certificate Command
kubeadm certs check-expiration
kubeadm certs renew all
systemctl restart kubelet
@tonmanna
tonmanna / redis-cli
Created March 24, 2022 11:19
redis-cli installer
https://codewithhugo.com/install-just-redis-cli-on-ubuntu-debian-jessie/
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
chmod 755 /usr/local/bin/redis-cli
@tonmanna
tonmanna / node.impl.js
Created March 9, 2022 09:29
source-map not working nrwl nx node
function getExecArgv(options: NodeExecutorOptions) {
const args = [
'-r',
require.resolve('source-map-support/register'),
...options.runtimeArgs,
];
if (options.inspect === true) {
options.inspect = InspectType.Inspect;
}
https://coralogix.com/blog/tutorial-elasticsearch-snapshot-lifecycle-management-slm/
curl -X PUT http://localhost:30265/_snapshot/repository -H 'Content-Type: application/json' -d '{"type": "url", "settings": { "url": "file:/backup" }}'
curl -X PUT "localhost:30265/_snapshot/repository?pretty" -H 'Content-Type: application/json' -d'{"type": "fs","settings": {"location": "backup_repo" }'
curl -X GET 'http://localhost:30265/_snapshot/backup_repository'
curl -X PUT 'http://localhost:30265/_snapshot/backup_repository' \
@tonmanna
tonmanna / rule.bash
Created November 3, 2021 16:27
UFW Block firewall
sudo ufw deny from {ip-address-here} to any
sudo ufw deny from 192.168.1.5 to any
sudo ufw reject from 202.54.5.7 to any
sudo ufw status
ufw deny from {ip-address-here} to any port {port-number-here}
sudo ufw deny from 202.54.1.5 to any port 80
@tonmanna
tonmanna / gist:683460a3be4318e5d9f2b9fe687c20c6
Last active July 30, 2023 12:48
LV PV Linux Extends Drive
https://carleton.ca/scs/2019/extend-lvm-disk-space/
Modify (extend) the LVM:
Tell LVM the physical partition size has changed: sudo pvresize /dev/vda1
Find the actual path of the LVM logical volume: sudo lvdisplay – The LV Path is the value needed
Tell LVM to extend the logical volume to use all of the new partition size: sudo lvextend -l +100%FREE /dev/COMPbase-vg/root – Using the LV Path from above
Resize the file system:
sudo resize2fs /dev/COMPbase-vg/root
@tonmanna
tonmanna / gist:ef23d95c199fcc2e0850095e3745b159
Created August 13, 2021 15:31
mount image file linux (limit folder size)
$ touch 2gbarea
$ truncate -s 2G 2gbarea
$ mke2fs -t ext4 -F 2gbarea
mke2fs 1.43.3 (04-Sep-2016)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: bf1b2ee8-a7df-4a57-9d05-a8b60323e2bf
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
@tonmanna
tonmanna / Flannel can't start POD
Last active January 2, 2023 10:18
Flannel can't start POD
Flannel not start
edit /etc/kubernetes/manifests/kube-controller-manager.yaml
at command ,add
--allocate-node-cidrs=true
--cluster-cidr=10.244.0.0/16
then,reload kubelet from flannel
https://github.com/coredns/deployment/issues/87
https://github.com/flannel-io/flannel/issues/728
docker rmi -f $(docker images -a -q)