Skip to content

Instantly share code, notes, and snippets.

View Mulkave's full-sized avatar
⌨️
binge coding

Abed Halawi Mulkave

⌨️
binge coding
View GitHub Profile
@Mulkave
Mulkave / Dockerfile-supervisor
Last active November 16, 2020 21:01
A Dockerfile for Fedora/CentOS/Red Hat based systems that creates an image with supervisord running sshd that uses SSH keys for authentication.
##
#
# setup:
# - generate an ssh key to be used as an authentication key with `ssh-keygen` and call it `docker_ssh_rsa`
# - make sure your current ssh agent has the identity file added
# - $ eval `ssh-agent`
# - $ ssh-add docker_ssh_rsa
#
# build: $ sudo docker build -t <you>/spvssh .
#
@Mulkave
Mulkave / log-l4-queries.php
Created April 3, 2014 14:49
Log Queries in Laravel 4
<?php
/*
should be in your routes/filters or anywhere else
they can be read on boot..
*/
Event::listen('illuminate.query', function($query, $bindings, $time, $name)
{
$data = compact('bindings', 'time', 'name');
@Mulkave
Mulkave / Dockerfile-ssh
Last active August 29, 2015 13:57
A Dockerfile for Fedora/CentOS/Red Hat based systems that runs with enabled ssh access using ssh keys.
##
#
# setup:
# - generate an ssh key to be used as an authentication key with `ssh-keygen` and call it `docker_ssh_rsa`
# - make sure your current ssh agent has the identity file added
# - $ eval `ssh-agent`
# - $ ssh-add docker_ssh_rsa
#
# build: $ sudo docker build -t <you>/ssh .
#
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@Mulkave
Mulkave / nginxstats.py
Last active December 20, 2015 13:59
Script to prettify the Nginx status coming out of the HttpStubStatusModule
#!/usr/bin/env python
### Add this to the server ###
#location /nginx_status {
# # copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/
# stub_status on;
# access_log off;
# allow SOME.IP.ADD.RESS;
# deny all;
@Mulkave
Mulkave / drupal-installation-ec2-ami.sh
Created July 29, 2013 09:41
Script to install drupal on Amazon AWS EC2 instances (AMI)
# update
sudo yum -y update
# install nginx -- the web server to be used with this installation
# for virtual host configuration visit https://gist.github.com/Mulkave/6103129
sudo yum install nginx
# install php and mysql
sudo yum -y install mysql mysql-server php54 php54-cli php54-gd php54-intl php54-mbstring php54-mcrypt php54-mysql php54-pdo php-pear php54-xml php54-xmlrpc
@Mulkave
Mulkave / drupal-nginx-virtualhost.conf
Created July 29, 2013 09:08
drupal virtual host configuration for Nginx
server {
server_name [host];
root /var/www/[document_root]; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
{
"auto_complete": false,
"color_scheme": "Packages/User/Themes/Peacock.tmTheme",
"font_face": "Inconsolata",
"font_options":
[
"subpixel_antialias"
],
"font_size": 13.0,
"highlight_line": true,
@Mulkave
Mulkave / laravel-nginx-virtualhost.conf
Last active December 20, 2015 01:59
A virtual host script for laravel projects
# NOTE: Assumes the existence of a conf directory with a php.conf inside if
# check https://gist.github.com/Mulkave/6053040 (Mulkave/nginx-php.conf)
server {
listen 80;
server_name [host];
root [document_root];
#charset koi8-r;
@Mulkave
Mulkave / nginx-php.conf
Last active December 20, 2015 01:59
PHP-FPM handler for php scripts proxied by Nginx
# NOTE: make sure the 'include' directive is correct according to your nginx installation
# NOTE: make sure the fastcgi_pass is running on the correct socket
# might need to change it to http://127.0.0.1:9000 with default php-fpm configuration
try_files $uri =404;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
include /usr/local/etc/nginx/fastcgi_params;