Note: replace {{server}} with your domain or ip
- Login as the ec2-user
ssh -i key.pem ec2-user@{{server}}
- Switch to administrator
sudo -i
| license: gpl-3.0 | |
| height: 600 | |
| border: no |
| <?php | |
| class ReconnectingPDO | |
| { | |
| protected $dsn, $username, $password, $pdo, $driver_options; | |
| public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
| { | |
| $this->dsn = $dsn; | |
| $this->username = $username; | |
| $this->password = $password; |
| <?php | |
| /** | |
| * Конвертер регулярного выражения | |
| * | |
| * @author Pakhtinov Dmitriy | |
| * @copyright 2012 Pakhtinov Dmitriy | |
| * @data 14.11.2012 | |
| */ | |
| class PCREConverter { |
| package main | |
| // sort a map's keys in descending order of its values. | |
| import "sort" | |
| type sortedMap struct { | |
| m map[string]int | |
| s []string | |
| } |
Note: replace {{server}} with your domain or ip
ssh -i key.pem ec2-user@{{server}}
sudo -i
| /* | |
| Heavily inspired by the PHP implementation made by Ahmad Amarullah (available at http://code.google.com/p/php-mail-domain-signer/), with the help of http://phpjs.org/. | |
| Setup: | |
| In dkim-raw-email.js, change the location of your private key and the associatedDomain accordingly to your needs. | |
| Example of use (using aws-lib, https://github.com/mirkok/aws-lib): |
| <?php | |
| function describe($testedClass, callable $tests) { | |
| print ("$testedClass" . PHP_EOL); | |
| $tests(); | |
| } | |
| function it($testName, callable $test) { | |
| print(" $test" . PHP_EOL); | |
| $test(); |
| #!/bin/bash | |
| # | |
| # Example of how to parse short/long options with 'getopt' | |
| # | |
| OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
| if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
| echo "$OPTS" |
| <?php | |
| function assoc_array_map($cb, $arr) { | |
| $new_array = array(); | |
| foreach ($arr as $key => $value) { | |
| array_push($new_array, $cb($key, $value)); | |
| } | |
| return $new_array; |
| ( function ( window, undefined ) { | |
| var Aloha = window.Aloha || ( window.Aloha = {} ); | |
| Aloha.settings = { | |
| logLevels: { 'error': true, 'warn': true, 'info': true, 'debug': false, 'deprecated': true }, | |
| errorhandling: false, | |
| ribbon: false, | |
| locale: 'en', | |
| floatingmenu: { | |
| width: 630, |