Архив
Postgres: получение всех CONSTRAINTS
SELECT tc.constraint_name,
tc.constraint_type,
tc.table_name,
kcu.column_name,
tc.is_deferrable,
tc.initially_deferred,
rc.match_option AS match_type,
rc.update_rule AS on_update,
rc.delete_rule AS on_delete,
ccu.table_name AS references_table,
ccu.column_name AS references_field
FROM information_schema.table_constraints tc
LEFT JOIN information_schema.key_column_usage kcu
ON tc.constraint_catalog = kcu.constraint_catalog
AND tc.constraint_schema = kcu.constraint_schema
AND tc.constraint_name = kcu.constraint_name
LEFT JOIN information_schema.referential_constraints rc
ON tc.constraint_catalog = rc.constraint_catalog
AND tc.constraint_schema = rc.constraint_schema
AND tc.constraint_name = rc.constraint_name
LEFT JOIN information_schema.constraint_column_usage ccu
ON rc.unique_constraint_catalog = ccu.constraint_catalog
AND rc.unique_constraint_schema = ccu.constraint_schema
AND rc.unique_constraint_name = ccu.constraint_name
SVN copy folder to another repository
svnadmin dump /svn/old_repos > ./repository.dump
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./docs_only.dump
svnadmin load --parent-dir dir_to_commit /svn/new_repos < ./docs_only.dump
Менеждеры пакетов для Mac OS
Mac Ports
Находится тут
Очень хорошая коллекция, есть даже pgbouncer
Brew
Первая и единственная зависимость Homebrew — OS X Developer Tools, которые есть на любом установочном диске с OS X и доступны для бесплатного скачивания с сайта Apple.
Самое простое — установить в /usr/local. Это можно сделать весьма просто:
# Присваиваем папку /usr/local себе, чтобы не использовать sudo
sudo chown -R `whoami` /usr/local
# Чиним права на mysql, если он у вас установлен
sudo chown -R mysql:mysql /usr/local/mysql
# Скачиваем и устанавливаем Homebrew с гитхаба
curl -L github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
PostgreSQL 9.0
Exclusion Constraints:
http://developer.postgresql.org/pgdocs/postgres/ddl-constraints.html#DDL-CONSTRAINTS-EXCLUSION
http://www.depesz.com/index.php/2010/01/03/waiting-for-8-5-exclusion-constraints/
Linux GRE tunnel for multicast
modprobe ip_gre
ip tunnel add netb mode gre remote 10.58.58.1 local 192.168.0.199 ttl 255
ip link set netb up
ip addr add 10.58.59.2/24 dev netb
ip route add 225.100.0.0/16 via 10.58.59.1
ip link set netb multicast on
sysctl -q net.ipv4.conf.netb.rp_filter=0
Фильтрация комментариев в конфигах
grep -vE '^[[:blank:]]*#|^$' httpd.conf