Skip to content

Instantly share code, notes, and snippets.

View mrnonz's full-sized avatar
🎯
Focusing

Nontawat Numor mrnonz

🎯
Focusing
View GitHub Profile
//
// main.c
// Radix_sort
//
// Created by Nontawat Numor on 8/19/2558 BE.
// Copyright (c) 2558 Nontawat Numor. All rights reserved.
//
#include <stdio.h>
void swap(int* a, int* b) {
@mrnonz
mrnonz / simpleLexer.flex
Created February 2, 2017 14:08
Use for Compiler #2
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E [Ee][+-]?{D}+
FS (f|F|l|L)
IS (u|U|l|L)*
%option noyywrap
%{
@mrnonz
mrnonz / simpleLexer.flex
Created February 2, 2017 14:08
Use for Compiler #2
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E [Ee][+-]?{D}+
FS (f|F|l|L)
IS (u|U|l|L)*
%option noyywrap
%{

Keybase proof

I hereby claim:

  • I am mrnonz on github.
  • I am mrnonz (https://keybase.io/mrnonz) on keybase.
  • I have a public key whose fingerprint is 70FB 5C74 AC56 37E0 6A36 62B3 61CC 5591 CF45 D6F9

To claim this, I am signing this object:

@mrnonz
mrnonz / docker-compose.yml
Created April 28, 2018 09:22 — forked from winggundamth/docker-compose.yml
Elasticsearch Cluster + Grafana Docker Compose File
version: '3'
services:
es1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
container_name: es1
environment:
cluster.name: "docker-cluster"
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
TAKE_FILE_OWNERSHIP: "true"
@mrnonz
mrnonz / pagespeed_optimize_images.sh
Last active August 2, 2018 05:23
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
find . -type f -name "*.png" -o -name "*.PNG" | xargs optipng -nb -nc
find . -type f -name "*.png" -o -name "*.PNG" | xargs advpng -z4
find . -type f -name "*.png" -o -name "*.PNG" | xargs pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow
find . -type f -name "*.jpg" -o -name "*.JPG" | xargs jpegoptim -f --strip-all
## Log to file
# find . -type f -iname "*.png" -print0 | xargs -I {} -0 optipng -o5 -quiet -keep -preserve -log optipng.log "{}"
@mrnonz
mrnonz / sysctl.conf
Last active August 3, 2018 09:42
Harden the networking layer
# IP Spoofing protection
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
# Ignore ICMP broadcast requests
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Disable source packet routing
net.ipv4.conf.all.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
@mrnonz
mrnonz / add-ngx-pagespeed.sh
Last active September 4, 2018 07:00
Script for download ngxpagespeed modules, please specific your version `nginx -v`
bash <(curl -f -L -sS -k https://ngxpagespeed.com/install) \
--nginx-version "{version}" \
--dynamic \
-a '--with-http_ssl_module
--with-http_realip_module
--with-http_dav_module
--with-http_gzip_static_module
--with-http_gunzip_module
@mrnonz
mrnonz / yuzo-related-post-hacked.md
Last active April 10, 2019 12:34
Zero Day Vulnerability Yuzo Related Post plugin. I try to find where injected code into my Database

SELECT * FROM wp_options WHERE option_value LIKE '%eval(String.fromCharCode%';

and I got these value.

@mrnonz
mrnonz / Gitlab-Runner-Startup-script.sh
Last active October 29, 2019 09:41
Startup script for VM to registration Gitlab Runner
sudo apt-get update
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
sudo chmod +x /usr/local/bin/gitlab-runner
curl -sSL https://get.docker.com/ | sh
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash