Skip to content

Instantly share code, notes, and snippets.

@synchrone
synchrone / .duplicity-config
Last active August 29, 2015 13:57
duplicity to s3
#!/bin/bash
#######
# Keep in mind that Ubuntu 14.04 has a little broken python-boto. I found that installing https://launchpad.net/~chris-lea/+archive/ubuntu/python-boto does help
######
declare -x S3_USE_SIGV4=True #required for eu-central-1
declare -x AWS_ACCESS_KEY_ID=
@synchrone
synchrone / i.conf
Last active January 2, 2016 17:59
Gyazo hosting
server { #generic php-fpm setup, really
server_name i;
root /var/www/i/www;
client_max_body_size 20m;
index index.php index.htm index.html;
location ~ ^.+\.php$ {
if ( -f $document_root/../maintenance) {
return 503;
}
@synchrone
synchrone / itn.php
Created September 18, 2012 12:45
Генератор ИНН
<?php
function random_number($length=1){
$number = array();
for($i=0; $i < $length; $i++){
$number[] = mt_rand(0,9);
}
return $number;
}
function company_itn(){