Skip to content

Instantly share code, notes, and snippets.

View dgleba's full-sized avatar
😁
.

dgleba dgleba

😁
.
View GitHub Profile
@dgleba
dgleba / git-download.sh
Last active October 4, 2018 17:13
Download a folder from a github repo.
#! /bin/bash
#
# from: wget https://raw.githubusercontent.com/ojbc/docker/master/java8-karaf3/files/git-download.sh
# modified by David Gleba 2018-10-04
# rev-7
#
#set -x
if [ $# -ne 1 ]; then
@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 {
// ==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
@dgleba
dgleba / app.DockerFile
Created June 22, 2018 03:29 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran: