Skip to content

Instantly share code, notes, and snippets.

View magnetikonline's full-sized avatar
💡
I have an idea!

Peter Mescalchin magnetikonline

💡
I have an idea!
View GitHub Profile
@magnetikonline
magnetikonline / README.md
Created May 26, 2014 04:56
AWS RDS MySQL parameter group tweaks.

AWS RDS MySQL parameter group tweaks

Parameter Value AWS default
character_set_server utf8
collation_server utf8_general_ci
default_storage_engine InnoDB InnoDB
innodb_buffer_pool_size {DBInstanceClassMemory*7/10} {DBInstanceClassMemory*3/4}
innodb_log_file_size 134217728 134217728
max_allowed_packet 4194304
@magnetikonline
magnetikonline / README.md
Created May 16, 2014 07:23
Create id_rsa public/private keys from supplied PPK formatted key file.

Create id_rsa public/private keys from supplied PPK formatted key file

Instructions for Ubuntu 14.04LTS (and more than likely others). Where keyfile.ppk is the PPK file you have in hand.

$ sudo apt-get install putty-tools
# create public key as [id_rsa.pub]
$ puttygen keyfile.ppk -o id_rsa.pub -O public-openssh
# create private key as [id_rsa]
$ puttygen keyfile.ppk -o id_rsa -O private-openssh
@magnetikonline
magnetikonline / README.md
Last active August 25, 2016 05:42
Gnome 3.10 desktop setup notes - Ubuntu 14.04.1 LTS.

GNOME 3.10 desktop setup notes - Ubuntu 14.04.1 LTS

My current sane desktop settings/setup for GNOME 3 shell. Ubuntu GNOME 14.04.1 LTS desktop as a base, which makes this easy - no need for PPA installs of GNOME desktop itself.

GNOME 3 extensions

@magnetikonline
magnetikonline / nginx.conf
Last active August 29, 2015 14:00
SilverStripe improved Nginx configuration built upon http://doc.silverstripe.org/framework/en/installation/nginx.
location / {
try_files $uri /framework/main.php?url=$uri&$query_string;
}
error_page 404 /assets/error-404.html;
error_page 500 /assets/error-500.html;
location ^~ /assets/ {
sendfile on;
try_files $uri =404;
@magnetikonline
magnetikonline / README.md
Last active August 27, 2025 06:08
Setting Nginx FastCGI response buffer sizes.
@magnetikonline
magnetikonline / README.md
Last active July 28, 2023 06:01
Essential Sublime Text 3 packages.
@magnetikonline
magnetikonline / nginx-reloadconf.sh
Last active November 10, 2016 23:25
Nginx test/reload config bash scripts.
#!/bin/bash -e
PID="/run/nginx.pid"
if [[ ! -f $PID ]]; then
echo "Error: Nginx not currently running" >&2
exit 1
fi
@magnetikonline
magnetikonline / emailcheck.php
Last active August 29, 2015 13:59
Very liberal PHP is valid email check.
<?php
function isValidEmailAddress($email) {
return (
(preg_match('/^[^\r\n\t]+@[^\r\n\t ]+\.(?i)[a-z]{2,10}$/',$email)) &&
(count($partList = explode('@',$email)) == 2) &&
(!preg_match('/\.{2}/',$partList[1]))
);
}
@magnetikonline
magnetikonline / generate.php
Last active August 29, 2015 13:59
PHP generate random string with characters [0-9a-f].
<?php
function generateRandString() {
$randString = '';
while (strlen($randString) < 32) {
// generate a character between 0-9 a-f
$character = mt_rand(0,15);
if ($character > 9) $character += 39;
$randString .= chr($character + 48);
}
@magnetikonline
magnetikonline / README.md
Last active July 27, 2025 09:11
Nginx embedded variables.