Skip to content

Instantly share code, notes, and snippets.

unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@PragmaticEd
PragmaticEd / fix-wordpress-permissions.sh
Created January 16, 2019 10:11 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@PragmaticEd
PragmaticEd / add.sh
Created January 16, 2019 11:26
Add sFTP user, limit home, and disable ssh
#!/bin/sh
USER="example"
PASS="example"
USER_ROOT="/var/www/example.lv"
# fix "Authentication token manipulation error" error:
# https://www.codevoila.com/post/26/fix-authentication-token-manipulation-error-when-changing-user-password-in-ubuntu
sudo mount -rw -o remount /
@PragmaticEd
PragmaticEd / generate-ssh-key.sh
Created January 16, 2019 14:31 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa