Skip to content

Instantly share code, notes, and snippets.


Yury Koleda FUT

  • Rubyroid Labs
  • Minsk, Belarus
View GitHub Profile
Created Mar 20, 2017
SystemD timers
View README.txt
sudo systemctl daemon-reload
sudo systemctl enable exporter.timer
sudo systemctl status exporter.timer
sudo systemctl list-timers --all
sudo systemctl list-timers
sudo systemctl start exporter.service
sudo systemctl start exporter.timer
Last active Apr 1, 2016
Server startup

Remote server

  sudo apt-get install monit

Unomment several lines in monitrc config:

  sudo vim /etc/monit/monitrc
Created Mar 31, 2016
Send email on boot (Ubuntu)
sudo apt-get install mailutils
crontab -e
# And paste following line to crontab settings:
@reboot echo "Server has restarted "`hostname` | mail -s "System Restart"
FUT / main_config.rb
Last active Mar 28, 2016
Backup PSQL and S3
View main_config.rb
Logger.configure do
syslog.ident = File.dirname(__FILE__) + "/../../log/radium_backup"
FUT / app.conf
Created Mar 16, 2016
Rails + Angular/Ember/React on the same server
View app.conf
# Define your upstream cluster
upstream rails {
server fail_timeout=0;
server {
listen 80;
FUT / api.rb
Created Aug 30, 2015
Log params and request time for grape
View api.rb
require 'grape'
class API < Grape::API
before do
@log_start_t = " Parameters: #{params.to_hash.except("route_info")}"
after do
@log_end_t =
FUT / gist:0ebefa5e95a462c0749b
Created May 9, 2015
Convert images from CR2 to JPG in parallel
View gist:0ebefa5e95a462c0749b
ls *.CR2 | parallel --will-cite --bar --jobs 8 ufraw-batch --out-type jpg --out-path jpg/ --overwrite
Created Nov 24, 2014
Git config for a project
# This file applies all the git configs and hooks related to current repository
# Run it from Rails.root directory this way:
# ./dev/git/
cp -v dev/git/pre-commit .git/hooks/pre-commit
cp -v dev/git/config .git/config
FUT / header_checks
Created Nov 14, 2014
Postfix email to Rails
View header_checks
# File: /etc/postfix/header_checks
# Add to the bottom of the file
/To:.**/ FILTER send_to_my_app:
Last active Jul 11, 2021
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here