Skip to content

Instantly share code, notes, and snippets.

View Azmandius21's full-sized avatar
🔆
i am ready for growing

Aziz Azmandius21

🔆
i am ready for growing
View GitHub Profile
# Test gist for my application
class Link
GIST_URL = Regexp.new 'https://gist.github.com'
def gist?
self.url.match?(GIST_URL)
end
end
@Azmandius21
Azmandius21 / spec_gist
Created June 13, 2023 04:12
Gist for test
Gist content
@Azmandius21
Azmandius21 / Monit_config
Last active February 9, 2024 19:32
Config file for Monit service
### Nginx ###
check process nginx with pidfile /run/nginx.pid
start program = "/usr/bin/systemctl start nginx.service"
stop program = "/usr/bin/systemctl stop nginx.service"
if cpu > 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if memory usage > 80% for 5 cycles then restart
if failed host 79.174.95.43 port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout
@Azmandius21
Azmandius21 / Ubuntu cheatsheet
Last active October 26, 2024 11:27
cheatsheet about cli commands
whoami = show user name
pwd
sudo systemctl restart postgresql = restart postgresql
htop = process manager
sudo lsof -i:6379 = to check witch process is listening port 6379
@Azmandius21
Azmandius21 / Rails.md
Last active October 19, 2024 18:04
Helpful rails practice

Rails

EDITOR=nano rails credentials:edit
'rails c =>'
:Rails.application.credentials.SECRET_KEY =
:Rails.application.credentials['SECRET_KEY'] =
:Rails.application.credentials.fetch('SECRET_KEY'.to_sym)
In file.yaml:
<%= Rails.application.credentials['SECRET_KEY'] %>
@Azmandius21
Azmandius21 / postgres.md
Created October 22, 2024 05:24
Postgresql

=> \dp mytable Access privileges Schema | Name | Type | Access privileges | Column access privileges --------+---------+-------+-----------------------+-------------------------- public | mytable | table | miriam=arwdDxt/miriam | col1: : =r/miriam : miriam_rw=rw/miriam : admin=arw/miriam
(1 row) Записи, выводимые командой \dp, интерпретируются так: