-
Clone the Riemann Git repository (clones into directory
riemann
):
$ git clone https://github.com/aphyr/riemann.git
-
Checkout the last stable version (0.2.2 in our case):
$ cd riemann
$ git checkout tags/0.2.2
-
Add Carmine dependency to
riemann/project.clj
:
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
apt-get install python-dev | |
apt-get install libmysqlclient-dev # libmariadbclient-dev | |
pip install MySQL-python |
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
import datetime | |
import calendar | |
def get_month_day_range(date): | |
""" | |
For a date 'date' returns the start and end date for the month of 'date'. | |
Month with 31 days: | |
>>> date = datetime.date(2011, 7, 27) | |
>>> get_month_day_range(date) |
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
-- MySQL: Check table size, index size, number of rows and total size | |
-- (c)http://blog.kuroichiaki.com/2011/07/mysql-check-table-size-index-size-number-of-rows-and-total-size/ | |
-- (c)https://www.percona.com/blog/2008/03/17/researching-your-mysql-table-sizes/ | |
-- Top 20 tables | |
SELECT CONCAT(table_schema,'.',table_name) tables, | |
CONCAT(ROUND(table_rows/1000000,2),'M') rows_cnt, | |
CONCAT(ROUND(data_length/(1024*1024*1024),2),'G') data_size, | |
CONCAT(ROUND(index_length/(1024*1024*1024),2),'G') index_size, |
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
CREATE TABLE new_foo LIKE foo; | |
ALTER TABLE new_foo AUTO_INCREMENT = 1; | |
RENAME TABLE foo TO old_foo, new_foo TO foo; | |
DROP TABLE old_foo; |
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
-A FORWARD -m string --string "BitTorrent" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "BitTorrent protocol" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "peer_id=" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string ".torrent" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "announce.php?passkey=" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "torrent" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "announce" --algo bm --to 65535 -j DROP | |
-A FORWARD -m string --string "info_hash" --algo bm --to 65535 -j DROP |
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
#!/bin/sh | |
SOUNDS_DIR="/usr/share/asterisk/sounds/ru" | |
mkdir -p ${SOUNDS_DIR} | |
wget -q --no-check-certificate https://github.com/pbxware/asterisk-sounds/tarball/master -O- \ | |
| tar xzv --strip-components 1 -C ${SOUNDS_DIR} | |
wget -q --no-check-certificate https://github.com/pbxware/asterisk-sounds-additional/tarball/master -O- \ | |
| tar xzv --strip-components 1 -C ${SOUNDS_DIR} |
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 /var/log/journal | |
chgrp systemd-journal /var/log/journal | |
chmod 2755 /var/log/journal |
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
#!/bin/bash | |
for filename in {moh,ivr}/*.wav; do | |
sox -V "$filename" -r 8000 -c 1 -t al ${filename/.wav/.alaw/} # IVR | |
sox -V "$filename" -r 8000 -c 1 -t gsm ${filename/.wav/.gsm/} # music on hold | |
done |
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
USE asterisk; | |
GRANT ALL PRIVILEGES ON asterisk.* TO 'asterisk'@'localhost' IDENTIFIED BY 'change_me'; | |
FLUSH PRIVILEGES; | |
CREATE TABLE IF NOT EXISTS cdr ( | |
id BIGINT(20) NOT NULL AUTO_INCREMENT, | |
accountcode VARCHAR(30), | |
src VARCHAR(64), | |
dst VARCHAR(64), | |
dcontext VARCHAR(32), | |
clid VARCHAR(64), |