#Read me
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
root@cloud-monitor-1:/etc/shinken# cat /usr/lib/nagios/plugins/notify_by_xmpp.py | |
#!/usr/bin/python -tt | |
# [email protected], modified by David Laval | |
# gplv2+ | |
## XMPP notification | |
#define command{ | |
# command_name notify-host-by-xmpp | |
# command_line $PLUGINSDIR$/notify_by_xmpp.py -a $PLUGINSDIR$/notify_by_xmpp.ini "Host '$HOSTALIAS$' is $HOSTSTATE$ - Info : $HOSTOUTPUT$" $CONTACTEMAIL$ | |
#} |
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
def tail_F(filename): | |
p = 0 | |
with open(filename, 'r') as f: | |
while True: | |
f.seek(p) | |
new_line = f.read() | |
p = f.tell() | |
if new_line: | |
print new_line | |
print str(p).center(10).center(80, '=') |
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 os | |
import time | |
import psutil | |
cpu_time = psutil.cpu_times(True) | |
cpu_count = len(cpu_time) | |
a = {"cpu":[]} | |
a['cpu']['count'] = cpu_count |
- Dự kiến đầu tháng 10 - 2015
- Ngõ 120 Trường Chinh, Hà Nội.
- Page: https://www.facebook.com/pyfml
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
1. requirement: setup squid proxy server using docker. | |
2. The problem: cannot configure cache_dir for squid. | |
3. More detail: | |
- I tried some docker image to setup squid: | |
https://hub.docker.com/r/babim/squid/ (babin/squid:auth) | |
https://hub.docker.com/r/scbunn/squid/ (scbunn/squid:3.5.17) | |
all of them work fine when I DON'T CONFIGURE CACHE_DIR for squid. | |
but when I configure CACHE_DIR, the squid process was killed immediately after starting. |
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
\dt | |
\l | |
\connect database_name | |
\select * from database_name |
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
If the -e option is supplied, the return value is the value of the last command executed or failure if an error occurs with the temporary file of commands |
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
1. sử dụng curl: Curl https://xxx | |
2. openssl s_client -connect www.google.com:443 |
OlderNewer