Skip to content

Instantly share code, notes, and snippets.

View nagiyevelchin's full-sized avatar
🌴
On vacation

Elchin Nagiyev nagiyevelchin

🌴
On vacation
View GitHub Profile
# Header set X-Robots-Tag "noindex, nofollow"
Header set X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Security-Policy "allow 'self';"
Header set X-WebKit-CSP "allow 'self';"
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "GET, POST"
@nagiyevelchin
nagiyevelchin / mysql_backup.sh
Last active October 7, 2023 11:04
This script is a combination of tasks, including cleaning up old log and backup files, performing a MySQL database dump, compressing the dump, and uploading files to an SFTP server. Make sure to replace MYSQL_USER=mysql MYSQL_PASSWORD=mysql SFTP_USER=user SFTP_PASSWORD=******** with your actual user names and passwords for security.
#!/bin/bash
# ----------------------------------------------------------------------- #
# Automate MySQL Database Backups to Secure SFTP Server. #
# ----------------------------------------------------------------------- #
# This Bash script simplifies the process of backing up #
# your MySQL database by automating the entire workflow. #
# It cleans up old log and backup files, performs a secure database dump, #
# compresses the backup, and uploads it to a remote SFTP server. #
# Ensure data integrity and easy retrieval with this efficient script. #
@nagiyevelchin
nagiyevelchin / postgresql_backup.sh
Last active October 7, 2023 08:43
This script is a combination of tasks, including cleaning up old log and backup files, performing a PostgreSQL database dump, compressing the dump, and uploading files to an SFTP server. Make sure to replace SFTP_USER=user SFTP_PASSWORD=******** with your actual SFTP user name and password for security.
#!/bin/bash
# ----------------------------------------------------------------------- #
# Automate PostgreSQL Database Backups to Secure SFTP Server. #
# ----------------------------------------------------------------------- #
# This Bash script simplifies the process of backing up #
# your PostgreSQL database by automating the entire workflow. #
# It cleans up old log and backup files, performs a secure database dump, #
# compresses the backup, and uploads it to a remote SFTP server. #
# Ensure data integrity and easy retrieval with this efficient script. #
@nagiyevelchin
nagiyevelchin / Removing LibreOffice and Installing It with a PPA on Ubuntu.sh
Created October 25, 2023 12:22
Learn how to uninstall LibreOffice, remove residual files, add a PPA for LibreOffice, update your package list, and install LibreOffice on your Ubuntu system using these Bash commands.
# Remove LibreOffice and its components
sudo apt remove --purge libreoffice* -y
# Perform an autoremove to clean up unnecessary packages
sudo apt autoremove -y
# Run autoclean to remove old package files
sudo apt autoclean -y
# Add the LibreOffice PPA to get the latest version
@nagiyevelchin
nagiyevelchin / glog-pod-install-problem.md
Last active November 9, 2023 11:27
Troubleshooting glog Installation Failure in React Native on macOS

When attempting to set up a new React Native project using npx react-native init projectName or executing pod install within the iOS folder, you may encounter a frustrating roadblock during the pod install phase, specifically with glog on macOS. The error typically looks like this:

-> Installing glog (0.3.5)
...
...
patching file config.sub
Hunk #1 FAILED at 1096.
1 out of 1 hunk FAILED -- saving rejects to file config.sub.rej