Get current public IP address from command line linux

These command lines show you how to get your current public IP address just from terminal, just follow one of these way to get yours: $ curl -s checkip.dyndns.org | sed -e ‘s/.*Current IP Address: //’ -e ‘s/<.*$//’ Or, the shorter one: $ curl ipinfo.io/ip

Create watermark and resize images with Python

After holiday, I have many pictures that needs to be uploaded and all of them should have watermark. Watermark in image is one thing that I could’ve done it with photoshop when I was in school. But I’m not gonna waste my time to do that one by one instead I’m doing with this simple … Read more

Increase sound level in Ubuntu with command line

Sometimes when you listen to music on youtube with very limited sound level after your volume level has reached maximum and you’re using piece of shit earphone. Just go with this command to extend the limitation sound level, it works on ubuntu 14.04: $ pactl — set-sink-volume 0 150% be careful with maximum sounds, can … Read more

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” } }