Skip to content

Instantly share code, notes, and snippets.

Slava Kuznetsov smith3v

Block or report user

Report or block smith3v

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
smith3v / pg_stat_activity
Created Aug 29, 2019
Query to look the current activity in PG cluster
View pg_stat_activity
select (now() - query_start), datname, pid, usename, client_addr, client_port, state, CASE WHEN char_length(query) > 244 THEN substring(query, 1, 200) || ' .. ' || substring(query FROM '.{200}$') ELSE query END AS short_query from pg_stat_activity;
smith3v /
Created May 12, 2017
HangOps_ru 12.05.17 ZFS, openresty - чаты

YouTube chat

HangOps_ru​Привет всем.

Sergey Ovsienko​хай

Sergey Ovsienko​начинайте, а то трубы горят

Vyacheslav Kuznetsov​еще собираемся

smith3v /
Last active May 2, 2017
HangOps_ru 27.04.17 DevOps VS or and ITIL - чаты


Дмитрий Малыхин 10:07 PM

me 10:28 PM ITIL только у меня вызывает ощущение дикой бюрократии?

Дмитрий Малыхин 10:28 PM нет. а ДевОпс анархия ?


Keybase proof

I hereby claim:

  • I am smith3v on github.
  • I am smith3v ( on keybase.
  • I have a public key ASBZRvQPDdicavDwykI5-A1emoRfFpDukxMrpqz-835fpAo

To claim this, I am signing this object:

smith3v / resouce-related issue with chef 11.4.4
Created Jun 22, 2013
Resource-related issue with Chef 11.4.4
View resouce-related issue with chef 11.4.4
smith3v /
Created Aug 13, 2012
Sorting a dict by property of the stored object
stats = Dict()
class Stats:
""" A class to keep some stats """
def __init__(self):
self.prop1 = 0
self.prop2 = 0
# Filling the dict with objects
smith3v / server start
Created Jun 21, 2012
A bug in knife-ec2
View server start
$ knife ec2 server create --groups sg-4e63c727
ERROR: Fog::Compute::AWS::NotFound: The security group 'sg-4e63c727' does not exist
smith3v / rename-node.rb
Created Jun 3, 2012 — forked from jtimberman/rename-node.rb
A knife exec script to change Chef node's name.
View rename-node.rb
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
# Usage: knife exec rename-node.rb old-name new-name
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
smith3v /
Created May 13, 2012
run fuse4x.kext on system start
<plist version="1.0"><dict><key>KeepAlive</key>
View gist:2317085
def run_pg_fouine():
info = host_info[env.host_string]
db_name = info.tags.get('Name')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 0/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
sudo('perl -pi -e "s/log_min_duration_statement = .*/log_min_duration_statement = 500/" /etc/postgresql/9.*/main/postgresql.conf')
sudo('/etc/init.d/postgresql reload')
run('tail -n 100000 /var/log/postgresql/postgresql-9.*-main.log > /tmp/pgfouine.txt')
run('gzip -f /tmp/pgfouine.txt')
You can’t perform that action at this time.