Skip to content

Instantly share code, notes, and snippets.

View haisum's full-sized avatar

Haisum Mussawir haisum

View GitHub Profile
@haisum
haisum / hsmpp.wsdl.xml
Created February 28, 2016 14:17
WSDL file example
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Hsmpp Service"
targetNamespace="http://www.csoft.co.uk/dtd/sendsms5.wsdl"
xmlns:tns="http://www.csoft.co.uk/dtd/sendsms5.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns2="http://www.csoft.co.uk/dtd/sendsms5.xsd"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@haisum
haisum / mysql-innodb-bakcup-restore.sh
Created January 2, 2016 05:05
script to restore and perform incremental mysql backups
#!/bin/bash -x
#Tue Jul 2 15:32:21 CEST 2013
#Made by Edward Z.
set -e #stops execution if a variable is not set
set -u #stop execution if something goes wrong
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: do a full backup of vinnie /var/lib/mysql using innobackupex, aprox time 6 hours."
@haisum
haisum / parsejson.sh
Created November 26, 2015 13:50
Parsing json on bash using python
response='{"buildsNumbers":[{"uri":"/7","started":"2015-11-26T04:28:24.443-0500"},{"uri":"/8","started":"2015-11-26T06:31:54.770-0500"}],"uri":"http://example.com/api"}'
python -c "import json; s=json.loads('$response');print(max(s['buildsNumbers'], key = (lambda key: int(key['uri'][1:])))['uri']);"
@haisum
haisum / C.sublime-build
Created November 16, 2015 06:26
C build system for sublime text 3 on windows
{
"cmd" : ["gcc", "$file_name", "-o", "${file_base_name}.exe"],
"selector" : "source.c",
"shell": true,
"working_dir" : "$file_path",
"variants" : [
{ "name": "Run",
"cmd" : ["${file_base_name}.exe"]
}
@haisum
haisum / sleepFor.js
Created September 30, 2015 07:13
Javascript sleep function
function sleepFor( sleepDuration ){
var now = new Date().getTime();
while(new Date().getTime() < now + sleepDuration){ /* do nothing */ }
}
@haisum
haisum / postfix-dovecot-ubuntu14.04.sh
Last active February 7, 2024 08:37
Automated bash script to setup dovecot postfix mysql email server on ubuntu 14.04
#!/usr/bin/env bash
#####
# Script to install postfix
#####
DOMAIN="example.com"
EMAIL="haisum@example.com"
PASSWORD="example.com1*"
@haisum
haisum / script.sh
Created September 1, 2015 06:10
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
@haisum
haisum / sticky.css
Created June 15, 2015 11:20
Sticky footer without fixed position
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 80px;
}
@haisum
haisum / install-varnish.sh
Created March 10, 2015 07:39
Varnish Installation on Cpanel or Whm
#!/bin/bash
# This script installs VARNISH Cache along side Apache on cPanel servers.
#This script installs VARNISH, changes the Apache port to 82, writes
# some config files, starts VARNISH, and terminates.
### Made by Shubham Mathur (itseasy21)
#-Colors :D
RED='\033[01;31m'