Skip to content

Instantly share code, notes, and snippets.

Avatar

Amon Moce Rodolphe BAZONGO amonmoce

View GitHub Profile
View Azure Machine Learning Set Up
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
View Installing Flask
# 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
View gist:abab3ba3e023af179f0924c26cadd2c5

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".

View For installing pg on ubuntu
pip install psycopg2
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install python-psycopg2
sudo apt-get install libpq-dev
View [emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
If you get following error, when you try to start nginx…
[emerg]: bind() to 0.0.0.0:80 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
amonmoce / nginxproxy.md
Created May 3, 2017 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

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 example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

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

View move a ubuntu system into another drive
#image of /dev/sd5 in sd5.img
sudo dd if=/dev/sda5 of=/home/sda5.img
#install grub in sdb
grub-install /dev/sdb
update-grub
#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
amonmoce / gist:998dd2e150dfdf2d96fe
Created Oct 26, 2015
the best way to completely uninstall node + npm from MAC OSX
View gist:998dd2e150dfdf2d96fe
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:
View Probleme Encountered when creating Windows bootable USB device
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
diskpart
list disk
select disk #
clean
create partition primary
select partition 1
@amonmoce
amonmoce / Symfony 2 error timezone
Created Oct 12, 2014
Cannot run php app/console ... when I do so I have a problem related to date_default_timezone_get ....
View Symfony 2 error timezone
Symfony 2 error:
======================
[Symfony\Component\Debug\Exception\ContextErrorException]
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