Install Package Control for easy package management.
- Open the console with
Ctrl+`
- Paste in the following:
<?php | |
$password = "myPassword_!"; | |
$messageClear = "Secret message"; | |
// 32 byte binary blob | |
$aes256Key = hash("SHA256", $password, true); | |
// for good entropy (for MCRYPT_RAND) | |
srand((double) microtime() * 1000000); | |
// generate random iv |
<?php | |
class Crypto { | |
/** | |
* Encrypt using 3DES | |
* | |
* @param string $clear clear text input | |
* @param string $key encryption key to retrieve from the configuration, defaults to 'des_key' | |
* @param boolean $base64 whether or not to base64_encode() the result before returning | |
* | |
* @return string encrypted text |
#!/bin/sh | |
# cloudflareddns.sh - dynamic dns updater module for Synology | |
# | |
# Author: | |
# Michael Wildman (http://mwild.me) | |
# | |
# Version: | |
# 0.2 | |
# |
#!/bin/bash | |
# | |
# Watches the folder or files passed as arguments to the script and when it | |
# detects a change it automatically refreshes the current selected Chrome tab or | |
# window. | |
# | |
# http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/ | |
# | |
# Usage: | |
# ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html |
Install Package Control for easy package management.
Ctrl+`
<?php | |
// This PHP code snippet provides a basic understanding of | |
// PHP's AES encryption. Mirrored from here: http://www.chilkatsoft.com/p/php_aes.asp | |
// The first thing to understand is the meaning of these constants: | |
// MCRYPT_RIJNDAEL_128 | |
// MCRYPT_RIJNDAEL_192 | |
// MCRYPT_RIJNDAEL_256 | |
// You would think that MCRYPT_RIJNDAEL_256 specifies 256-bit encryption, |
<?php | |
/** | |
* Plugin Name: Add Blog and User ID on Network | |
* Plugin URI: http://wpengineer.com/2188/view-blog-id-in-wordpress-multisite/ | |
* Description: View Blog and User ID in WordPress Multisite | |
* Version: 1.0.0 | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de | |
* License: GPLv3 | |
*/ |
#!/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 |
<?php | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |
Fabric is a deployment management framework written in Python which makes remotely managing multiple servers incredibly easy. If you've ever had to issue a change to a group servers, this should look pretty familiar:
for s in $(cat servers.txt); do ssh $s service httpd graceful; done
Fabric improves on this process by providing a suite of functions to run commands on the servers, as well as a number of other features which just aren't possible in a simple for loop. While a working knowledge of Python is helpful when using Fabric, it certainly isn't necessary. This tutorial will cover the steps necessary to get started with the framework and introduce how it can be used to improve on administering groups of servers.