Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Smith chemicaloliver

View GitHub Profile
@chemicaloliver
chemicaloliver / gist:3852239
Created Oct 8, 2012
Access windows XP network folder save passwords
View gist:3852239
start-->run--> rundll32.exe keymgr.dll, KRShowKeyMgr
@chemicaloliver
chemicaloliver / gist:3414151
Created Aug 21, 2012
PHP JPEG Resampler Class
View gist:3414151
<?php
/**
* Class used for resampling images
*
*/
namespace Lib\Image;
class Resampler
{
@chemicaloliver
chemicaloliver / gist:3164297
Created Jul 23, 2012
Resampling a JPEG image in PHP using GD (not imagemagick)
View gist:3164297
<?php
/**
* Class used for resampling images
*/
class Resampler
{
/**
* Resample an image
*
@chemicaloliver
chemicaloliver / gist:3056470
Created Jul 5, 2012
A mongodb atomic counter
View gist:3056470
doc = { name : "order_no", value : 1}
db.Counters.save(doc)
db.Counters.findAndModify({query : { name : "order_no"}, update : { $inc : {value : 1}}})
@chemicaloliver
chemicaloliver / create.sh
Created May 22, 2012
Batch create thumbnail images
View create.sh
mogrify -format jpg -path thumb -thumbnail 400x200\> *.png
@chemicaloliver
chemicaloliver / create.sh
Created May 20, 2012
Creating Mysql SSL Certificates
View create.sh
openssl req -newkey rsa:2048 -days 1000 -nodes -keyout client-key.pem -out client-req.pem
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 1000 -key ca-key.pem -out ca-cert.pem
openssl req -newkey rsa:2048 -days 1000 -nodes -keyout server-key.pem -out server-req.pem
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 1000 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
@chemicaloliver
chemicaloliver / circle.svg
Created May 19, 2012
Styling the HTML5 Meter Tag Using the Shadow DOM
View circle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View .htaccess
Options -MultiViews
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
@chemicaloliver
chemicaloliver / MY_Exceptions.php
Created Apr 9, 2012
JSON error messages for CI 2.0+
View MY_Exceptions.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
* Extending the default errors to always give JSON errors
*
* @author Oliver Smith
*
@chemicaloliver
chemicaloliver / ssh.sh
Created Jan 13, 2012
ssh tunnel for windows remote desktop
View ssh.sh
ssh -L 13389:<remote desktop server ip>:3389 <remote ssh server>