Skip to content

Instantly share code, notes, and snippets.

View eftakhairul's full-sized avatar
💭
writing code for spaceship :P

Md Eftakhairul Islam eftakhairul

💭
writing code for spaceship :P
View GitHub Profile
@eftakhairul
eftakhairul / nginx_redirection
Last active November 30, 2016 16:37
Basic redirection by nginx
server {
server_name abc.com;
return 301 http://xyz.com;
}
@eftakhairul
eftakhairul / nginx-html-app
Created November 14, 2015 07:18
Basic configuration for HTML App
server {
server_name abc.com;
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /home/app/html-app/dist;
index index.html index.htm;
@eftakhairul
eftakhairul / nginx_nodejs_app
Last active November 30, 2016 16:38
Basic nginx configuration with nodejs with PM2
server {
listen 80;
server_name abc.com;
location / {
proxy_pass http://localhost:2222;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
@eftakhairul
eftakhairul / nginx_rails4_puma_configuration
Last active November 30, 2016 16:38
Configuration for nginx with rails by puma
upstream app {
# Path to Puma SOCK file, as defined previously
server unix:/home/app/abc-app/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
root /home/app/abc-app/public;
@eftakhairul
eftakhairul / depoyment.sh
Created October 13, 2015 06:31
Nodejs deployment
#!/bin/bash
while:
do
node server.js
echo "server crached!"
sleep 1
done
@eftakhairul
eftakhairul / gist:634f27ea84f8db63613a
Created August 27, 2015 17:04
Google Book Library based on ISBN
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Description of ISBA Library
*
* @package Library
* @author Jamael Tanveer Nayon <[email protected]>
* @author Eftakhairul Islam <[email protected]> http://eftakhairul.com
* @website Changebd.net
*/
@eftakhairul
eftakhairul / .bashre creation script
Created October 22, 2014 14:57
Create New Alias .bashre Script
##------------------------------------ ##
# -- new-alias -- #
# creates new alias & writes to file #
# $1 = alias new #
# $2 = alias definition #
##------------------------------------ ##
new-alias () {
if [ -z "$1" ]; then
echo "alias name:"
read NAME
class RemoveOldDuplicatePhoneNumberReference < ActiveRecord::Migration
def change
#fetch all user and remove the cross reference for duplicate phone number
User.real_users.find_in_batches.each(:batch_size => 100) do |batch|
batch.each do |u|
if u.annotations[:users_with_the_same_phone]
# remove other users' reference who are associated with this user
@eftakhairul
eftakhairul / Apache2-Ubuntu Virtualhost Cnfiguration
Last active August 29, 2015 14:06
Whole configuration file of virtualhost in Ubuntu 14.p4 for apache 2
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /home/eftakhairul/codes/php/projects/kondar-global/
ServerName www.kgt-global.local
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /home/eftakhairul/codes/php/projects/kondar-global/>
Require all granted
Options Indexes FollowSymLinks MultiViews
AllowOverride All
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.network "private_network", ip: "192.168.0.210"
config.vm.synced_folder "./dev", "/var/www", create: true
config.vm.provision "shell", path: "https://gist.githubusercontent.com/EmranAhmed/10682844/raw/13d127a5982fa47331aa019ac2d27b9c08f86229/vagrant-provision.sh"
end