This file contains 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 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
#!/usr/bin/expect | |
eval spawn -noecho $argv | |
interact { | |
\177 {send "\010"} | |
"\033\[3~" {send "\177"} | |
} |
This file contains 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
Host external.example.com | |
Hostname 198.51.100.32 | |
User external_login | |
Host internal.example.com | |
Hostname 192.168.2.18 | |
User internal_login | |
ProxyCommand ssh 198.51.100.32 nc %h %p |
This file contains 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 | |
# http://christoph-polcin.com/ | |
TMP=/tmp | |
[ $# -lt 1 ] && \ | |
echo "usage: $(basename $0) input_file [output.pdf]" && \ | |
exit 1 | |
[ ! -f "$1" ] && \ |
This file contains 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
listen-address=192.168.1.254 | |
interface=eth0 | |
dhcp-range=192.168.1.1,192.168.1.253,12h | |
dhcp-option=150,192.168.1.254 # TFTP Server Address Option for DHCPv4 (RFC 5859) | |
address=/example.com/192.168.1.254 |
This file contains 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 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 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 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 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 |
OlderNewer