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 / MultiUserProvider.php
Created October 19, 2015 07:29 — forked from Xethron/MultiUserProvider.php
Laravel 4 Authenticate Multiple User Provider Allows Laravel Auth to login using multiple tables and/or databases/Eloquent User Models... Each User Model can have its own Hasher and Hasher options...
<?php //app/libraries/MultiUserProvider.php
use Illuminate\Auth\UserProviderInterface,
Illuminate\Auth\UserInterface,
Illuminate\Auth\GenericUser;
class MultiUserProvider implements UserProviderInterface {
protected $providers;
/*
* Onkyo firmware decryptor v2 (c) 2014 - vZ@divideoverflow.com
*
* version 2:
* re-written for more sophisticated parsing, fixing bug with some blocks being missed
*
* version 1.0:
* initial release
*
* Thanks to Turmio for the only page found on the web dedicated to ONKYO reversing
@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
*
*/
@z2z
z2z / install.sh
Last active December 23, 2015 15:18
CentOS LAMP + 5.5, Laravel and Composer install script.
echo ">>> Starting install script"
sudo yum -y update
echo ">>> Installing Apache, MySQL and PHP"
sudo rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
sudo yum install -y nano git-core httpd php55w php55w-common php55w-mysql php55w-mcrypt php55w-gd php55w-xmlrpc php55w-mbstring php55w-xml
sudo yum install -y yum-plugin-replace
sudo yum replace -y mysql-libs --replace-with mysql55w-libs
sudo yum install -y mysql55w mysql55w-server
@z2z
z2z / nginx_php_5.5_mysql_ubuntu_14.04_setup.sh
Last active February 3, 2016 18:49
nginx php 5.5 ubuntu 14.04 setup for laravel 4.2 based on laravel/settler
#!/usr/bin/env bash
USERNAME="linuxuser"
MYSQLROOTPASS="somesecret"
# Update Package List
apt-get update
# Update System Packages
apt-get -y upgrade
#!/usr/bin/env bash
mkdir /etc/nginx/ssl 2>/dev/null
openssl genrsa -out "/etc/nginx/ssl/$1.key" 1024 2>/dev/null
openssl req -new -key /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.csr -subj "/CN=$1/O=Vagrant/C=UK" 2>/dev/null
openssl x509 -req -days 365 -in /etc/nginx/ssl/$1.csr -signkey /etc/nginx/ssl/$1.key -out /etc/nginx/ssl/$1.crt 2>/dev/null
block="server {
listen ${3:-80} default_server;
listen ${4:-443} ssl;
##############################################################################
# INSTALL isolated PHP 5.6 ZTS (Thread-safe) with pthreads on Ubuntu 14.04 ###
##############################################################################
1) Install necessary bison version
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb
wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb
dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb
dpkg -i bison_2.7.1.dfsg-1_amd64.deb
@z2z
z2z / bitnami custom app sentrifugo hrms setup.sh
Last active June 6, 2016 14:27
bitnami custom app sentrifugo hrms setup
## bitnami custom app sentrifugo hrms
APP_NAME='sentrifugo'
sudo mkdir -p /opt/bitnami/apps/$APP_NAME/htdocs /opt/bitnami/apps/$APP_NAME/conf
sudo chown -R bitnami /opt/bitnami/apps/$APP_NAME
echo '<?php phpinfo(); ?>' > /opt/bitnami/apps/$APP_NAME/htdocs/index.php
@z2z
z2z / gist:3c2f9a0d31cbc1cf17c785562d72a79e
Last active June 15, 2016 13:52 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 20px; }
@media (min-width: 768px){
body{ padding-top: 150px; }
}
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; max-width: 650px; margin: 0 auto; }