Skip to content

Instantly share code, notes, and snippets.

View vsilent's full-sized avatar
🎯
Building community around try.direct , docker-compose deployments.

Vasili Pascal vsilent

🎯
Building community around try.direct , docker-compose deployments.
View GitHub Profile
@iepathos
iepathos / Flask-Mega-Tutorial-manager.py
Created September 23, 2013 23:09
Manager script I created after running through Miguel Grinberg's excellent Flask Mega-Tutorial which starts at: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world - I used the Flask-Script extension to create a manager.py script where I organized the translation and database management scripts from the tutorial as com…
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask.ext.script import Manager, Command, Option
from app import app, db
import os
import imp
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
@plentz
plentz / nginx.conf
Last active May 3, 2025 05:27
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
/*
ESPTest for ZMTP + ZRE + ZOCP
Original author: Ronald Hof <[email protected]>
license: MPLv2
*/
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <string.h>
@ahromis
ahromis / docker-compose.yml
Last active January 21, 2025 12:39
Gogs docker-compose.yml
version: '2'
services:
postgres:
image: postgres:9.5
restart: always
environment:
- "POSTGRES_USER=${POSTGRES_USER}"
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- "POSTGRES_DB=gogs"
volumes:
@darrylhebbes
darrylhebbes / Ctrlp-rg.vim
Created September 18, 2017 08:31
Using ripgrep with VIM CtrlP plugin
" If on Mac run:
" brew install ripgrep
" Install CtrlP of course
" Plug 'ctrlpvim/ctrlp.vim'
if executable('rg')
set grepprg=rg\ --color=never
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
let g:ctrlp_use_caching = 0
else

Install Zsh and Oh-my-zsh on CentOS 7

Based on this article

ALL INSTALLATIONS ASSUME YES WHEN PROMPTED, that's what -y does

This script can be copy paste to ssh as is. No hands installation. :-)

yum install zsh -y
@Szymongib
Szymongib / warp_log_headers.rs
Created September 19, 2020 07:30
Filter to log request headers using Warp framework
// [dependencies]
// tokio = { version = "0.2", features = ["macros"] }
// warp = "0.2.2"
use warp::Filter;
use warp::http::HeaderMap;
use std::convert::Infallible;
#[tokio::main]
async fn main() {
@reytech-dev
reytech-dev / Fix.md
Last active March 20, 2024 10:19
ZONE_CONFLICT: 'docker0' already bound to a zone
  1. Check if docker zone exists in firewall-cmd
$ firewall-cmd --get-active-zones
  1. If "docker" zone is available, change interface to docker0 (not persisted)
$ sudo firewall-cmd --zone=docker --change-interface=docker0
  1. If "docker" zone is available, change interface to docker0 (persisted, thanks rbjorklin)
@veber-alex
veber-alex / py_result.py
Created May 15, 2021 20:06
Python Result type simulating Rust's Result enum.
from typing import Generic, Optional, TypeVar
from abc import ABC, abstractmethod
from dataclasses import dataclass
T = TypeVar('T')
E = TypeVar('E')
class Result(Generic[T, E], ABC):
@abstractmethod