Skip to content

Instantly share code, notes, and snippets.

View kristijandraca's full-sized avatar

Kristijan Draca kristijandraca

View GitHub Profile
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# 1- Add this file in public_html
# 2- give execute permissions by: chmod +x fix-wordpress-permissions.sh
# 3- use this command to execute
# sudo sh ./fix_wordpress_file_permissions.sh /home/yourwebsite-goes-here/public_html
#
@kristijandraca
kristijandraca / init_wp.sh
Created September 27, 2021 09:19
Download and extract latest wordpress
#!/bin/bash
if [ $# -eq 0 ]
then
echo 'Provide folder name as first parameter'
exit 1
fi
if [ -d $1 ]; then
echo 'Folder alrady exists!'
@kristijandraca
kristijandraca / server_cheat_sheet.txt
Last active February 28, 2022 09:25
server commands cheat sheet
# Enable site config
a2ensite config_name.conf
# Disable site config
a2dissite config_name.conf
# Reload Apache2 config
systemctl reload apache2
# List all files and folders with permissions