Skip to content

Instantly share code, notes, and snippets.

Worawut Boontan tonmanna

Block or report user

Report or block tonmanna

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tonmanna
tonmanna / device-detection.conf
Created Aug 19, 2018
Nginx mapping for detecting device type from the user agent string
View device-detection.conf
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 Aug 7, 2018 — forked from mrluanma/api.example.net.conf
cache POST request with Nginx
View api.example.net.conf
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;
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@tonmanna
tonmanna / ethminer_ubuntu_nvidia.md
Created Jun 24, 2018 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04
View ethminer_ubuntu_nvidia.md

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 Jun 15, 2018 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

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 Jun 6, 2018 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64
View clean-up-boot-partition-ubuntu.md

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 
@tonmanna
tonmanna / cloudSettings
Last active Jan 17, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-01-17T06:49:46.110Z","extensionVersion":"v3.2.4"}
@tonmanna
tonmanna / cloudSettings
Created May 23, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-05-23T06:41:08.046Z","extensionVersion":"v2.9.2"}
@tonmanna
tonmanna / cloudSettings
Last active May 1, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-05-01T10:59:31.740Z","extensionVersion":"v2.9.1"}
@tonmanna
tonmanna / Grayscale.css
Last active Oct 14, 2016
Grayscale CSS
View Grayscale.css
img {
-moz-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
-o-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
-webkit-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
filter: grayscale(100%) !important;
}
body{
-moz-filter: grayscale(100%) !important;
-o-filter: grayscale(100%) !important;
-webkit-filter: grayscale(100%) !important;
You can’t perform that action at this time.