Skip to content

Instantly share code, notes, and snippets.

@jacobian
jacobian / unicorn.php
Created October 8, 2009 15:10
This was written by Russell Beattie; I copied it here from a pastebin to give it a permanent home.
<?
/*
Simple preforking echo server in PHP.
Russell Beattie (russellbeattie.com)
PHP port of http://tomayko.com/writings/unicorn-is-unix
*/
/* Allow the script to hang around waiting for connections. */
set_time_limit(0);
# Newbie programmer
$input=<>;
sub factorial {
$s=1;
$r=1;
while ($s <= $input) {
$r *= $s;
$s++;
}
if($input == 0)
@htruong
htruong / WAN-UP
Created May 16, 2014 23:45
Tomato Adblock LITE script
PREFIX="/tmp/adblock/" ## adjust this!
mkdir $PREFIX
echo '
PIXEL_IP="0" ## 0: disable pixelserv
PIXEL_OPTS=""
BRIDGE="br0"
RAMLIST="1" ## 1: keep blocklist in RAM (e.g. for small JFFS)
CONF="/etc/dnsmasq.custom" ## dnsmasq custom config
SOURCES="$SOURCES http://winhelp2002.mvps.org/hosts.txt"
@ByScripts
ByScripts / userChrome.css
Last active May 26, 2016 20:50
Custom CSS for Firefox, to match Numix GTK theme.
/**
* Firefox custom CSS for Numix GTK Theme
* To use with Firefox Numix Theme : https://addons.mozilla.org/fr/firefox/addon/numix-gtk3theme/
* Better with Omnibar FIrefox Add-On : https://addons.mozilla.org/fr/firefox/addon/omnibar/
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Awesomebar improvements */
#urlbar {
$sarcoline: #fadfae;
$coquelicot: #ec4908;
$smaragdine: #009874;
$mikado: #ffc40c;
$glaucous: #6082b6;
$wenge: #645452;
$fulvous: #e48400;
$xanadu: #738678;
$falu: #801818;
$eburnean: #f5f0e6;
@defuse
defuse / lib_crypt.php
Created January 31, 2014 23:51
//// BAD CRYPTO CODE //// DO NOT USE THIS CODE ////
<?php
// [LIB - Crypt Functions]
// (c) 2005-2013 unix-world.org - all rights reserved
// code release 2013-05-30
//##################################################### PREVENT S EXECUTION
if(A_HEADER_EXEC_RUNTIME != 'NetVisionOpenSource') {
die('This PHP script: `'.htmlspecialchars(@basename(__FILE__)).'` cannot be executed directly !');
} //end if
//#####################################################
@defuse
defuse / backdoored.php
Created February 28, 2015 08:27
Backdoored Crypto Code
<?php
/*
* Backdooring the constant-time comparison algorithm.
* Taylor Hornby. Feburary 28, 2015.
*
* THIS CODE IS INTENTIONALLY BACKDOORED. DO NOT USE IT!
*/
/* ========================================================================= */
@pkra
pkra / phantomJS-PDF-mathjax.js
Created May 25, 2015 07:46
PhantomJS MathJax PDF example
// via https://github.com/mathjax/MathJax/issues/1029#issuecomment-72348069 and http://c.utz.cc/mathjax/render.js
var webpage = require('webpage');
var capture = function (page, pageUrl, callback) {
page.open(pageUrl, function (status) {
var interval, allDone;
if (status !== 'success') {
callback(new Error('Error rendering page'));
"""
Simple preforking echo server in Python.
Python port of http://tomayko.com/writings/unicorn-is-unix.
"""
import os
import sys
import socket
--- a/screenfetch-dev
+++ b/screenfetch-dev
@@ -827,6 +827,7 @@
tinycore|tinycore*linux) distro="TinyCore" ;;
cygwin) distro="Cygwin" ;;
haiku) distro="Haiku" ;;
+ umbrella*unix*|umbrella*corporation) distro="Umbrella Unix"; distro_more="Umbrella Unix 2.1.7" ;;
esac
verboseOut "Finding distro...found as '${distro} ${distro_release}'"
}