Skip to content

Instantly share code, notes, and snippets.

View izznogooood's full-sized avatar

Anders izznogooood

  • Securitas Technology
  • Norway
View GitHub Profile
@izznogooood
izznogooood / UbuntuPostInstall.md
Last active March 4, 2020 17:38 — forked from popey/UbuntuPostInstall.md
Steps done Post-Install

Post Installation Stuff on Idea (home Desktop)

Snaps I installed

@izznogooood
izznogooood / docker.md
Last active November 7, 2019 16:35
Django Deployment

Production

Relative path Django project dir.

Dockerfile (Django app)

FROM python:3.7.4-alpine3.9

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
@izznogooood
izznogooood / django_fetchJS.md
Last active May 21, 2023 20:03
Using JavaScript fetch to send forms to django

The Idea

Using Django to handle login / authentication / db / email etc. Then creating "normal" endpoints for JS/JSframeworks to manipulate/get data from django Models. This means you will need to be logged inn through the Django backend.

The application can be found here.

JavaScript: A function to get the CSRF token

function getCookie(name) {
@izznogooood
izznogooood / micro_devops.md
Last active March 6, 2019 13:18
GitHub Micro CICD Script

Rapid development and not ment for any sort of production

(Or over time...)

Put microcicd.py & redeploy.sh in your git project. Run git config credential.helper store as the (systemd) user that will run the script. Edit the files with user/repo info and move them in to possision. Enable --now microcicd.service and update your master brach.

Disclaimer, security or tests have not been considered here, I needed something fast and dirty. Webhooks is the prefered method. As well as tokens for AUTH.

@izznogooood
izznogooood / systemd_docker.md
Last active April 9, 2022 16:32
How to use systemd as a docker manager. Nextcloud example with backup.

I have always found systemd to be a reliable manager for my docker containers, here is a few examples that should be enough to get the general idea.

I thought a symbiotic example would be best as that's about as complicated as it gets.

Some basic systemd usage skills like how to use systemctl and deamon-reload are expeted. (Remember NOT! to deamonize the containers! -d --deamonize in the docker command.)

MariaDB