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
#add the ip address to the pre login screen by editing rc.local | |
/sbin/ifconfig | grep "inet addr" | grep -v "127.0.0.1" | awk '{ print $2 }' | awk -F: '{ print "ip address " $2 }' > /$}' > /etc/issue |
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
function sendSlackMessage($text, $username = "PHP Error Bot", $channel = "#general") | |
{ | |
$url = "https://hooks.slack.com/services/your-token-here"; | |
$payload = array(); | |
$payload["username"] = $username; // you can customise this | |
$payload["channel"] = $channel; | |
$payload["text"] = $text; | |
// set up & post curl | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); |
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
<script type="text/javascript"> | |
if (!window.console) console = {log: function() {}}; | |
</script> |
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
private static void sendSlackMessage(String message) | |
{ | |
String url = "https://hooks.slack.com/services/your-token-here"; | |
HttpClient client = new HttpClient(); | |
PostMethod post = new PostMethod(url); | |
JSONObject json = new JSONObject(); | |
try { | |
json.put("channel", "#general"); | |
json.put("text", message); | |
json.put("username", "#java-error-bot"); |
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 | |
date_default_timezone_set('Europe/London'); | |
function sendmail($site,$contacts,$name,$date) | |
{ | |
$to = $contacts; | |
$subject = 'Alert ' . $site . ' appears to be down - ' . $name; | |
$message = $site . ' is down, please check now ' .$date; | |
$headers = 'From: [email protected] (Depicus Site Monitor)' . "\r\n" . |
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 | |
$email = md5(strtolower("[email protected]")); | |
$gravatar = "http://www.gravatar.com/avatar/$email?d=404&s=50"; | |
$headers = get_headers($gravatar,1); | |
if (strpos($headers[0],'200')) echo "<img src='$gravatar' style='border-radius: 25px;'>"; // OK | |
else if (strpos($headers[0],'404')) echo "No Gravatar"; // Not found we could show a default image here | |
?> |
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
# The primary network interface | |
auto eth0 | |
iface eth0 inet static | |
address 10.11.11.33 | |
netmask 255.255.0.0 | |
gateway 10.11.2.6 | |
dns-nameservers 10.11.1.24 8.8.8.8 |
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
sudo iptables -F | |
sudo iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT | |
sudo iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT | |
sudo iptables -A INPUT -i eth0 -j DROP | |
sudo apt-get install iptables-persistent -y | |
sudo dpkg-reconfigure iptables-persistent |
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
try { | |
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); | |
JoranConfigurator jc = new JoranConfigurator(); | |
jc.setContext(context); | |
context.reset(); | |
context.putProperty("WorkStationID", dateWeAreSendingFor); | |
ClassLoader loader = main.class.getClassLoader(); | |
jc.doConfigure(loader.getResource("logback.xml")); | |
} catch (JoranException ex) { | |
logger.error("init logging failed", ex); |
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
@charset "UTF-8"; | |
.icon-note.icon-left a:before, .icon-note.icon-right a:after { content: "\266a"; height: inherit; } | |
i.icon-note:before { content: "\266a"; height: inherit; } | |
.icon-note-beamed.icon-left a:before, .icon-note-beamed.icon-right a:after { content: "\266b"; height: inherit; } | |
i.icon-note-beamed:before { content: "\266b"; height: inherit; } |
OlderNewer