Node.js

Install the following for dev. https://nodejs.org/en (Node itself) https://github.com/nvm-sh/nvm (Node Version manager)NVM is not supported on Windows so download below:https://github.com/coreybutler/nvm-windows Test installation node -vnpm -vnvm -v Start your project mkdir first_projectcd first_projectnpm init#To re-download dependencies if requirednpm install npm update#install packages npm install --save expressnpm install chalknpm install debugnpm install morgannpm install nodemonnpm install mysql#install template...

Django app deployment on Ubuntu

Global install sudo apt-get install apache2 python3-django libapache2-mod-wsgi-py3### MySQLsudo apt-get install mysql-server libmysqlclient-devmysql_secure_installationsudo apt-get install python3-dev Virtual env setup sudo apt-get install apache2 python3-pip libapache2-mod-wsgi-py3 virtualenvsudo apt-get install python3-venv (doesn't need. Not tested)sudo a2enmod wsgisudo systemctl restart apache2 Make Python Virtual Environment ### Install venvpip3 install virtualenv### Go to desired location to create venvsudo...

Django HelloWorld with PyCharm

### Install django(venv) C:\Users\kim\PycharmProjects\DjangoHelloWorld>pip install django### Create django project(venv) C:\Users\kim\PycharmProjects\DjangoHelloWorld>django-admin startproject mysite### Test run(venv) C:\Users\kim\PycharmProjects\DjangoHelloWorld\mysite>python manage.py runserver 127.0.0.1:8080 Add the following (optional) to mysite\ settings.py ALLOWED_HOSTS = ### Create app(venv) C:\Users\kim\PycharmProjects\DjangoHelloWorld\mysite>python manage.py startapp polls...

phpMyAdmin on Ubuntu 18.04

Install When prompted, select apache2 Select "apache2"<Yes> for dbconfig-common ### Explicitly enable the mbstring PHP extension sudo phpenmod mbstring ### Load changes sudo systemctl restart apache2 Secure phpMyAdmin instance ### AllowOverride All<Directory /usr/share/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php AllowOverride All ... Create .htaccess at the installed directory sudo nano /usr/share/phpmyadmin/.htaccess Create .htpasswd within /etc/phpmyadmin directory...

LAMP on Ubuntu 18.04

Linux, Apache, MySQL, PHP Adjust firewall Install MySQL Use a password when connecting to MySQL ### Loginsudo mysql sudo mysql -u root -p### view current mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;### Set password for root mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';### Reload with new change mysql> FLUSH PRIVILEGES;### Verify new change mysql>...

Django app development

Install django on venv $ source venv/bin/active (venv) $ pip install django(venv) $ pip install django-crispy-forms(venv) $ pip install Pillow(venv) $ python -m pip install Pillow (venv) $ django-admin startproject domain.sg (venv) # python manage.py startapp blog(venv) # python manage.py startapp users ### Test run your project (venv) $ python manage.py runserver 0.0.0.0:8888 settings.py...

Python basics

types Lists Tuple () Sets {} dict {} ++ increment is not allowed in Python Deploy python to executable Get full path location for *.csv Extract only filename from full path Good to know methods ### Get directory of the objectprint(dir(num))...

Python sorted()

Sort by data value in the list of dict Sort by using itemgetter Sort by attribute value in class Sort by using attrgetter list tuple sort dict by key sort by absolute value...

Pycharm keyboard shortcuts

Must know shortcuts File and class navigation #Recently Opened filesCTRL + E Flask for Pycharm Debugging...

Scroll to top