Skip to content

Instantly share code, notes, and snippets.

@russellhoff
russellhoff / fix-wordpress-permissions.sh
Created April 5, 2018 10:32 — 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
@russellhoff
russellhoff / AccountAuthenticator.java
Created March 22, 2018 15:48 — forked from burgalon/AccountAuthenticator.java
Implementing OAuth2 with AccountManager, Retrofit and Dagger
public class AccountAuthenticator extends AbstractAccountAuthenticator {
private final Context context;
@Inject @ClientId String clientId;
@Inject @ClientSecret String clientSecret;
@Inject ApiService apiService;
public AccountAuthenticator(Context context) {
super(context);
@russellhoff
russellhoff / wildfly-install.sh
Last active February 10, 2023 14:20 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 11.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 11.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@russellhoff
russellhoff / tomcat.service
Last active November 28, 2017 21:13 — forked from zengxs/tomcat.service
tomcat systemd service script
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/opt/apache-tomcat-8.5.23/bin/catalina.sh start
ExecStop=/opt/apache-tomcat-8.5.23/bin/catalina.sh stop
@russellhoff
russellhoff / database-backup.sh
Last active October 19, 2017 07:53 — forked from stevegrunwell/database-backup.sh
Dump each MySQL database and send its backup to Amazon S3. https://engineering.growella.com/automatic-database-backups-amazon-s3/
#!/bin/bash
#
# Backup local databases to Amazon S3.
#
# This script takes a single argument: an S3 bucket name with optional path.
#
# Usage:
# database-backup.sh backup.example.com
# database-backup.sh backup.example.com/some/path
#