Skip to content

Instantly share code, notes, and snippets.

View rajat3204's full-sized avatar
🎯
Focusing

Rajat Kumar rajat3204

🎯
Focusing
View GitHub Profile
@rajat3204
rajat3204 / mysql-docker.sh
Created June 22, 2024 10:51 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
1.Use to take dump of rds mysql
mysqldump -h connection-string -u admin -p5gsid db-name > backup.sql
2.Use to restore the db using dump file IN RDS MYSQL
mysql -h connection-string -u admin -pxNfWQ db-name < backup.sql
@rajat3204
rajat3204 / security.conf
Created July 26, 2024 05:15 — forked from ambroisemaupate/security.conf
Nginx CSP example
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
# https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options
add_header X-Frame-Options SAMEORIGIN;
# when serving user-supplied content, include a X-Content-Type-Options: nosniff header along with the Content-Type: header,
# to disable content-type sniffing on some browsers.
# https://www.owasp.org/index.php/List_of_useful_HTTP_headers
# currently suppoorted in IE > 8 http://blogs.msdn.com/b/ie/archive/2008/09/02/ie8-security-part-vi-beta-2-update.aspx