stateful firewall with inbound outbound traffic

Background I have worked as Devops for cloud migration in the recent 3 months without really writing much code. Even though being exposed to many AWS services like EMR/EC2/ASG(auto scaling group)/LC(launch config)/CF(cloud formation) etc.. with the need of setting up security groups(SG), i find myself still a bit confusing with inbound and outbound traffic rules….

My Postgresql snippets

Install psql To get the psql, I simply installed the postgresapp for OSX which bundles the psql . We can start the psql from its GUI, or added its bin to our PATH. The specific path is: /Applications/Postgres.app/Contents/Versions/latest/bin You can also get psql by installing postgresql one click installer. Connect to DB with psql psql -h DbUrl -p…

install ora2pg on mac osx

Recently we need to migrate our on prem oracle database into postgresql on aws RDS. Looks like ora2pg is a nice little tool to mitigate the problem though not perfect. I am running OS X 10.10.5 Yosemite. It already comes with perl v5.18.2 as well as cpan for installing packages. download/install Oracle client The official document…

Shebang/Hashbang #! in shell

In unix sh file, we usually see the first line start with #!. Like #!/bin/bash The shebang (#!) at the start means execute the script with what follows. In nodejs script, we usually see #!/bin/env node So this means the env command will try to find where the node has been installed from the $PATH, so…

csv file excel BOM for non-ascll characters

Sometimes you need to export a table to the Excel and other spreadsheets. CSV file saved in UTF-8 seems to be sufficiently universal format. But there is problem with non-ASCII characters in Excel. Excel default encoding depends on the system. The workaround is to put three magical bytes to the file beginning. They are called…