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 / Install_robo3t_Ubuntu.md
Created July 17, 2020 20:24 — forked from abdallahokasha/Install_robo3t_Ubuntu.md
Install Robo3t on Ubuntu18.04 and make a desktop icon for it

Install Robo3t On Ubuntu 18.04

Download the package form Robo3t or using wget
wget https://download.robomongo.org/1.2.1/linux/robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz
Extract here using

tar -xvzf robo3t-1.2.1-linux-x86_64-3e50a65.tar.gz

Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
@tonmanna
tonmanna / device-detection.conf
Created August 19, 2018 07:53
Nginx mapping for detecting device type from the user agent string
map $http_user_agent $device_type
{
default "desktop";
# Mobile bots
"~*SAMSUNG-SGH-E250\/1\.0 Profile\/MIDP-2\.0 Configuration\/CLDC-1\.1 UP\.Browser\/6\.2\.3\.3\.c\.1\.101 \(GUI\) MMP\/2\.0 \(compatible; Googlebot-Mobile\/2\.1; \+http:\/\/www\.google\.com\/bot\.html\)" 'botm';
"~*DoCoMo\/2\.0 N905i\(c100;TB;W24H16\) \(compatible; Googlebot-Mobile\/2\.1; \+http:\/\/www\.google\.com\/bot\.html\)" "botm";
"~*Mozilla\/5\.0 \(iPhone; CPU iPhone OS 8_3 like Mac OS X\) AppleWebKit\/600\.1\.4 \(KHTML, like Gecko\) Version\/8\.0 Mobile\/12F70 Safari\/600\.1\.4 \(compatible; Googlebot\/2\.1; \+http:\/\/www\.google\.com\/bot\.html\)" "botm";
"~*Mozilla\/5\.0 \(Linux; Android 6.0.1; Nexus 5X Build/MMB29P\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) .+ \(compatible; Googlebot\/2.1; \+http:\/\/www\.google\.com\/bot\.html\)" "botm";
@tonmanna
tonmanna / api.example.net.conf
Created August 7, 2018 19:40 — forked from mrluanma/api.example.net.conf
cache POST request with Nginx
upstream api_example_net {
server api.example.net:4000;
keepalive 600;
}
proxy_cache_path /var/cache/nginx/tag levels=1:2 keys_zone=tag:10m inactive=1d max_size=10g;
server {
listen 80;
server_name api.example.net;

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tonmanna
tonmanna / ethminer_ubuntu_nvidia.md
Created June 24, 2018 01:50 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@tonmanna
tonmanna / README.md
Created June 15, 2018 09:16 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@tonmanna
tonmanna / clean-up-boot-partition-ubuntu.md
Created June 6, 2018 15:55 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r