Skip to content

Instantly share code, notes, and snippets.

View perryyo's full-sized avatar

Perryyo perryyo

View GitHub Profile
@perryyo
perryyo / nginx.conf
Created November 29, 2019 09:25 — forked from hatamiarash7/nginx.conf
Force Nginx to use HTTPS
server {
listen 80;
server_name mysite.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
server {
listen 443;
...
...
@perryyo
perryyo / nginx.conf
Created November 29, 2019 09:25 — forked from hatamiarash7/nginx.conf
Nginix config for hosting multiple laravel projects in sibling folders.
server {
listen 80;
root /vagrant;
index index.html index.htm index.php app.php app_dev.php;
# Make site accessible from http://set-ip-address.xip.io
server_name 192.168.33.10.xip.io;
access_log /var/log/nginx/vagrant.com-access.log;
error_log /var/log/nginx/vagrant.com-error.log error;
@perryyo
perryyo / commands.md
Created November 29, 2019 09:23 — forked from hatamiarash7/commands.md
CentOS + Apache + Django + WSGI + CWP + Python3.6
  • yum install python36u python36u-devel python36u-mod_wsgi
  • alias python='/usr/bin/python3.6'
  • curl -O https://bootstrap.pypa.io/get-pip.py
  • python get-pip.py
  • python -m pip install django mysqlclient
  • cp /etc/httpd/modules/mod_wsgi_python3.6.so /usr/local/apache/modules
  • create/clone/move project to another location ( not /home/user/public_html ) because there is not any access to top level directories
  • config apache
  • make & config database ( project/settings.py )
  • convert charset ALTER TABLE table CONVERT TO CHARACTER SET utf8;
user nginx;
worker_rlimit_nofile 30000;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
@perryyo
perryyo / reload_db.sh
Created November 24, 2019 14:08 — forked from dhruvbaldawa/reload_db.sh
Bash script for automating some of django database cleanup
#### I am no Bash expert, I just googled and put this script together
#### Be free to fork and post updates to this gist
#### Also, you can change the username and email below for the django superuser
DEFAULT_USER="admin"
DEFAULT_EMAIL="[email protected]"
DEFAULT_PASS="pass"
function usage
{

THIS GIST WON'T BE UPDATED ANY MORE (24/10/18)

Follow the progress of this project here 3os.org Raspberry Pi 3 TOR Access Point Router Project

Network: Router RJ45 <--> Ethernet Port on Raspberry <--> TOR <--> Raspberry WIFI AC <--> WIFI CLIENT

# -- Download Rasbian Strech Lite from: https://www.raspberrypi.org/downloads/raspbian/
{
"window.zoomLevel": 1,
"workbench.colorTheme": "Ayu Mirage PowerUp",
"python.pythonPath": "/Users/admin/.pyenv/versions/368/bin/python",
"files.autoSave": "afterDelay",
"editor.wordWrap": "on",
// "editor.formatOnSave": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
@perryyo
perryyo / gist:d8a1d76390008bd7b645ee77178509fd
Last active November 12, 2022 15:26
Django Deployment to RedHat 7
@perryyo
perryyo / nginx-blacklist.conf
Created May 19, 2019 04:54 — forked from apisznasdin/nginx-blacklist.conf
This file implements a blacklist for certain user agents and referrers. It's a first line of defense. It must be included inside a http block in nginx configuration file.
### This file implements a blacklist for certain user agents and
### referrers. It's a first line of defense. It must be included
### inside a http block.
# based from https://github.com/perusio/piwik-nginx/blob/master/blacklist.conf
# blacklist from http://perishablepress.com/2013-user-agent-blacklist/
## Add here all user agents that are to be blocked.
map $http_user_agent $bad_bot {
default 0;
@perryyo
perryyo / Nginx_Cheat_Sheet.md
Created December 14, 2018 17:24 — forked from carlessanagustin/Nginx_Cheat_Sheet.md
Nginx Cheat Sheet