Skip to content

Instantly share code, notes, and snippets.

View xemoe's full-sized avatar
🏠
Working from home

Teerapong Ladlee xemoe

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
@xemoe
xemoe / ubuntu_2004_awus036ach.md
Created December 11, 2020 07:09
Ubuntu 20.04 setup wireless usb alfa awus036ach
@xemoe
xemoe / checklist.md
Created November 22, 2020 18:22
My Dream Job Checklist

My Dream Job Checklist

คะแนนเต็ม 100 คะแนน


วัฒนธรรมองค์กร (สูงสุด 39 คะแนน)

  • บริษัท/หัวหน้างาน ไม่ควรลงมากำหนดเกี่ยวกับวิธีการทำงาน เมื่อมีการคุยและตกลงวิธีการทำงานไปแล้ว (No micromanagement). (9 คะแนน)
  • ไม่มีกฏที่เข้มงวด เช่นการต้องอธิบายเหตุผลเมื่อลุกออกจากโต๊ะทำงาน หรือมาสายในบางครั้ง หรือทำไมต้องดู Youtube. ตราบใดที่ยังสามารถส่งงานได้ตรงตามเวลาและไม่มีใครเกิดปัญหาติดขัดจากงานที่ทำ. (8 คะแนน)
  • ความสมดุลของเวลาในการทำงาน
    • 7 คะแนน for 40 hour weeks.
    • 3 คะแนน for 40 hour weeks with overtime (ในบางครั้ง) to up-to 60 hours.
@xemoe
xemoe / fail2ban.md
Created April 5, 2020 12:55 — forked from joecampo/fail2ban.md
fail2ban – stop HTTP(S) route abuse/brute forcing

If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.

Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,

package main
import (
"fmt"
"os"
"path/filepath"
"github.com/go-fsnotify/fsnotify"
)
@xemoe
xemoe / prob.js
Last active August 29, 2019 21:40
Learning Bayes
var sum = function(members) {
var sumvalue = 0;
for(var key in members) {
if (members.hasOwnProperty(key)) {
sumvalue += members[key]
}
}
return sumvalue
}
@xemoe
xemoe / Makefile
Created April 15, 2019 17:06 — forked from DerekV/Makefile
example Makefile to install required software
#gnu makefile
REQUIRED-SOFTWARE=emacs git sudo
EMACS-INIT-FILE?=~/.emacs
EMACS-LISP-BASE?=~/.emacs.d/lisp
DOTFILES-DIR?=~/dotfiles
## DOTFILES-REPO?= YOUR DOTFILES REPO HERE
@xemoe
xemoe / sum.go
Last active January 12, 2019 02:05
golang concurrent sum
package main
import (
"fmt"
"sync"
)
func main() {
process()
}
@xemoe
xemoe / example.md
Created November 13, 2018 12:14
Laravel validate with combination fields
//
// Laravel validate with combination fields
//
// Use
//

return function($attributes) {
 return [
@xemoe
xemoe / install.sh
Created October 8, 2018 08:09 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@xemoe
xemoe / phantomjs_facebook.js
Created May 28, 2018 08:32 — forked from ecin/phantomjs_facebook.js
Log into Facebook with phantomJS
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {