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
public class ConfigurationLoader { | |
private final ObjectMapper objectMapper; | |
private final StringSubstitutor stringSubstitutor; | |
ConfigurationLoader() { | |
this.objectMapper = new ObjectMapper(new YAMLFactory()); | |
this.stringSubstitutor = | |
new StringSubstitutor(StringLookupFactory.INSTANCE.environmentVariableStringLookup()); | |
} |
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/bash | |
# | |
# Find all processes that are executing a futex(2) call with op=FUTEX_WAIT | |
# In some cases this can be helpful in finding deadlock-ed processes. | |
# | |
test ! $UID -eq 0 && echo -e "WARNING: Not running as root, only processes for this user are being scanned\n" >&2; | |
pids=$(ps -u $UID -opid --no-headers) | |
for pid in $pids; do |
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
[mysqld] | |
open-files-limit = 24000 | |
character-set-server = utf8 | |
character-set-filesystem = utf8 | |
# | |
# InnoDB | |
# | |
# After applying these for the first time on a new mysql installation with no |
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/bash | |
# | |
# Tells you the average size of your Apache processes | |
# It must run on a live apache server (unless you know what you are doing). | |
# It requires pmap, /proc, ps, grep, awk, sed and bc, | |
# | |
# Written by: Amr Mostafa" <amr.mostafa@egyptdc.com> | |
# | |
# Courtesy of Egypt Development Centre (c). |
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 createTempDir(tmpName: String): String = { | |
val tmpDir = Paths.get(System.getProperty("java.io.tmpdir")) | |
val name: Path = tmpDir.getFileSystem.getPath(tmpName) | |
if (name.getParent != null) throw new IllegalArgumentException("Invalid prefix or suffix") | |
tmpDir.resolve(name).toString | |
} |
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 com.fasterxml.jackson.core.JsonPointer; | |
import javax.validation.ElementKind; | |
import javax.validation.Path; | |
import javax.validation.Path.Node; | |
import java.util.stream.Stream; | |
import java.util.stream.StreamSupport; | |
/** | |
* This has not been extensively tested. It's just a starting point. Please improve! |
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
/* | |
* This a modified version based on code by MoPub Inc. | |
* The author's modifications are released into the public domain. MoPub .inc code | |
* is originally released under the license below. | |
* | |
* Copyright (c) 2010-2013, MoPub Inc. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are |
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/env python | |
def is_comment(line): | |
return line.startswith('<!--') | |
def is_empty(line): | |
return len(line) == 0 | |
if __name__ == '__main__': | |
f = open('/tmp/definitions.txt', 'r') |
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
<?php | |
/** | |
* @file | |
* Retrieves various load indicators from servers using SNMP. | |
* | |
* Licensed under GPL v3 or later. | |
* Copyright 2009 (c) Egypt Development Center. | |
*/ | |
/** |
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/bash | |
SLEEP=1 | |
THRESHOLD=500 | |
while [ 1 ] | |
do | |
threads=`mysqladmin stat | awk '{ print $4 }'` | |
echo "Active threads: $threads" | |
if [ $threads -gt $THRESHOLD ]; then | |
log="/root/mysql-monitor/logs/sqls-$threads-`date +%s`.log" |
NewerOlder