Skip to content

Instantly share code, notes, and snippets.

mkdir ~/git/website.git && ~/git/cd website.git
git init --bare
mkdir ~/webapps/website
git config core.bare false
git config core.worktree /home/rafi/webapps/website ; NO TRAILING SLASH!!! Will screw up things real bad.
git config receive.denycurrentbranch ignore
; create a hook
cat > hooks/post-receive
#!/bin/sh
-- Запросы по сбору статистики PostgreSql 9.3.x
-- Процессы которые висят более 20 секунд
select * from pg_stat_activity where state != 'idle' and current_timestamp - query_start > '20 sec';
-- К-во update-тов за время с последнего сброса статистики
SELECT relname, n_tup_ins + n_tup_upd + n_tup_del from pg_stat_user_tables order by 2 desc limit 5;
-- Сброс статистики
SELECT pg_stat_reset();
@Dezinger
Dezinger / composer_gzip_test.php
Last active December 12, 2016 08:31 — forked from radutopala/composer_gzip_test.php
Composer GZIP decoding test
<?php
$retries = 0;
function fetch() {
global $retries;
echo "Retry " . $retries . " | ";
$opts = array(
@Dezinger
Dezinger / chef-noatime-and-swap.rb
Created November 25, 2019 09:35 — forked from priestjim/chef-noatime-and-swap.rb
A quick (hacky) Chef recipe for adding noatime and a swap file in case a swap file does not exist
# Enable noatime on local ext3/4 & xfs filesystems
fstab = File.open('/etc/fstab',"r")
newlines = Array.new
needremount = Array.new
ihaveswap = false
fstab.each do |line|
# Tokenize each fstab line with a space separator
tokens = line.split
if tokens[2] == "swap"