Skip to content

Instantly share code, notes, and snippets.

View paramah's full-sized avatar
🐍
klaatu barada nikto

Aleksander Cynarski paramah

🐍
klaatu barada nikto
View GitHub Profile
#!/usr/bin/python
# SAS by Aleksander Cynarski [a.cynarski@pretasoft.pl]
import os, sys, getopt, socket
from pwd import getpwnam
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:u:t:s:", ["help", "domain=","username=","type=","ssl"])
#!/usr/bin/ruby -rubygems
#
# dev tools by Aleksander Cynarski <alek@click5.pl>
#
requests = {
'lista/dodaj' => {'standID' => '2', 'pageID' => '1', 'articleID' => '1'},
'lista/skasuj' => {'standID' => '2', 'pageID' => '1', 'articleID' => '1'},
Index: sapi/cli/config.w32
===================================================================
--- sapi/cli/config.w32 (revision 308839)
+++ sapi/cli/config.w32 (working copy)
@@ -6,7 +6,8 @@
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
@paramah
paramah / gist:1055938
Last active September 26, 2015 06:38
simple DB in PHP
<?php
/** \brief DbAdapter - adapter bazy danych
Klasa wykonująca proste zapytania SQL
\author Aleksander Cynarski (cynarski.pl)
\author $LastChangedBy$
\date 2008-05-24
\date $LastChangedDate$
\version $Rev$
@paramah
paramah / gist:1136718
Created August 10, 2011 12:47
node.js hello-world
var express = require('express');
var app = express.createServer();
app.get('/', function(req, res) {
res.write("Hello World ;]");
res.end();
});
app.listen(8080, function() {
var addr = app.address();
@paramah
paramah / gist:1151334
Created August 17, 2011 11:07
Chrome console CSS
/**********************************************/
/*
/* InTheDark Skin by Aleksander Cynarski
/*
/* Based on Darker Skin by Darcy Clarke - 2011
/* Based on Joe Bergantine's Specials Board:
/* http://joebergantine.com/werkstatt/seestyle
/*
/**********************************************/
@paramah
paramah / gist:1300786
Created October 20, 2011 09:51
brokenUTF
function brokenUTF($tbl, $id) {
header('Content-Type: text/html; charset=utf-8');
echo "<pre>";
echo "Konwersja: ".$tbl."</br/>";
$sql = new MySQLi("HOST", "USER", "HASLO", "BAZA");
$cnt = $sql->query('SELECT COUNT(' . $id . ') AS count FROM ' . $tbl);
$cnt = $cnt->fetch_assoc();
$cnt = $cnt['count'];
@paramah
paramah / gist:1554697
Created January 3, 2012 12:09
Clear DEFINER in MySQL Dumpfile
#!/usr/bin/perl
use strict;
use warnings;
while (my $line = <STDIN>) {
if($line =~ /^(\S+)\s*DEFINER\s{0,1}=\s{0,1}(\S+)(.*)/){
print $1." ".$3."\n";
}else{
print $line;
}
@paramah
paramah / create-vhost.py
Created May 14, 2012 10:03
nginx configuration vhost automat
#!/usr/bin/python
import os, sys, getopt, socket
from pwd import getpwnam
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:u:t:s:", ["help", "domain="])
except getopt.GetoptError, err:
print str(err)
usage()
@paramah
paramah / gist:3976527
Created October 29, 2012 21:03
Automacik - surowy ;-)
#!/usr/bin/python
import os, sys, getopt, socket
from pwd import getpwnam
WORKDIR = "/Users/paramah/internals/configuration/"
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hd:u:t:s:", ["help", "domain="])