Skip to content

Instantly share code, notes, and snippets.

View shahzaibalikhan's full-sized avatar

Shahzaib Ali Khan shahzaibalikhan

  • Berlin, Germany
View GitHub Profile
@shahzaibalikhan
shahzaibalikhan / 00-about-search-api-examples.md
Created July 28, 2016 05:38 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@shahzaibalikhan
shahzaibalikhan / redis-server.service
Created May 10, 2016 06:23 — forked from geschke/redis-server.service
Ubuntu systemd service file for Redis. The server was updated to a Ubuntu 15.04 (Vivid Vervet) distribution. Redis was installed from the PPA from Roman Wookey (https://launchpad.net/~rwky/+archive/ubuntu/redis). After the switch to systemd instead of Upstart, Redis was not started by default. So I've hacked the following systemd config file. It…
[Unit]
Description=Redis Datastore Server
After=network.target
[Service]
Type=forking
PIDFile=/var/run/redis/redis.pid
ExecStartPre=/bin/mkdir -p /var/run/redis
ExecStartPre=/bin/chown redis:redis /var/run/redis
@shahzaibalikhan
shahzaibalikhan / redis.markdown
Created May 9, 2016 06:50 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid ubuntu
chdir /opt/myAplicacion
env PORT=3000
description "Server Name
author "author"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn
exec sudo -u ubuntu sh -c "NODE_ENV=production node /var/sites/stuff/app.js >> /var/log/stuff.log 2>&1"
@shahzaibalikhan
shahzaibalikhan / README.md
Created May 2, 2016 21:12 — forked from toadkicker/README.md
The Perfect Nginx / Node Server

The Perfect Node / Nginx Server

  • Ubuntu 14.10 64 bit
  • Node 0.10.x from source
  • Nginx from source with SPDY & Pagespeed support

Assumes you're doing everything under /home/ubuntu

OS configuration

@shahzaibalikhan
shahzaibalikhan / fooapp.service
Created May 2, 2016 21:04 — forked from DeadAlready/fooapp.service
Systemd configuration file
[Unit]
Description=Our cool Node.js App
After=network.target
[Service]
Type=forking
Restart=always
User=fooapp
ExecStart=/var/appdata/fooapp/node_modules/pm2/bin/pm2 start /var/appdata/fooapp/app.js
ExecStop=/var/appdata/fooapp/node_modules/pm2/bin/pm2 stop /var/appdata/fooapp/app.js
@shahzaibalikhan
shahzaibalikhan / ror-provisioning.sh
Created February 27, 2016 20:48 — forked from arielcr/ror-provisioning.sh
Ruby on Rails Provisioning Script
#!/bin/bash
echo Provisioning Ruby on Rails...
echo =================================
echo - Installing dependencies
sudo apt-get update -y -qq > /dev/null
sudo apt-get install curl -y -qq > /dev/null
echo - Installing mysql server
export DEBIAN_FRONTEND=noninteractive
@shahzaibalikhan
shahzaibalikhan / rails-vagrant-provision.sh
Created February 27, 2016 20:44 — forked from johanneswuerbach/rails-vagrant-provision.sh
Provision a vagrant box with ruby stable (using rvm), postgres, redis and node (using nvm)
#!/usr/bin/env bash
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8
sudo apt-get update
sudo apt-get install -y build-essential git curl libxslt1-dev libxml2-dev libssl-dev
# postgres
@shahzaibalikhan
shahzaibalikhan / install_mysql.sh
Created February 27, 2016 20:41 — forked from rrosiek/install_mysql.sh
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Outputs nearly everything to /dev/null since "quiet" on most commands is still noisy.
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"