Skip to content

Instantly share code, notes, and snippets.

View vandorjw's full-sized avatar

Joost van Dorp vandorjw

View GitHub Profile
@vandorjw
vandorjw / Fedora 20, Uwsgi, nginx, django, python3
Last active June 23, 2020 02:23
Turn Fedora 20 into Webserver
# This is a step by step tutorial on how to run uwsgi in emperor mode,
# behind nginx on Fedora 20. I'll add to the tutorial as time goes on.
# SeLinux will likely be a pain (even in permissive mode), so please see my comment on how to fix it.
sudo yum upgrade
sudo yum install nano yum-utils gcc uwsgi-plugin-python3 nginx
yum-builddep python3-psycopg2
@vandorjw
vandorjw / Named Config
Last active September 7, 2017 15:44
named config. This is can be used to add private records to a domain.
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
@vandorjw
vandorjw / Tutorial
Last active May 27, 2016 13:52
Centos Nginx Python3.4 uWSGI Emperor
Here are steps:
1. # yum upgrade
2. $ curl -O http://fedora.mirror.nexicom.net/epel/6/i386/epel-release-6-8.noarch.rpm
3. # yum localinstall epel-release-6-8.noarch.rpm
4. $ curl -O http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
5. # yum localinstall pgdg-centos93-9.3-1.noarch.rpm
6. # yum install postgresql93-server postgresql93-contrib postgresql93-devel
7. # service postgresql-9.3 initdb
8. # service postgresql-9.3 start
@vandorjw
vandorjw / Weightronix-SCP-02-python3.4.py
Last active August 29, 2015 14:01
Weightronix SCP-02 python3.4
#!/usr/bin/env python3.4
"""
Short notes and sample code for obtaining weight from Weightronix 6250.
required software:
Linux (any distro will do)
python
pyserial 2.7+
@vandorjw
vandorjw / vassal.ini
Last active August 29, 2015 14:04
uWSGI vassal file
# Using TCP-Sockets
[uwsgi]
projectname = com_example_www
base = /srv/site/com/example/www
chdir = %(base)/src/%(projectname)
pythonpath = %(base)/src/%(projectname)
virtualenv = %(base)/venv/%(projectname)
disable-logging = true
logto = %(base)/logs/uwsgi.log
@vandorjw
vandorjw / ca_vandorjw_piwik.ini
Created December 16, 2014 19:02
uwsgi vassal for Piwik
[uwsgi]
project_dir = /srv/piwik/piwik
plugin = php
socket = /run/uwsgi-emperor/%n.sock
chmod-socket = 660
chown-socket = www-data:www-data
uid = www-data
gid = www-data
logto = /var/log/uwsgi/ca_vandorjw_piwik.log
chdir = %(project_dir)
@vandorjw
vandorjw / ca_vandorjw_piwik.conf
Created December 16, 2014 19:04
nginx server block for piwik
server {
listen 80;
server_name piwik.vandorjw.ca;
root /srv/piwik/piwik;
index index.php index.html index.htm;
access_log /var/log/nginx/ca/vandorjw/piwik/access.log;
error_log /var/log/nginx/ca/vandorjw/piwik/error.log;
<html>
<head>
<meta charset="UTF-8">
<title>Refactored TapeDeck</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
@vandorjw
vandorjw / README
Last active August 29, 2015 14:18
Deploy TeamCity CentOS7
#rough tutorial to deploy Teamcity 9 to CentOS
Maybe in the future I will create an RPM package to ease this process
##initial steps
0. install java-headless, postgresql, etc.
1. Create a system-user for teamcity
@vandorjw
vandorjw / jenikns_ci_on_ubuntu.md
Last active March 31, 2016 10:16 — forked from ostinelli/jenkins_ci_on_ubuntu.md
Setup Jenkins CI on Ubuntu.

Jenkins CI

Instructions on how to setup a secured Jenkins CI.

Install Jenkins

$ wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list$ .d/jenkins.list'
$ sudo apt-get update
$ sudo apt-get install jenkins