Skip to content

Instantly share code, notes, and snippets.

View b4oshany's full-sized avatar

Oshane Bailey b4oshany

View GitHub Profile
@b4oshany
b4oshany / mailchimp-template.html
Created January 20, 2019 19:12
MailChimp HTML Template for Newsletter
<style type="text/css">
[class*="card"] {
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.2);
transition: 0.3s;
margin-bottom: 20px;
}
[class*="card"]:hover {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
@b4oshany
b4oshany / install-python.sh
Last active January 20, 2019 22:44
Installing python 2.7 or above
# First, install some dependencies:
sudo apt-get install build-essential checkinstall -y
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
# Then download using the following command:
version=$1
if [ -z "$1" ]
then
version=2.7.14
fi
@b4oshany
b4oshany / package-release.sh
Created January 20, 2019 22:55
Deploy Python package to PyPi
#!/bin/bash
rm dist/*
python setup.py sdist bdist_wheel
twine upload dist/*
@b4oshany
b4oshany / install-plone-dependencies.py
Last active April 16, 2019 12:59
Plone dependencies
curl -s https://gist.githubusercontent.com/b4oshany/ed5cbd74a6ae19571b3d1ca3e4e13e69/raw/777c678360a37db505f974071413f28b9bec60b0/install-python2.7-apt.sh | bash
sudo apt-get update -y
sudo apt-get install python-pip -y
sudo pip install virtualenv
sudo apt-get install python-pil -y
sudo apt install python2.7 python2.7-dev python-setuptools python-dev build-essential libssl-dev libxml2-dev libxslt1-dev libbz2-dev libjpeg62-dev -y
sudo apt install libreadline-dev wv poppler-utils -y
sudo pip install bcrypt
sudo apt-get install libffi-dev -y
sudo apt-get install libpcre3-dev -y
@b4oshany
b4oshany / plonedocviewer.sh
Created May 18, 2019 23:46
Document Viewer Installation script
sudo apt-get install -y pdftk
sudo apt-get install -y graphicsmagick
sudo apt-get install -y poppler-utils
sudo apt-get install -y poppler-data
sudo apt-get install -y ghostscript
sudo apt-get install -y tesseract-ocr
@b4oshany
b4oshany / plone-link-widget.py
Created May 29, 2019 16:45
Plone Link Widget
@b4oshany
b4oshany / fix-docker-login.sh
Created August 24, 2019 07:19
Fix docker login fails on a server with no X11 installed
sudo apt install gnupg2 pass -y
gpg2 --full-generate-key
pass init "whatever key id you have"
@b4oshany
b4oshany / export-content.py
Created January 7, 2020 10:26
Plone Exporter
import argparse
import base64
import errno
import logging
import time
import os
import re
from datetime import datetime
from fnmatch import fnmatch
from StringIO import StringIO
@b4oshany
b4oshany / kotti_self_join.py
Created March 24, 2020 20:38
Kotti self join
from kotti.resources import Content
from sqlalchemy.orm import aliased
parent_table = aliased(Content)
# Perform a self join with a where query, which adds the
# following line::
# left join contents as n on contents.id = n.id
@b4oshany
b4oshany / docker-compose.yml
Created March 27, 2020 11:36
RabbitMQ + other app
version: '3.7'
services:
# App service
app:
build: .
restart: always
container_name: app
volumes: