Skip to content

Instantly share code, notes, and snippets.


Ahmad Hassan ahmadhasankhan

View GitHub Profile
View MySql-5.5-installation

MySQL Download URL

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
ahmadhasankhan / db_backup.rb
Last active Jun 27, 2020
MySQL DB backup script in Ruby CMD
View db_backup.rb
#1===========First code================
#!/usr/bin/env ruby
databases = {
:local_db => {
:database => 'my_db',
:username => 'root',
:password => 'admin',
:host => 'localhost'
ahmadhasankhan /
Last active Jun 22, 2020
Install ImageMagick 6.7.7-10 on Unix using binary

Remove imagemagick

sudo apt-get --purge remove imagemagick
sudo apt autoremove

Install Required package:

sudo apt-get install build-essential 
sudo apt-get install checkinstall
ahmadhasankhan / Ruby and Rails Interview Cheat
Last active Jun 12, 2020
This is my Ruby interview cheat sheet. Feel free to fork it, Use it, Share it, or do whatever you want with it. PLEASE let me know if there is any error or if anything crucial is missing. I will keep updating...
View Ruby and Rails Interview Cheat

Ruby and Rails Interview Questions


  • What is a class?
  • What is an object?
  • What is a module? Can you tell me the difference between classes and modules?
  • Can you tell me the three levels of method access control for classes and modules? What do they imply about the method?
  • There are three ways to invoke a method in ruby. Can you give me at least two?
  • Explain this ruby idiom: a ||= b

The Rails Style Guide

This Rails style guide recommends best practices so that real-world Rails programmers can write code that can be maintained by other real-world Rails programmers. A style guide that reflects real-world usage gets used, and a style guide that holds to an ideal that has been rejected by the people it is supposed to help risks not getting used at all – no matter how good it is.

The guide is separated into several sections of related rules. I've tried to add

ahmadhasankhan /
Last active Apr 17, 2019
Install Wkhtmltopdf 0.12.5–1 on Ubuntu 18.4
sudo apt-get --purge remove wkhtmltopdf
sudo apt autoremove
sudo apt update

Install Wkhtmltopdf 0.12.5–1

  • Download Wkhtmltopdf package for Debian 9 from repository,
ahmadhasankhan / imagemagick.rb
Last active Apr 16, 2019
ImageMagick 6.7.7-10 Homebrew
View imagemagick.rb
require 'formula'
class Imagemagick < Formula
homepage ''
url ''
sha256 '85b0f9afe122c52a821001976a4f54ae011bb3d94a87b97e3112e515185731ad'
head '',
:using => UnsafeSubversionDownloadStrategy
ahmadhasankhan /
Last active Mar 28, 2019
Install and Setup Nginx+Puma+PostgresSQL on Ubuntu-18

Install and Setup Nginx+Puma+PostgresSQL on Ubuntu-18

Create Deploy User:

  From the root user 
  $ adduser involvio
  $ adduser involvio sudo
  $ exit
ahmadhasankhan /
Created May 28, 2018 — forked from JamesMGreene/
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN3A4R4IpK9kVu9zf8Fh410FZJbTl8PZG6QgPi76jBINLoj3Vr1OAdfHEmopfIlaT4Ce4r3gk0SauTqkSwujCM9I+VzvejRBMOcUU9iW3tBVYpNfYeB856mHvB3DF3fVD6OtgufaKh6OkjPxfg7kU+xRWcana3X02631Z46/2ZY9gKqr4ao0WkLn+ylj9huKawJkwbvAzAb/ieG16ut0BwAmZUAF1tqtShfNY+1EbiJRWU7oP8h7YUM2p9x1zHw07NKhgf+HAZd8XAjbgup6qyegWhjeDWK/g3x4WyQMR2KNNA90iG2LiUHI/yiFcjWqDOrw9LJrXYqAYuSegN/NNJ ahmadhassan@ahmads-mbp
You can’t perform that action at this time.