Skip to content

Instantly share code, notes, and snippets.

View besnik's full-sized avatar

Slavomir Hudak besnik

  • Bratislava, Slovakia
View GitHub Profile
@JamesCullum
JamesCullum / untag-old-gitlab-images.py
Last active March 18, 2024 15:37
Gitlab doesn't have a functionality to automatically untag old images (https://gitlab.com/gitlab-org/gitlab-ce/issues/25322). You can use this script to do that for you using the API from any host with HTTP connection (doesn't require access to the server via SSH). Please be aware that you will need a separate cronjob to purge all untagged images.
#!/usr/bin/env python3
'''
DEVELOPMENT SPONSORED BY
PANASONIC INFORMATION SYSTEMS COMPANY EUROPE
Interested in a job? Apply below:
https://application.job.panasonic.eu/data/ruP0pHQvHrGZJKvL/rc.php?nav=jobsearch&custval12=ite&lang=EN&custval11=PBSEU_GER
'''
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@noonat
noonat / coreos-virtualbox.md
Last active February 10, 2023 22:00
Installing CoreOS on VirtualBox
  • Download and install VirtualBox.
  • Download the CoreOS ISO
  • Create a new VM in VirtualBox
    • For the OS, Other Linux, 64-bit should be fine
    • Give the VM 1gb of memory, like your physical hardware has.
    • Create a disk of whatever size you want. I made a VMDK file that could expand dynamically up to 8gb.
  • Mount the ISO in the VM
    • Right click on the VM and click settings
  • Go to the storage tab
@willwade
willwade / Vhostman-nginx.bash
Last active September 5, 2019 06:35
VhostMan-Nginx. A small script (and other bits) for creating virtual hosts with Nginx. Use as you wish. Download all the components - put in your path somewhere and run with vhostman-nginx.sh create domain.com app name. It doesn't need the gunicorn_start file if you don't need that.
#!/bin/bash
### Set default parameters
# somewhat follows the conventions from: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
# designed to run on a debian symbiosis box if your interested why its /srv
action=$1
domain=$2
appname=$3
owner=$(who am i | awk '{print $1}')
sitesEnable='/etc/nginx/sites-enabled/'
sitesAvailable='/etc/nginx/sites-available/'
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name