Skip to content

Instantly share code, notes, and snippets.

View dgleba's full-sized avatar
😁
.

dgleba dgleba

😁
.
View GitHub Profile
@dgleba
dgleba / nextcloud-caddy-docker.md
Created January 22, 2023 01:06 — forked from tmo1/nextcloud-caddy-docker.md
Nextcloud behind Caddy as a reverse proxy, using Docker

Introduction

This is a guide to deploying Nextcloud behind a Caddy reverse proxy, both running in Docker containers (an official Nextcloud one and a caddy-docker-proxy one), with the goal of implementing as much as possible via docker-compose files. This is much more difficult than it should be, for a variety of reasons:

  • As with Docker versions of software in general, documentation of the software does not always apply to the Docker versions, and the Docker documentation does not always include the Docker equivalent ways of doing things.

  • Docker images do not always expose the desired configuration knobs of the underlying software.

  • Nextcloud requires special configuration to run correctly behind a reverse proxy (and again, some of the instructions for this configuration requires modification for

// ==UserScript==
// @name gheil Google Bookmarks fix
// @match https://www.google.com/bookmarks/*
// @grant none
// @require https://code.jquery.com/jquery-1.12.4.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
// ==/UserScript==
// greg heil(cc-by-sa)18/07/09
var DONE = 0;
var MAX_SUGGESTIONS=108;
@dgleba
dgleba / ubuntu-cli-install-android-sdk.sh
Created October 15, 2018 03:33 — forked from zhy0/ubuntu-cli-install-android-sdk.sh
Install Android SDK on headless Ubuntu linux machine via command line, so that you can compile open source Android apps.
#!/bin/bash
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n
# Install Oracle JDK 8
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
apt-get install -y unzip make # NDK stuff
@dgleba
dgleba / add-rsync-to-git-bash.md
Last active August 23, 2021 08:25 — forked from hisplan/add-rsync-to-git-bash.md
Add rsync to git bash for windows
@dgleba
dgleba / 01-venv-tutorial.md
Created September 25, 2018 19:13 — forked from ccaspers/01-venv-tutorial.md
Virtualenv Tutorial

Virtual Environments

A Virtual Environment is a tool to keep the dependencies required by different projects in separate places, by creating virtual Python environments for them. It solves the “Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keeps your global site-packages directory clean and manageable. - The Hitchhiker’s Guide to Python!

Virtual Environments werden also dazu genutzt um verschiedene Softwareprojekte und ihre Abhängigkeiten voneinander zu isolieren. Ein netter nebeneffekt ist, das Installation aus dem Python Package Index (pip) ohne Administratorrechte erfolgen können, weil die Pakete im Verzeichnis des Virtual Environments installiert werden.

Jedes Virtual Environment hat seine eigenen site-packages sowie pip- und python-Kommandos. Dabei wird der Interpreter nicht jedes neu installiert, sondern über Symlinks verknüpft.

Ein Virtual Environment erzeugen

@dgleba
dgleba / mysql-docker.sh
Created September 4, 2018 19:58 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@dgleba
dgleba / Makefile
Created July 26, 2018 02:58 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
1. Make folder tree like these
mi_project
├── src
│ ├── midjangoapp
│ ├── manage.py
├── config
│ ├── requirements.pip
│ ├── nginx
│ ├── midjangoapp.conf
├── Dockerfile
// ==UserScript==
// @name Google Bookmarks fix
// @match https://www.google.com/bookmarks/*
// @grant none
// @require https://code.jquery.com/jquery-1.12.4.min.js
// @require https://code.jquery.com/ui/1.12.1/jquery-ui.js
// ==/UserScript==
$(function() {
try {
@dgleba
dgleba / .dockerignore
Created June 22, 2018 11:16 — forked from davidderus/.dockerignore
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod