Skip to content

Instantly share code, notes, and snippets.

@z2z
z2z / AzureSubscription_switch.ps1
Created April 23, 2015 08:14
Migrate Azure VM image from one Subscription to another Subscription
# https://serverfault.com/a/655552/283258
Select-AzureSubscription -SubscriptionName "EXISTING SUBSCRIPTION NAME"
#Get-AzureVM
$vmName = "YOUR_VM_NAME"
$serviceName = "CLOUD_SERVICE_NAME"
$destServiceName = "NEW_CLOUD_SERVICE_NAME"
$workingDir = (Get-Location).Path
$sourceVm = Get-AzureVM -ServiceName $serviceName -Name $vmName
@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 / 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
@z2z
z2z / FileStream.php
Created December 1, 2015 13:20 — forked from LukasStribrny/FileStream.php
PHP Any File Stream With HTTP_RANGE
<?php
/**
* Description of FileStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
* @co-author Lukas Stribrny
* Added support for fileinfo,mod_ratelimit
*
*/
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'