change to postgres user and open psql prompt
sudo -u postgres psql postgres
list databases
postgres=# \l
list roles
| FIX CACHE ISSUES ON ANDROID – REACT NATIVE BUILD | |
| cd android && cd app && rm -r build | |
| cd android && ./gradlew clean | |
| react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res | |
| cd android &&chmod +x gradlew |
| # Connect Multiple AWS Accounts | |
| aws configure --profile <your-profile-name> | |
| # Inline policy for aws-elasticbeanstalk-ec2-role | |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "Stmt1409855610000", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "autoscaling:DescribeAutoScalingGroups" |
change to postgres user and open psql prompt
sudo -u postgres psql postgres
list databases
postgres=# \l
list roles
| ### Virtualenv | |
| venv/ | |
| ### PyCharm | |
| .idea/ | |
| ### Python | |
| __pycache__/ | |
| *.py[cod] |
| # test .encode() and str() | |
| a_string = 'test éurope' | |
| print('a_string normal: ', a_string) | |
| a_string = 'test éurope' | |
| print('a_string utf-8 encoded: ', a_string.encode('utf-8')) # utf-8 is default so .encode() is same result | |
| print('a_string ascii encoded: ', a_string.encode('ascii', 'replace')) # with error, i.e. replace, ignore etc. | |
| print('a_string str: ', str(a_string)) | |
| company = 'éuropean company' | |
| pro_comp_name = 'a løng campaigné name' |
| # sometimes Ember builds break due to npm &/or bower cache, node changes etc. | |
| # running below usually fixing any cache issues | |
| rm -rf node_modules/ bower_components/ tmp/ dist/ | |
| npm cache clear | |
| bower cache clear | |
| npm install && bower install | |
| ember s |
| # create the cert key request | |
| openssl req -newkey rsa:2048 -nodes -keyout domain.com.key -out domain.com.csr | |
| # concat the bundle and certs | |
| cat domain_com.crt domain_com.ca-bundle > website-bundle.crt | |
| # SSL checker for after install | |
| https://www.sslshopper.com/ssl-checker.html |
| # view container instances | |
| docker container ls | |
| # activate instance, i.e. nginx, django etc. | |
| docker exec -i -t be821b60fa28 /bin/bash |
| # UPDATE AWS EC2 SECURITY GROUPS FIRST TO ALLOW MySQL CONNECTION VIA IP | |
| --- | |
| # Edit /etc/mysql/my.cnf, and change the binding address to 0.0.0.0 | |
| bind-address = 0.0.0.0 | |
| # then restart mysql server | |
| $ sudo /etc/init.d/mysql restart |