Skip to content

Instantly share code, notes, and snippets.

View skalibog's full-sized avatar
🇺🇦
Working from home

Edward Skalibog skalibog

🇺🇦
Working from home
View GitHub Profile
@skalibog
skalibog / release.yml
Created October 22, 2023 07:40
GA for automation gem release.
name: Release
on:
release:
types: [created]
jobs:
release:
runs-on: ubuntu-latest
steps:
@skalibog
skalibog / 1 Setup vps.md
Created July 13, 2022 10:51 — forked from deHelden/"torn" 1 Setup vps.md
Deploy Rails 6.0.0 to VPS(DigitalOcean Ubuntu 19). Nginx, Puma, Capistrano3, PostgreSQL, Rbenv.

SETUP VPS

based on DigitalOcean guide

Create local project

local$ rails new appname -T -d postgresql
local$ rails g scaffold Story title:string body:text
local$ rails db:migrate
#!/bin/bash
echo "=========================================="
echo "Set ssh id_rsa to ssh key for gotoinc git acc"
echo "=========================================="
git config --global --replace-all user.email "root@gotoinc.co"
git config --global --replace-all user.name "Anton Tkachov"
echo "------------------------------------------"
echo "User creds"
git config --global user.email
@skalibog
skalibog / sidekiq.service
Created November 18, 2020 09:39 — forked from mkhuda/sidekiq.service
Sidekiq service auto start for Ubuntu 16.04 using Systemd
#
# Sidekiq auto start using systemd unit file for Ubuntu 16.04
#
# Put this in /lib/systemd/system (Ubuntu).
# Run:
# 1. systemctl enable sidekiq (to enable sidekiq service)
# 2. systemctl {start,stop,restart} sidekiq (to start sidekiq service)
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
@skalibog
skalibog / pkey.rb
Created May 19, 2020 08:39
reset pkey
ActiveRecord::Base.connection.tables.each do |table_name|
ActiveRecord::Base.connection.reset_pk_sequence!(table_name)
end
@skalibog
skalibog / how-to-upgrade-heroku-postgresql.md
Created May 13, 2020 09:59 — forked from galileoguzman/how-to-upgrade-heroku-postgresql.md
How to upgrade a Heroku PostgreSQL database to a new plan

How to upgrade a Heroku PostgreSQL database to a new plan

I started a project on a Hobby Dev plan (free, limit 10,000 rows), and then later needed to upgrade it to Hobby Basic ($9/month, limit 10,000,000 rows).

After assigning the new database, I had two databases attached to the application. They looked something like this:

  • HEROKU_POSTGRESQL_OLIVE (postgresql-dimensional-3321) Old, free-tier (Hobby Dev) database
@skalibog
skalibog / 1.rb
Created May 11, 2020 21:48
try to get this docs
# frozen_string_literal: true
require "active_support"
require "active_support/core_ext/class/attribute_accessors"
require "active_support/core_ext/class/attribute"
require "active_support/core_ext/hash/indifferent_access"
require "active_support/core_ext/kernel/reporting"
require "active_support/core_ext/module/delegation"
require "active_support/core_ext/module/aliasing"
require "active_support/core_ext/object/blank"
@skalibog
skalibog / sample_ssh.sh
Created April 6, 2020 14:35
Script for change github access
echo "=========================================="
echo "Set ssh id_rsa(sample desc)"
echo "=========================================="
git config --global --replace-all user.email "YOURNAME@gmail.com"
git config --global --replace-all user.name "GITHUB NAME"
echo "------------------------------------------"
echo "User creds"
git config --global user.email
git config --global user.name
@skalibog
skalibog / rails.rb
Created March 2, 2020 14:25
rescue
rescue => error
Rails.logger.error(error)
Rails.logger.error(error.message)
Rails.logger.error(error.backtrace.join("\n"))
@skalibog
skalibog / db.rake
Last active November 10, 2020 11:28
custom seeds
namespace :db do namespace :seed do
Dir[Rails.root.join('db', 'seeds', '*.rb')].each do |filename|
task_name = File.basename(filename, '.rb')
desc "Seed #{task_name}, based on the file with the same name in `db/seeds/*.rb`"
task task_name.to_sym => :environment do
load(filename) if File.exist?(filename)
end
end
end
end