Grant remote access permission to MySQL server

Login to your mysql/mariadb console: sudo mysql -u <user> -p Run this command: GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘YoUrP45sw0rd!’ WITH GRANT OPTION; Don’t forget to flush the privileges FLUSH PRIVILEGES; If user still cannot see the tables, try to disconnect mysql and reconnect again.

Make paging output from your python script

pydoc is a python library to make your console output paginates for easier reading. to use it follow the simple example below: import pydoc text = “…paginate me…” pager = pydoc.ttypager(text) print pager you will see the output is gonna be truncated at the beginning when you start to see like when you open up … Read more

Deploy ec2 instance to VPC with terraform

provider “aws” { access_key = “” secret_key = “” region = “ap-southeast-1” } resource “aws_instance” “web-1” { vpc_security_group_ids = [“sg-xxxxxxxx”] subnet_id = “subnet-xxxxxxxx” ami = “ami-xxxxxxxx” availability_zone = “ap-southeast-1a” instance_type = “t2.micro” tags { Name = “test-terraform-1” } }

Build AMI with packer

$ packer build main.json $ vim ~/.aws/credentials [default] aws_access_key_id = aws_secret_access_key = Add the environment variables at the end of file ~/.bashrc $ vim ~/.bashrc export AWS_ACCESS_KEY_ID= export AWS_SECRET_ACCESS_KEY=

Docker command cheatsheet

docker build image $ sudo docker build -t image-name . docker to start a container from image $ sudo docker run -itd –name jenkins –publish 8080:8080 –publish 50000:50000 jenkins docker to get inside the container $ sudo docker exec -it jenkins bash docker stop container $ sudo docker stop image-id/name docker remove container $ sudo … Read more

WordPress still cannot Establishing a Database Connection – Error

Have you ever experiencing this problem like this? after your install wordpress, setup anything, webserver, database, everything is completed. Yet, wordpress still cannot establishing your database connection. Eventhough you’ve already make sure that your database is up and running (I’m using MySQL) and your port is already open, though. Trust me! I’ve done anything properly, … Read more