Skip to content

Instantly share code, notes, and snippets.

View ahmedsbytes's full-sized avatar

Ahmed Abdou ahmedsbytes

View GitHub Profile
<?php
class plgSystemVarnish extends JPlugin
{
function onAfterRoute( )
{
$user = JFactory::getUser( );
$option = JRequest::getVar( 'option' );
if( !$user->guest || $option == 'com_users' )
{
setcookie( 'varnishbypass', 'True', time( ) + 604800, '/' );
ssh-dss AAAAB3NzaC1kc3MAAACBAMuihCjBnwnwSSLmZXMdafCDynbpstmSyDP2tvRxtpdcBS3weqHrd658qnMCxDQoCuKFzVZS7teX/UzdtYmDJrm5BUPZgSBnKY/cJxBctPvOvHNks76yEagavBUrAJqGjzUKSqU1t4tRLn5kNfirJecEu/yxmVEZ2vYH8PspzCg7AAAAFQC9Jb6tvGOZNJz+Kkff8ClMsl9rNQAAAIByMBnfpCbf7m606j3Ujb0zZsjM2jQJwZs95WYwyMXQKVfhkRT+x0bHTFMWT41xMVSroCUrevl1cKVrDea/zYjG2CevIyQ07l+jDBqMDx08nbJfI6Fa4HxHTTe5V0a6rq4YiCt8YHDsdY++eTyx/DEWUlfY2R+fxCWQnK8MFJjZBQAAAIBhEFcG3TUh14Q+qQgRJqxUgCT5fCOMuWQi5kEl8r5G0c8M1uG+O1+XCkhjikA0Q64WZkkoNy1Hz7gKWwbNbSmzjfvGSibW0QPeqSO4cCR3gQuIhM2qO+Up6VOky8nUd1VvDvZAlD9riA9TXk50kGi89QoAwvpCu0dLrkKqHXfLPQ== sysadmins@vision-as.com
@ahmedsbytes
ahmedsbytes / git_shortcuts.zsh
Last active August 29, 2015 14:15
My Git Command line short cuts
function ggs()
{
git status
}
function ggp()
{
git pull origin $(ggcb)
}
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArVLG93m+dl62E5TWJX8JYYS3FZAKlH2MveI7JTnAf+Z6JPJqH6fmWyvs5yNC/EN/IARn9tFO2yjzvaEm4pGrGiTdtfP8tNYTT599VaTNuSVoo538gYrcpQTR6z8hUiajLBPn35RlbX2kk3HmTwSXruPzw+Kwie9OWMkkzfA5EH5jwmqpxsmXxY+Ae+lNsPRXAetLm5hMEQK1KUtXJLIW8/zknHq96pC7mH+P5sUQyarQztoxQizXyDL12rD8MUmoHg/1xCpAoSpnPUnuyEIbgd++XTwuP6xX02y/Hf9CO6Fjt1MNSbCJfn67qEH/bUpwA7onhzOOGbJYbsSFFmTFzw== ahmed@araby.name
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
source src1
{
type = mysql
sql_host = localhost
sql_user = root
<?php
class Paypal {
/**
* Last error message(s)
* @var array
*/
protected $_errors = array();
/**
* API Credentials
@ahmedsbytes
ahmedsbytes / ovh_fence.py
Created November 3, 2013 12:10
A python script that restarts other node on ovh when fencing occurs Original post http://forum.proxmox.com/threads/11066-Proxmox-HA-Cluster-at-OVH-Fencing?p=75152
# assemled by Dennis Busch, secofor GmbH,
# Germany
# This work is licensed under a
# Creative Commons Attribution-ShareAlike 3.0 Unported License.
# Manual call parametres example
#
# login=ab12345-ovh
# passwd=MYSECRET
# email=admin@myadmin
@ahmedsbytes
ahmedsbytes / deploy.sh
Created November 30, 2013 23:06
My Deployment script , that upload a specific git repo to it's production env location , also enables you to add your files to override the repo files - Please read the file carefully before using it - Licenece : GNU GPL v2 -required file structure for the deployment script example.com/ deploy.sh git logs push temp
#!/bin/bash
SERVERS="192.168.2.101 192.168.2.102 192.168.2.106 192.168.2.107"
#SERVERS="192.168.2.107"
GITDIR="$(pwd)/git"
WORKING="$(pwd)/temp"
PUSH="$(pwd)/push"
REV=13
SSH_USER="example.com"
@ahmedsbytes
ahmedsbytes / varnish.default
Last active December 29, 2015 20:59
My Varnish Files
# server.
#
backend default {
.host = "10.0.1.153";
.port = "80";
# .probe = {
# .url = "/index.php";
# .interval = 3s;