This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$retries = 0; | |
function fetch() { | |
global $retries; | |
echo "Retry " . $retries . " | "; | |
$opts = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Запросы по сбору статистики 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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |