Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Rees-Carter valorin

View GitHub Profile
View setup.sh
#!/bin/bash -xe
if [[ $WSL_DISTRO_NAME = Ubuntu* ]]; then
sudo add-apt-repository ppa:ondrej/php -y
if [ $WSL_DISTRO_NAME == "Ubuntu-18.04" ]; then
sudo add-apt-repository ppa:certbot/certbot -y
fi
fi
@valorin
valorin / wordpress-setup-attack.sh
Created Aug 23, 2019
Proof of concept WordPress setup script attack - sets up a new WP installation and injects a simple shell into /wp-content/themes/twentynineteen/404.php and /wp-hello.php.
View wordpress-setup-attack.sh
#!/bin/bash
#
# WordPress Setup Attack Script
#
# Created by Stephen Rees-Carter (https://stephenreescarter.net/)
#
# This script injects a remote shell into a fresh copy of WordPress that hasn't been set up yet.
# Once the shells have been set up, it removes the config file with the custom database connection to reset the site back to a fresh install.
#
@valorin
valorin / simple logrotate
Created Jan 17, 2016
/etc/logrotate.d/vhost-my.app
View simple logrotate
/var/www/vhosts/my.app/storage/logs/*.log {
size 100M # Max log file size 100M
weekly # Rotate weekly, if not sooner
missingok # Ignore if missing file
rotate 12 # Keep 12 files
compress # Compress rotated files
notifempty # Ignore empty files
create 755 www-data www-data # Create new log file with perms and owner
}
View blockchain-id
Verifying that +valorin is my blockchain ID. https://onename.com/valorin
@valorin
valorin / mosh-allow-ufw.yml
Created Dec 6, 2014
Ansible tasks to configure Mosh and UFW to play nice
View mosh-allow-ufw.yml
---
- name: Install Mosh PPA
apt_repository: repo='ppa:keithw/mosh'
- name: Install Mosh
apt: >
state=latest
pkg=mosh
update_cache=yes
@valorin
valorin / mosh-allow-ufw.sh
Created Dec 6, 2014
Script to open and close Mosh ports in UFW
View mosh-allow-ufw.sh
#!/bin/bash
# Load active ports
PORTS=`lsof -i | grep mosh-serv | cut -f2 -d":"`
STATUS=`sudo ufw status`
# Add Rules for new ports
for PORT in $PORTS; do
echo $STATUS | grep "$PORT/udp" > /dev/null
View keybase.md

Keybase proof

I hereby claim:

  • I am valorin on github.
  • I am valorin (https://keybase.io/valorin) on keybase.
  • I have a public key whose fingerprint is 7C1C 5C4A 3017 C21F 9AE5 34DE C1C4 BEBF 0442 284B

To claim this, I am signing this object:

@valorin
valorin / gist:7261952
Last active Feb 9, 2016
Git prompt + Byobu
View gist:7261952
##############
# THIS WORKS #
##############
##
# Git prompt options
##
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
@valorin
valorin / application.config.php
Created Mar 31, 2013
Config and Module cache options found in ./config/application.config.php
View application.config.php
<?php
// Whether or not to enable a configuration cache.
// If enabled, the merged configuration will be cached and used in
// subsequent requests.
'config_cache_enabled' => $booleanValue,
// The key used to create the configuration cache file name.
'config_cache_key' => $stringKey,
// Whether or not to enable a module class map cache.