Skip to content

Instantly share code, notes, and snippets.

View BenSlabbert's full-sized avatar
🎯
Focusing

Ben BenSlabbert

🎯
Focusing
  • München, Germany
View GitHub Profile
@BenSlabbert
BenSlabbert / port-forward.sh
Created January 3, 2019 12:43
Bash command to port forward RDS instances
ssh -i ${key.pem} -L ${port.on.my.machine}:${rds.instance}:3306 ec2-user@${ec2.ip.address}
@BenSlabbert
BenSlabbert / ec2-ssh.sh
Created January 3, 2019 12:44
SSH to EC2
ssh -i ${instance.key} ec2-user@${ec2.ip}
@BenSlabbert
BenSlabbert / disable-chrome-web-security.sh
Created January 3, 2019 12:45
Disable Chrome Web Security
chromium-browser --disable-web-security --user-data-dir
@BenSlabbert
BenSlabbert / flush-hists
Created January 3, 2019 12:46
Flush Hosts (RDS)
Flush Hosts on RDS instances when you cannot directly connect.
Reset the master password on the instance
SSH into an EC2 instance which can connect to the instance
install the mysql client (Amazon AMIs) sudo yum install mysql
connect to the db as roort:
mysql -h <<RDS HOST>> -u root -p
git tag -a v${version} -m "${message}"
git push origin --tags
@BenSlabbert
BenSlabbert / update-many
Created January 3, 2019 12:48
update many mongo set multi: true to update many records matching the selector
db.vehicles.update({}, {$set: {dateCreated: Date.now()}}, {multi:true})
@BenSlabbert
BenSlabbert / code-example-sites
Created January 3, 2019 12:48
helpful code example websites
https://findusages.com/
https://www.programcreek.com/simple-java/
https://www.programcreek.com/java-api-examples/index.php?action=search
@BenSlabbert
BenSlabbert / dump-from-rds
Created January 3, 2019 12:50
RDS Dump Download
Dumping from RDS:
Below the command to get the dump from the RDS instance to EC2
mysqldump -C -K -h {{rds instance}} -P {{rds port}} -u {{user}} -p {{schema}} | zip > dump.zip
SFTP this zip archive to my local machine (I used FileZilla)
Then push this dump to local:
@BenSlabbert
BenSlabbert / mysql-dump-ignore.sh
Created January 3, 2019 12:51
MySQL dump and ignore tables
mysqldump -C -K -h {{rds_url}} -P {{rds_port}} -u {{user_name}} -p {{schema}} --ignore-table={{schema.table_name}} | zip > dump.zip
@BenSlabbert
BenSlabbert / openssl-create-key-pair.sh
Created January 3, 2019 12:53
openssl create public and pricate keys
openssl req -x509 -newkey rsa:2048 -keyout private.pem -out cert.pem -days 365 -nodes
openssl rsa -in private.pem -out public.pem -outform PEM -pubout