Skip to content

Instantly share code, notes, and snippets.

@Abukamel
Abukamel / extensions.json
Last active May 9, 2018 11:30
Visual Studio Code Settings Sync Gist
[
{
"id": "ms-vscode.node-debug2",
"name": "node-debug2",
"publisher": "ms-vscode",
"version": "1.19.0"
},
{
"id": "Atishay-Jain.All-Autocomplete",
"name": "All-Autocomplete",
@Abukamel
Abukamel / NGINXWordPressVHostSample
Last active December 6, 2020 01:57
NGINX WordPress VirtualHost sample including mozilla intermediate SSL letsecrypt certificate using config best practices, mod_pagespeed, wordpress fastcgi_cache and naxsi web application firewall.
server {
listen 80;
listen [::]:80;
server_name www.domainName domainName;
return 301 https://domainName$request_uri;
}
server {
listen 443 ssl http2; # we listen on all ips at port 80
listen [::]:443 ssl http2;
server_name domainName; # vhost domain name
@Abukamel
Abukamel / installPHPFromSourceUbuntu.sh
Last active February 2, 2017 12:08
Install PHP version 7 from source on Ubuntu 14.04+
#!/usr/bin/env bash
# Names of latest versions of PHP package
export VERSION_PHP=php-5.6.26
# PHP mirror URL
export SOURCE_PHP=http://php.net/get/${VERSION_PHP}.tar.bz2/from/this/mirror
# Path to local build
export BUILD_DIR=/usr/local/src/php
@Abukamel
Abukamel / .vimrc
Last active October 23, 2016 07:01
My vimrc
" Credits goes to- Fatih Arslan
" Make sure to install vim-plug first using the following command
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" Then Install The plugins with command :PlugInstall
call plug#begin()
Plug 'fatih/vim-go'
Plug 'AndrewRadev/splitjoin.vim'
Plug 'SirVer/ultisnips'
Plug 'ctrlpvim/ctrlp.vim'
@Abukamel
Abukamel / installPHPFromSource.sh
Last active March 15, 2024 02:48
Install PHP with FPM support from source on Centos 7 Server. Usage: bash installPHPFromSource 7.1.0 php7fpm
#!/usr/bin/env bash
# Names of latest versions of PHP package
export VERSION_PHP="php-${1}"
export FPM="${2}"
# PHP mirror URL
export SOURCE_PHP=http://php.net/get/${VERSION_PHP}.tar.bz2/from/this/mirror
# Path to local build
export BUILD_DIR=/usr/local/src/php
@Abukamel
Abukamel / installNginxWithHttp2.sh
Last active January 8, 2017 06:07
Install nginx with libressl and http2 support on Centos 7. Credit goes to Matthias Adler https://matthiasadler.info/blog/nginx-http2-static-libressl-on-centos-7/
#!/usr/bin/env bash
# Names of latest versions of each package
export VERSION_PCRE=pcre-8.39
export VERSION_ZLIB=zlib-1.2.10
export VERSION_LIBRESSL=libressl-2.4.4
export VERSION_NGINX=nginx-1.11.8
# Download nginx cache purge module to add it in compilation time
# git clone https://github.com/FRiCKLE/ngx_cache_purge
@Abukamel
Abukamel / apache_jk_glassfish.md
Created July 27, 2015 08:13
install and confiugre glassfish version 3.1.2 and serve it via apache 2.4 server in front of glass fish ones using mod_jk
  • glassfish_server:

    • hostname: gf.localdomain
    • ip: 192.168.1.200
  • apache_server:

    • hostname: web.localdomain
    • ip: 192.168.1.100
@Abukamel
Abukamel / s
Last active August 29, 2015 13:57
fast ssh using farbic and storm
#!/usr/bin/python2
# require fabric python module
# install pip, then: pip install fabric
import sys
import subprocess
from fabric.api import *
try:
sys.argv[1]
except:
@Abukamel
Abukamel / email_send
Created December 16, 2013 12:46
simple function for sending email via python
#!/usr/bin/env python
import smtplib
def send_email(sender, receivers, message):
sender = sender
receivers = receivers
message = message
smtplib.SMTP('localhost').sendmail(sender, receivers, message)