Skip to content

Instantly share code, notes, and snippets.

@slopjong
slopjong / gist:3093757
Created July 11, 2012 21:38 — forked from pioz/autoclick.c
Autoclick
// Written by Pioz.
// Compile with: gcc -o autoclick autoclick.c -lX11
#include <stdio.h>
#include <string.h>
#include <X11/Xlib.h>
// Simulate mouse click
void
click (Display *display, int button)
public function getServiceConfig()
{
return array(
'factories' => array(
'my-model' => function($sm) {
$model = new \My\Model($sm);
return $model;
}
)
);
<?php
function generateSecret()
{
$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), "+", ".");
$shuffle = str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
$param = '$' . implode( '$', array("2y", 10, $salt) );
$blowfish = crypt($shuffle, $param);
return true;
}
<?php
$paths = array(
"/new/space/afsdfadsfthe_space_name/status/json",
"/vagrant/public/space/afsdfadsfthe_space_name/index.php"
);
echo get_common_path($paths[0], $paths[1]);
// this is not yet

Postfix doesn't deliver to virtual mailbox

Note: myhost.myserver.com is a placeholder for the real domain used in the config file

Question 1:

transport_maps is missing, dumb question: should I add it? What does the file content exactly look like?

25/tcp filtered smtp
80/tcp open http
110/tcp open pop3
135/tcp filtered msrpc
139/tcp filtered netbios-ssn
143/tcp open imap
443/tcp open https
445/tcp filtered microsoft-ds
465/tcp filtered smtps
593/tcp filtered http-rpc-epmap
<?php
// with permutations of 'matrix' the encrypted text couldn't be decrypted
// there are more 6 char long names, see the following list:
// http://de.wikipedia.org/wiki/Matrix_%28Film%29#Synchronisation
// !! these are the German names !!
$initial_guess = "matrix";
function permutate($input) {
$guesses = array();
<?php
$zoom = 0;
$n = pow(2, $zoom);
$lon = 6.07057;
$lat = 49.61629;
$xtile = floor((($lon + 180) / 360) * pow(2, $zoom)) + 0.5;
$ytile = floor((1 - log(tan(deg2rad($lat)) + 1 / cos(deg2rad($lat))) / pi()) /2 * pow(2, $zoom)) + 0.5;
@slopjong
slopjong / svg2png.sh
Created June 1, 2014 12:39
Converts a single SVG or a set of SVGs to PNG
#!/bin/bash
function convert()
{
file="$1"
# remove the svg file extension and append .png
destination="${file%.svg}.png"
# -z is for launching inkscape without the gui