Skip to content

Instantly share code, notes, and snippets.

View roylee0704's full-sized avatar
🧘‍♂️

roylee0704

🧘‍♂️
  • Bangkok, Thailand
View GitHub Profile
@roylee0704
roylee0704 / iprange.js
Last active January 4, 2017 01:31
inject ips to LinePay (via google-debug-console)
// https://ip-ranges.amazonaws.com/ip-ranges.json
var k = {
"syncToken": "1482877149",
"createDate": "2016-12-27-22-19-09",
"prefixes": [
{
"ip_prefix": "13.32.0.0/15",
"region": "GLOBAL",
"service": "AMAZON"
},
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@roylee0704
roylee0704 / eb-pull-latest-code-base.sh
Created November 3, 2016 11:11
use it when github webhook is not working.
eb ssh <eb environment name>
sudo docker ps
sudo docker exec -it <id of GitHub web hook container> sh
cd app && git pull
@roylee0704
roylee0704 / vs.js
Created September 28, 2016 06:57
vs code nodejs
http://stackoverflow.com/questions/36327096/vscode-linter-es6-es7-babel-linter/36327097#36327097
@roylee0704
roylee0704 / eb.sh
Created September 27, 2016 09:12
ssh to docker instance at eb
# list running instances.
sudo docker ps
# show logs of a particular instance: 5b51cb779326
sudo docker logs 5b51cb779326
@roylee0704
roylee0704 / ssh.sh
Last active September 27, 2016 08:47
add ssh credentials
# most restrictive for pem file.
chmod 400 path/to/your/.pem
# to add your .pem file to ~/.ssh/
ssh-add path/to/your/.pem
# e.g: login to gobike-api-dev environment, it reads from your /.ssh dir
eb ssh gobike-api-dev
@roylee0704
roylee0704 / lavarel.sh
Last active September 18, 2016 12:16
Lavarel commands - under your project dir.
# to start laravel webserver.
artisan serve
# to start laravel schedulling.
artisan schedule:run
@roylee0704
roylee0704 / vagrant.sh
Last active June 23, 2019 10:09
vagrant commands (on homestead)
#INTRODUCTION
# Vagrant is a virtual machine manager, it allows you to script the virtual machine configuration as well as the provisioning.
# add 'laravel/homestead' to vm/virtual-box via vagrant, ref: https://laravel.com/docs/5.3/homestead#first-steps
vagrant box add laravel/homestead -c
# up and running, do it in ~/.homestead
vagrant init hashicorp/precise64
vagrant up
@roylee0704
roylee0704 / mysql.sh
Last active September 9, 2016 09:42
mysql (local-machine)
# start mysql instance
mysql.server start
# performance_schema'.'session_variables' has the wrong structure
mysql_upgrade -u root -p --force
mysql.server restart #restart after this.
@roylee0704
roylee0704 / Dockerrun.aws.json
Created September 2, 2016 11:37
Dockerrun.aws.json Syntax
{
"containerDefinitions": [
{
"command": [ "string" ],
"cpu": number,
"disableNetworking": boolean,
"dnsSearchDomains": [ "string" ],
"dnsServers": [ "string" ],
"dockerLabels": {
"string" : "string"