This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a group | |
| CREATE ROLE readonly; | |
| # Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readonly; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly; | |
| # Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo "Note: Make sure to login as root user" | |
| echo "Username ?" | |
| read username | |
| adduser $username | |
| #Sudo Permission | |
| sed "/#\ User\ privilege\ specification/a$username\ ALL=(ALL:ALL)\ NOPASSWD:ALL" /etc/sudoers --in-place | |
| cd /home/$username | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Note: Login as root user" | |
| echo "installing java" | |
| mkdir -p /usr/local/java | |
| cd /usr/local/java | |
| curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz' | |
| tar xvzf jdk-8u131-linux-x64.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT B.* FROM ( | |
| SELECT DISTINCT table_name FROM ( | |
| SELECT table_name,column_name,ordinal_position,data_type,column_type,COUNT(1) match_count | |
| FROM information_schema.columns WHERE table_schema IN ('db1','db2') | |
| GROUP BY table_name,column_name,ordinal_position,data_type,column_type | |
| HAVING COUNT(1) = 1 | |
| ) AA | |
| ) A INNER JOIN ( | |
| SELECT table_schema,table_name,column_name,ordinal_position,data_type,column_type | |
| FROM information_schema.columns WHERE table_schema IN ('db1','db2') |