Skip to content

Instantly share code, notes, and snippets.

dev tun1
proto udp
ifconfig 192.168.3.1 192.168.3.2
secret /etc/openvpn/static.key
keepalive 10 60
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<script language="C#" runat="server">
public bool ThumbnailCallback() {
return false;
}
@iley
iley / utilities.h
Created May 30, 2011 09:15
ios utilities
#import "Utilities.h"
NSString *filePath(NSString *file) {
return [[NSBundle mainBundle] pathForResource:[file stringByDeletingPathExtension] ofType:[file pathExtension]];
}
NSString* writablePath(NSString* file) {
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
@iley
iley / .screenrc
Created August 20, 2011 09:13
screen config
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
from threading import Thread
from time import sleep
def yoba_async_call(x, callback):
class YobaThread(Thread):
def run(self):
sleep(1)
callback(x * x)
YobaThread().start()
@iley
iley / tinyproxy.conf
Created October 1, 2011 12:41
tiny proxy config
User nobody
Group nogroup
Port 8888
Timeout 600
DefaultErrorFile "/usr/share/tinyproxy/default.html"
#StatFile "/usr/share/tinyproxy/stats.html"
Logfile "/var/log/tinyproxy/tinyproxy.log"
LogLevel Info
@iley
iley / build_intelib.pl
Created October 21, 2011 09:18
Script for building intelib debian package
#!/usr/bin/perl -wl
use strict;
my $version = (split / /, `cat Version`)[0];
my $arch = 'amd64';
my $control =
"Package: intelib\
Version: $version\
Architecture: $arch\
Maintainer: Ilya Strukov <iley\@iley.ru>\
@iley
iley / pre-receive
Created October 24, 2011 19:09
pre-receive hook to deny pushing big files
#!/usr/bin/perl -wl
use strict;
my $limit = 1024 * 1024;
my $hasBadFiles;
while (<>) {
chomp;
my ($old, $new, $ref) = split / /, $_;
@iley
iley / gist:1490213
Created December 17, 2011 13:30
Perl tips
Perlbrew — install multiple perl environments in $HOME
Bundle::Zoidberg — modular perl shell
Devel::REPL + Term::ReadLine::Perl + Term::ReadKey = handy REPL
Devel::Trace — print out each line before it is executed
use autodie
Module::UseFrom — use module from string
List::MoreUtils (List::AllUtils = List::Util + List::MoreUtils)
Params::Util - check parameter types properly (http://perladvent.org/2011/2011-12-23.html)
Try::Tiny — sugar for eval
#!/bin/bash
DEST=`pwd`
#enter here your referal link from Dropbox
REFLINK="http://db.tt/smqvfl6B"
download()
{
echo "Downloading Dropbox distributive..."
cd