Skip to content

Instantly share code, notes, and snippets.

@DrOctogon
DrOctogon / docker-compose.yml
Created September 5, 2023 20:31 — forked from joekrill/docker-compose.yml
Linkwarden Docker Compose
version: "3.9"
volumes:
postgres:
services:
postgres:
image: postgres
restart: unless-stopped
healthcheck:
@DrOctogon
DrOctogon / index.html
Created December 13, 2019 06:48
Text Animation: Montserrat
<svg viewBox="0 0 960 300">
<symbol id="s-text">
<text text-anchor="middle" x="50%" y="80%">Montserrat</text>
</symbol>
<g class = "g-ants">
<use xlink:href="#s-text" class="text-copy"></use>
<use xlink:href="#s-text" class="text-copy"></use>
<use xlink:href="#s-text" class="text-copy"></use>
<use xlink:href="#s-text" class="text-copy"></use>
@DrOctogon
DrOctogon / beerslider-use-with-jquery-and-various-start-parameters.markdown
Created March 1, 2019 19:09
BeerSlider - use with jQuery and various start parameters
@DrOctogon
DrOctogon / nginx-uwsgi-web2py-precise
Created October 1, 2015 18:28
bash script setup for nginx-uwsgi-web2py-precise
#!/bin/bash
echo 'setup-web2py-nginx-uwsgi-ubuntu-precise.sh'
echo 'Requires Ubuntu > 12.04 and installs Nginx + uWSGI + Web2py'
# Check if user has root privileges
if [[ $EUID -ne 0 ]]; then
echo "You must run the script as root or using sudo"
exit 1
fi
# Get Web2py Admin Password
echo -e "Web2py Admin Password: \c "
@DrOctogon
DrOctogon / create_model_instances.py
Created April 15, 2015 17:10
create_model_instances management command This management command is run like this: ./manage.py -a someapp filename.cfg it looks in someapp's directory for a file called /config/filename.cfg with the format explained in the help text, and creates the model instances described in the config file. It uses the configobj module. this would be an exa…
from optparse import make_option
import os
from django.core.management import BaseCommand
import configobj
from django.db.models import get_app, get_model
class Command(BaseCommand):
"""
Creates django models from config files
"""
# Jekyll Quick Reference (Cheat Sheet)
## Table of Contents
- [Jekyll Commands](#jekyll-commands)
- [Octopress Commands](#octopress-commands)
- [Folder Structure](#folder-structure)
- [Global Variables](#global-variables)
- [Site Variables](#site-variables)
- [Page Variable](#page-variables)
@DrOctogon
DrOctogon / bs2tobs3.py
Created January 9, 2015 19:07
Bootstrap2 > Bootstrap3 Migration
import os
import re
import argparse
app_path = os.path.split(os.path.split(__file__)[0])[0]
PROJECT_ROOT = os.path.abspath(app_path)
regexps = [
(r'class=(["\'] *?)row-fluid(.*?["\']+)', r'class=\1row\2'),
(r'class=(["\'] *?)brand(.*?["\']+)', r'class=\1navbar-brand\2'),
import os
def split(filehandler, delimiter=',', row_limit=10000,
output_name_template='output_%s.csv', output_path='.', keep_headers=True):
"""
Splits a CSV file into multiple pieces.
A quick bastardization of the Python CSV library.
Arguments:
@DrOctogon
DrOctogon / README.md
Last active August 29, 2015 14:08 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start