Skip to content

Instantly share code, notes, and snippets.

@ncole458
ncole458 / style.scss
Created February 25, 2018 09:03
Fix Carousel in Bootstrap 4
// FIX BOOTSTRAP CAROUSEL WHITE-SPACE BETWEEN SLIDES
.carousel-item {
transition: -webkit-transform 0.5s ease !important;
transition: transform 0.5s ease !important;
transition: transform 0.5s ease, -webkit-transform 0.5s ease !important;
-webkit-backface-visibility: visible !important;
backface-visibility: visible !important;
}
@ncole458
ncole458 / cli.txt
Last active March 29, 2018 03:23
CLI commands
# view all running processes
ps aux
# kill a process
sudo kill <PID>
# edit SSH keys
cd ~/.ssh
nano authorized_keys
@ncole458
ncole458 / mime.types
Last active April 18, 2018 01:41
Fix Nginx fonts not working
# add below to /etc/nginx/mime.types
application/x-font-ttf ttc ttf;
application/x-font-otf otf;
application/font-woff woff;
application/font-woff2 woff2;
application/vnd.ms-fontobject eot;
# add below to /sites/available/your-site
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
@ncole458
ncole458 / default
Last active April 18, 2018 10:42
Nginx 'sites-available' rewrite for Ember.js (Ember breaks on refresh 404)
# Ember breaks on refresh (404)
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
# Add the below rule to fix
@ncole458
ncole458 / pycharm-venv.txt
Last active April 18, 2018 10:43
PyCharm VENV (How to configure PyCharm to use virtual environment)
# Reminder for me! How to configure PyCharm to use venv
- create virtual env as per usual via command line
- PyCharm > Preferences > Project / Project Interp.
- click cog > Add Local & and select Python from within local project bin
- Done!
@ncole458
ncole458 / gunicorn.sock
Last active April 20, 2018 10:53
Fix Gunicorn socket with Nginx not working
# Fix Gunicorn socket with Nginx not working
# create a new gunicorn sock (for nginx)
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04#create-a-gunicorn-systemd-service-file
# NGINX - make sure same sock so nginx can talk to Gunicorn!
upstream app_server {
server unix:/home/django/django_project/MyAPIName/mysockname.sock fail_timeout=0;
}
@ncole458
ncole458 / default
Created May 2, 2018 01:58
React app breaks on refresh NGINX
# update the location blocks try_files in your /sites-available/default
location / {
try_files $uri $uri/ /index.html$is_args$args;
}
@ncole458
ncole458 / cli.txt
Last active May 19, 2018 11:30
WordPress FTP permissions on VPS/EC2 etc
# allow WP to FTP/access core/plugin folders
sudo chown -R www-data /var/www/html
# always set back when done
sudo chown -R sammy /var/www/html
# restart PHP on Ubuntu
sudo service php7.0-fpm restart
@ncole458
ncole458 / remote-my-sql-ec2-etc.txt
Created June 4, 2018 01:39
Grant remote access to MySQL database
# UPDATE AWS EC2 SECURITY GROUPS FIRST TO ALLOW MySQL CONNECTION VIA IP
---
# Edit /etc/mysql/my.cnf, and change the binding address to 0.0.0.0
bind-address = 0.0.0.0
# then restart mysql server
$ sudo /etc/init.d/mysql restart
@ncole458
ncole458 / ssl.txt
Last active September 15, 2018 00:29
TLS/SSL Certificate Generation & Installation
# create the cert key request
openssl req -newkey rsa:2048 -nodes -keyout domain.com.key -out domain.com.csr
# concat the bundle and certs
cat domain_com.crt domain_com.ca-bundle > website-bundle.crt
# SSL checker for after install
https://www.sslshopper.com/ssl-checker.html