This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| echo "starting .dotenv.sh" | |
| dotenv_machine_uname="$(uname -s)" | |
| case "${unameOut}" in | |
| Linux*) dotenv_machine=Linux;; | |
| FreeBSD*) dotenv_machine=FreeBSD;; | |
| Darwin*) dotenv_machine=Mac;; | |
| CYGWIN*) dotenv_machine=Cygwin;; | |
| MINGW*) dotenv_machine=MinGw;; | |
| *) dotenv_machine="${dotenv_machine_uname}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" | |
| exit | |
| fi | |
| PHP_BUILD_BIN_PATH=/opt/php-7.1/bin | |
| PHP_BUILD_PATH=/opt/php-7.1 | |
| apt install -y autoconf | |
| apt-get install pkg-config libmagickwand-dev -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| #notes: enumerate user accounts | |
| - hosts: "{{ rhosts | default('everyhost') }}" | |
| tasks: | |
| - set_fact: | |
| nologin_shells: | |
| - '/bin/false' | |
| - '/usr/sbin/nologin' | |
| - '/sbin/nologin' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| # for stupids like me: overloading brackets [] (subscript) operator in C++ | |
| # run: | |
| # g++ subscript_operator_overloading.cpp && ./a.out | |
| this example works because | |
| map (or, i.e. array) supports [] as an assignment operator, so | |
| it works transparently, implicitly - | |
| you don't need translate and implement assignment | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| SAVE_BRANCHES="master|production|testing" | |
| #RU: этот скрипт удалит все локальные ветки КРОМЕ указанных в переменной SAVE_BRANCHES | |
| #RU: если запустить его БЕЗ аргументов (./git-cleanup.sh) - он спросит разрешения и выведет | |
| #RU: список удаляемых веток. C любым аргументом (./git-cleanup.sh 1) - удалит лишние ветки | |
| #EN: This script will delete all local branches EXCEPT those in SAVE_BRANCHES_VAR | |
| #EN: Running it without args will display deletion candidates and prompt you to action. | |
| #EN: Running it with any arg (./git-cleanup.sh 1) will just delete those branches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # (this script works best with --anticache) | |
| # run it like this: mitmdump -q -s ~/b/mitm/replace.py | |
| from mitmproxy import ctx, http | |
| import re | |
| DPREFIX = '[DEBUG]> ' # stupid | |
| """ | |
| Dict of url regexps with content-type matching and replacement pairs | |
| I would add regexp flags as a third element of replacement list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #overwrite with crop | |
| gm mogrify -crop 1356x694+0+0 some.png | |
| #preserver original, place output to mogrified/ dir | |
| gm mogrify -output-directory mogrified/ -crop 1356x694+0+0 some.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pin postdata as a fake upstream log format name | |
| log_format postdata '$request_body'; | |
| server { | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| root /var/www/html; | |
| # Add index.php to the list if you are using PHP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import argparse | |
| import logging | |
| APPNAME_LOCK_FILE_NAME = "PY-BOILERPLATE" | |
| def argparse_str2bool(v): | |
| """ | |
| allows handy parsing of bool args for argparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.2.0) | |
| project(Haproxy) | |
| set(CMAKE_C_STANDARD 11) | |
| find_package(OpenSSL) | |
| if(OPENSSL_FOUND) | |
| include_directories("${OPENSSL_INCLUDE_DIR}") | |
| endif(OPENSSL_FOUND) |