Skip to content

Instantly share code, notes, and snippets.

View skmezanul's full-sized avatar

SK Mezanul Haque skmezanul

View GitHub Profile
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
@skmezanul
skmezanul / Package.php
Created October 12, 2015 14:03 — forked from smithweb/Package.php
Magento CSS Auto Versioning
<?php
// app/code/local/SW/Core/Model/Design/Package.php
class SW_Core_Model_Design_Package extends Mage_Core_Model_Design_Package
{
/**
* Get the timestamp of the newest file
*
* @param array $files
* @return int $timeStamp

Keybase proof

I hereby claim:

  • I am skmezanul on github.
  • I am skmezanul (https://keybase.io/skmezanul) on keybase.
  • I have a public key whose fingerprint is C04E F5B0 872A D209 8C42 374B 7DAC 1DA0 5729 787D

To claim this, I am signing this object:

@skmezanul
skmezanul / redis-server
Created November 26, 2015 14:03
A redis-server startup script that allows redis-server to run as a non-root user (modified from one of the many other scripts already done). Ensure that the redis files and directories in your redis.conf file has the proper permissions.
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: 234 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid

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:

@skmezanul
skmezanul / gist:ca345718ae6cbd88b067ef030788d822
Created February 20, 2017 16:35 — forked from ericandrewlewis/gist:95239573dc97c0e86714
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

@skmezanul
skmezanul / robots.txt
Created May 3, 2017 07:21 — forked from hn-support/robots.txt
Magento 2 recommended additions for robots.txt
User-agent: *
# Directories
Disallow: /app/
Disallow: /bin/
Disallow: /dev/
Disallow: /lib/
Disallow: /phpserver/
Disallow: /pkginfo/
Disallow: /report/
@skmezanul
skmezanul / proxylist.hidemyass.com.scraper.js
Created May 23, 2017 15:01 — forked from squidfunk/proxylist.hidemyass.com.scraper.js
A web scraper to obtain lists of anonymous proxies for web scraping
/*
* Copyright (c) 2016 Martin Donath
*
* All rights reserved. No part of this computer program(s) may be used,
* reproduced, stored in any retrieval system, or transmitted, in any form or
* by any means, electronic, mechanical, photocopying, recording, or otherwise
* without prior written permission.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
@skmezanul
skmezanul / gist:4e11945657483f40e3e182d2cb8254b2
Created August 4, 2017 18:14 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@skmezanul
skmezanul / README.md
Created August 4, 2017 18:14 — forked from hofmannsven/README.md
My simply Git Cheatsheet