Skip to content

Instantly share code, notes, and snippets.

@slivero
slivero / gist:3852239
Created October 8, 2012 12:21
Access windows XP network folder save passwords
start-->run--> rundll32.exe keymgr.dll, KRShowKeyMgr
@slivero
slivero / gist:3414151
Created August 21, 2012 10:08
PHP JPEG Resampler Class
<?php
/**
* Class used for resampling images
*
*/
namespace Lib\Image;
class Resampler
{
@slivero
slivero / gist:3164297
Created July 23, 2012 15:41
Resampling a JPEG image in PHP using GD (not imagemagick)
<?php
/**
* Class used for resampling images
*/
class Resampler
{
/**
* Resample an image
*
@slivero
slivero / gist:3056470
Created July 5, 2012 21:14
A mongodb atomic counter
doc = { name : "order_no", value : 1}
db.Counters.save(doc)
db.Counters.findAndModify({query : { name : "order_no"}, update : { $inc : {value : 1}}})
@slivero
slivero / create.sh
Created May 22, 2012 11:40
Batch create thumbnail images
mogrify -format jpg -path thumb -thumbnail 400x200\> *.png
@slivero
slivero / create.sh
Created May 20, 2012 12:22
Creating Mysql SSL Certificates
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
@slivero
slivero / circle.svg
Created May 19, 2012 21:24
Styling the HTML5 Meter Tag Using the Shadow DOM
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slivero
slivero / .htaccess
Created May 3, 2012 06:44
Silex .htaccess
Options -MultiViews
RewriteEngine On
#RewriteBase /path/to/app
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
@slivero
slivero / MY_Exceptions.php
Created April 9, 2012 18:26
JSON error messages for CI 2.0+
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
/**
* Extending the default errors to always give JSON errors
*
* @author Oliver Smith
*
@slivero
slivero / ssh.sh
Created January 13, 2012 11:40
ssh tunnel for windows remote desktop
ssh -L 13389:<remote desktop server ip>:3389 <remote ssh server>