Skip to content

Instantly share code, notes, and snippets.

View abdulhalim-cu's full-sized avatar

Abdul Halim abdulhalim-cu

  • Brain Station 23 Ltd
  • Dhaka
View GitHub Profile
#!/bin/bash
#date: 20/02/2017
#this script will install basic server package,php,composer,mysql,webserver etc
#this script has code for install both php 5 and 7 but default is 5
#this script has code for install both nginx and apache2 but default is apache2
#check if script run by Mr.Root :P
set -eu
if [ "$(id -u)" != "0" ]; then
@abdulhalim-cu
abdulhalim-cu / odoo_install_script.sh
Created October 7, 2017 12:57
Odoo Community & Enterprise Installation Script
#!/bin/bash
################################################################################
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
@abdulhalim-cu
abdulhalim-cu / vim
Last active October 21, 2017 06:04
Mastering Vim
1st Level
Normal Mode:
i → Insert mode. Type ESC to return to Normal Mode
x → Delete the char under the cursor
:wq → Save & quit (:w save, :q quit)
dd → Delete (and Copy) the current line
P → Paste
hjkl → Basic cursor mode (←↓↑→)
:help <command> to get general help
@abdulhalim-cu
abdulhalim-cu / sublime-text-3-for-ubuntu-16.04-or-higher
Created October 15, 2017 09:16
Install Sublime Text 3 in Ubuntu 16.04 & Higher The Official Way
1. Open terminal via Ctrl+Alt+T & run command to install the Key:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
2. Then add the apt repository via command:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
3. Finally check updates and install sublime-text by running commands on terminal
sudo apt update && sudo apt install -y sublime-text
Uninstall Sublime Text:
@abdulhalim-cu
abdulhalim-cu / Odoo-10-Install-Process
Created October 15, 2017 09:36
Install Odoo 10 on Ubuntu 16.04 LTS
Setp-1: Update & Upgrade Source List
update apt source list
sudo apt-get upgrade
Step-2: Install python dependencies for Odoo
sudo apt-get install python-dateutil python-docutils python-feedparser python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-psycopg2 python-psutil python-pybabel python-pychart python-pydot python-pyparsing python-reportlab python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt python-yaml python-zsi poppler-utils python-pip python-pypdf python-passlib python-decorator gcc python-dev mc bzr python-setuptools python-markupsafe python-reportlab-accel python-zsi python-yaml python-argparse python-openssl python-egenix-mxdatetime python-usb python-serial lptools make python-pydot python-psutil python-paramiko poppler-utils python-pdftools antiword python-requests python-xlsxwriter python-suds python-psycogreen python-ofxparse python-gevent
Step-3: Odoo Web dependencies
# Add CodeLite Public Key
sudo apt-key adv --fetch-keys http://repos.codelite.org/CodeLite.asc
# Add repository to /etc/apt/sources.list
deb http://repos.codelite.org/wx3.1.0/ubuntu/ xenial universe
# Update system
sudo apt-get update
# Install packages
@abdulhalim-cu
abdulhalim-cu / mountain.js
Last active October 25, 2017 08:19
Mountain view using javascript
var landscape = function() {
var result = "";
var flat = function(size){
for (i=0; i<size; i++)
result += "_";
}
var mountain = function(size){
result += "/"
for (i=0; i<size; i++)
result += "'";
function power(base, exponent){
if (exponent == 0)
return 1;
else
return base * power(base, exponent-1);
}
console.log(power(5, 6));
function findSolution(target) {
function find(current, history){
if (current == target)
return history;
else if (current > target)
return null;
else
return find(current + 5, "(" + history + " + 5)") ||
find(current * 3, "(" + history + " * 3)");
}
@abdulhalim-cu
abdulhalim-cu / isEven.js
Created October 25, 2017 12:22
We’ve seen that % (the remainder operator) can be used to test whether a number is even or odd by using % 2 to check whether it’s divisible by two. Here’s another way to define whether a positive whole number is even or odd
// Your code here.
function isEven(number){
while (number > 0 || number < 0)
if (number > 0 && (isEven(number - 1) == 0))
return true;
else if(number < 0 && (isEven(number + 1) == 0))
return true;
else
return false;
}