Skip to content

Instantly share code, notes, and snippets.

View Rpsl's full-sized avatar
😶‍🌫️
i miss coding

Виктор Диктор Rpsl

😶‍🌫️
i miss coding
View GitHub Profile
@cyberdelia
cyberdelia / fabfile.py
Created April 3, 2010 14:05
Fabric deploy script with : south migrations, rollback and maintenance page.
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }
@KartikTalwar
KartikTalwar / Documentation.md
Last active September 24, 2024 20:03
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@JFK
JFK / gist:4591707
Last active September 16, 2019 21:10
Ngnix + Nginx-GridFS-Replicaset(mongodb) + nginx-image-filter +nginx-proxy-cache Sample Configuration
user www-data;
#worker_processes 4;
#worker_priority 0;
#worker_cpu_affinity 0001 0010 0100 1000;
#worker_rlimit_nofile 163840;
#worker_processes 8;
#worker_priority 0;
#worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
@ranzhe
ranzhe / auto-backup-ftp.rsc
Last active July 27, 2021 22:54
Automatic FTP backup script for Mikrotik RouterOS
:local saveUserDB true
:local saveSysBackup true
:local encryptSysBackup false
:local saveRawExport true
:local FTPServer "ftpserver.tld"
:local FTPPort 21
:local FTPUser "my-mikrotik"
:local FTPPass "SecurePassword"
@mandiwise
mandiwise / Update remote repo
Last active October 23, 2024 07:20
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
crontab -e
*/5 * * * * /usr/bin/sudo -H /home/pi/my-scripts/checkwifi.sh >> /dev/null 2>&1

Установка дистрибутива на SD

Raspberry PI SD Installer OS X — простой консольный скрипт для записи любых .img или .iso образов на SD флешки. Использование на OSX или Linux:

sudo ./install ~/Downloads/raspbian.img

Нахождение Raspberry Pi в сети

Подключили ethernet кабель, вставили флешку с Raspbian и запустили, но нет лишнего HDMI монитора и клавиатуры? Выход есть и это — Adafruit Raspberry Pi Finder. Использование на OSX или Linux:

@night-codes
night-codes / golangDeploy.md
Last active March 3, 2024 03:55
Golang deploy

1) Создаем юзера под которым будет работать приложение, задаем пароль и переключаемся на него:

useradd -s /bin/bash <имя_пользователя>
passwd <имя_пользователя>
su <имя_пользователя>

2) Генерируем новый ключ для деплоя

ssh-keygen -t rsa -C "<имя_пользователя>@<домен_сервиса>"
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@jgrodziski
jgrodziski / docker-aliases.sh
Last active November 9, 2024 17:50
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #