Skip to content

Instantly share code, notes, and snippets.

View fordnox's full-sized avatar
🍕
Eating pizza

Andrius Putna fordnox

🍕
Eating pizza
View GitHub Profile
@fordnox
fordnox / 1fh.vcl
Last active August 29, 2015 13:59
Most simple varnish VCL /etc/varnish/1fh.vcl
backend default {
.host = "127.0.0.1"; # IP address of your backend (Apache, nginx, etc.)
.port = "8080"; # Port your backend is listening on
}
sub vcl_recv {
# Set the URI of your system directory
if (req.request == "POST" || req.http.X-Requested-With == "XMLHttpRequest")
{
@fordnox
fordnox / proxy.py
Created March 21, 2014 08:04
python proxy
#!/usr/bin/python
import json
from subprocess import Popen, PIPE
txt = raw_input();
cmd = txt.split()
o = None
e =None
try:
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
<?php
/**
* BoxBilling
*
* LICENSE
*
* This source file is subject to the license that is bundled
* with this package in the file LICENSE.txt
* It is also available through the world-wide-web at this URL:
* http://www.boxbilling.com/LICENSE.txt
@fordnox
fordnox / update.sh
Created April 22, 2013 16:57
sh script to update repository in current folder
#!/bin/sh
git reset --hard HEAD
git pull
git submodule update --init
@fordnox
fordnox / SLDs-array.php
Created April 10, 2013 07:21
Get array of all second-level-domains
<?php
$CsvString = file_get_contents('https://raw.github.com/gavingmiller/second-level-domains/master/SLDs.csv');
$Data = str_getcsv($CsvString, PHP_EOL);
foreach($Data as &$Row) {
list($tld, $stld) = str_getcsv($Row, ",");
$Row = $stld;
}
var_export($Data, true);
@fordnox
fordnox / gist:5284078
Created April 1, 2013 09:55
pear add-ons
#http://pear.phpunit.de/
sudo pear install phpunit/PHP_Invoker
sudo pear install phpunit/PHPUnit_Selenium
sudo pear install phpunit/PHPUnit_Story
@fordnox
fordnox / WebHook.php
Created December 3, 2012 13:07
WebHook notifier class
<?php
class WebHookEvent
{
private $name = null;
private $params = array();
public function setName($event)
{
$this->name = $event;
@fordnox
fordnox / svmserver.sh
Created July 27, 2012 12:31
Restart svn server deamon
#!/bin/sh
killall -9 svnserve
svnserve -d -r /var/repositories/
@fordnox
fordnox / Uploader.php
Created April 14, 2012 14:19
Uploader message executor file
<?php
/*
* This file is part of Queue Manager.
*
* (c) 2011 SparkleBit <info@sparklebit.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@fordnox
fordnox / build.xml
Created September 29, 2011 15:02
Ant target to push source to staging server
<target name="stage" depends="build-source">
<property name="remote.user" value="username" />
<property name="remote.address" value="hostname" />
<property name="remote.path" value="~/v_${version}" />
<property name="remote.shared_path" value="~/v_shared" />
<echo message="Deploying project ${ant.project.name} source ${source} to server ${remote.address} ${remote.path}" />
<exec dir="." executable="rsync" failonerror="true">
<arg line="-avPe ssh ${source}/ ${remote.user}@${remote.address}:${remote.path}" />