Skip to content

Instantly share code, notes, and snippets.

@z2z
z2z / test.php
Created April 27, 2011 13:45
test
<?php
echo 'test';
<?php
header("Cache-Control: no-cache");
?>
<form name="input" action="" method="get">
AES ENC: <input type="text" name="enc" />
<input type="submit" value="Submit" />
</form>
<?php
$message = urldecode(utf8_encode($_GET['enc']));
$pwd = 'aaafffaa12345678';
@z2z
z2z / xml_to_object.php
Created March 28, 2012 06:51
php xml to object
<?php
//XML to object
// http://cambiatablog.wordpress.com/2009/08/24/php-serializing-xml-to-object/
Class XmlUtils {
public static function xmlToObject($xml, $obj = null) {
if (!$obj) $obj = new StdClass();
@z2z
z2z / gist:2224378
Created March 28, 2012 06:55 — forked from mattattui/gist:879259
Example PHP cURL function
<?php
// See http://inanimatt.com/php-curl.php for license & known issues
function httpGet($url, $ttl = 86400)
{
/* Change this or make it an option as appropriate. If you're
* getting urls that shouldn't be visible to the public, put the
* cache folder somewhere it can't be accessed from the web
*/
$cache_path = dirname(__FILE__).'/cache';
# For Redmine Turnkeylinux
# save it as "redmine" without quote and file extension
# put in /etc/apache2/conf.d/
# /svn location for users
PerlLoadModule Apache::Redmine
<Location /svn>
DAV svn
@z2z
z2z / redmine svn cron job
Created May 31, 2012 10:15
redmine_cron
# Redmine cron for automatic subversion creation in repos
#
# put in /etc/cron.d
#
# DONT FORGET TO REPLACE YOUR ***YOUR_WS_KEY*** with your key.
1 * * * * root /usr/local/bin/ruby /var/www/railsapp/extra/svn/reposman.rb --redmine localhost --svn-dir /srv/repos/svn --owner www-data --url file:///srv/repos/svn --key=***YOUR_WS_KEY*** >> /var/log/reposman.log
import urllib
import urllib2
import time
import sys
try:
login=sys.argv[1] # 0 -> logout 1-> login
except IndexError:
login = 1
#!/bin/bash
#ishan dot karve at gmail dot com
#Script to emulate HTTP Client login method for 24Online
#Oct 2012, Jamnagar, Gujarat
#ver 0.2 alpha
#Per User Client
#Change variables below to reflect ur setup
#Change Log
# Better program loop
# Coloured debug
#!/usr/bin/ruby
require 'optparse'
require 'net/http'
require 'uri'
class RelianceLogin
def self.login(args)
opt = {}
opt[:host]='220.224.142.229'
@z2z
z2z / winginx_mysql_mariadb_update
Last active August 7, 2019 07:42
winginx update mysql mariadb
Update winginx mysql 5.1 to mysql-5.6.19-winx64 or mariadb 5.X(not tested)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Stop all server and exit winginx
Open winginx folder
Rename rename mysql folder to mysql--backup