Skip to content

Instantly share code, notes, and snippets.

View amonmoce's full-sized avatar

Amon Moce Rodolphe BAZONGO amonmoce

View GitHub Profile
brew update && brew install azure-cli
# create azure account
# create azure directory
# can create user in that directory
# create subscription in that directory
az login
# Ubuntu 16.04 (default Python 3.5), not Ubuntu => go install
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip python3-dev python3-venv
# Environnements folders
mkdir venvs
# Specify the system python3 installation
python3 -m venv venvs/flaskproj
# Activate the virtualenv

User Stories

  1. Authentication: User can signup/login/logout

  2. Items for sale: User can view lists of items for sale and search by name, filter by price.

  3. Shopping Cart: User can add items to shopping cart and the app remembers it next time you login. User can view all the items in their shopping cart. User can delete items in the shopping cart. Shopping cart uses an integer column to store "state".

  4. Checkout: User can fill in form and submit billing info. After submitting billing info, items in the shopping cart will move to a different "state".

pip install psycopg2
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install python-psycopg2
sudo apt-get install libpq-dev
If you get following error, when you try to start nginx…
[emerg]: bind() to failed (98: Address already in use)
Then it means nginx or some other process is already using port 80.
You can kill it using:
sudo fuser -k 80/tcp
amonmoce /
Created May 3, 2017 14:59 — forked from soheilhy/
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

#image of /dev/sd5 in sd5.img
sudo dd if=/dev/sda5 of=/home/sda5.img
#install grub in sdb
grub-install /dev/sdb
#make a disk bootable
sudo umount /dev/sdX
sudo dd if=/path/to/ubuntu.iso of=/dev/sdX bs=4M && sync
#set a partition to boot
parted -s /dev/sda set 2 boot on
amonmoce / gist:998dd2e150dfdf2d96fe
Created October 26, 2015 14:50
the best way to completely uninstall node + npm from MAC OSX
The following is the best way to completely uninstall node + npm:
go to /usr/local/lib and delete any node and node_modules
go to /usr/local/include and delete any node and node_modules directory
if you installed with brew install node, then run brew uninstall node in your terminal
check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
go to /usr/local/bin and delete any node executable
You may need to do the additional instructions as well:
Trying to use Windows 7 USB/DVD Download Tool, to create a bootable USB in order to install Windows from USB.
Problem: "Sorry, we are unable to copy your files .... (blablabla)"
Solution: Type these commands on the cmd
list disk
select disk #
create partition primary
select partition 1
amonmoce / Symfony 2 error timezone
Created October 12, 2014 20:40
Cannot run php app/console ... when I do so I have a problem related to date_default_timezone_get ....
Symfony 2 error:
Warning: date_default_timezone_get(): It is not safe to rely on the system
's timezone settings. You are *required* to use the date.timezone setting
or the date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely misspelle
d the timezone identifier. We selected the timezone 'UTC' for now, but ple
ase set date.timezone to select your timezone. in /Users/amonmoce/Document
s/Web/www/ZakafricaProject/vendor/monolog/monolog/src/Monolog/Logger.php l