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 bash | |
# Prerequsites: | |
# - have kubectl installed | |
# - be logged in via kubectl | |
# - have enough permissions to access kubeadm-config Config Map | |
# - have jq installed (https://stedolan.github.io/jq/) | |
# - have yq installed (https://mikefarah.gitbook.io/yq/) | |
kubectl get configmap kubeadm-config -n kube-system -o json | \ |
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
{ | |
"USERNAME": "foo-user", | |
"PASSWORD": "somepassword123" | |
} |
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
LIST_FILENAME="input-list.txt" | |
SERVICES=$(cat ${LIST_FILENAME}) | |
NO_SERVICES=$(cat ${LIST_FILENAME} | wc -l) | |
FILES=(`find . -type f -not -path "./.git/*" -prune -not -path "./script.sh" -not -path "./${LIST_FILENAME}" | sort`) | |
NO_FILES="${#FILES[@]}" | |
FILE_NO=1 | |
echo "Processing ${NO_SERVICES} services and ${NO_FILES} files." | |
# Iterate over all files. |
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
from modules.modules import CsvRepository, FileResource | |
def read_and_write(source_file: str, f, rm_header: bool): | |
line_counter = 0 | |
with open(source_file) as f_in: | |
for line in f_in: | |
if rm_header: | |
if line_counter != 0: | |
f.write(line) |
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 | |
namespace NMH\Helper; | |
use Stash\Invalidation; | |
use Tedivm\StashBundle\Service\CacheService; | |
/** | |
* Class FallbackCacheItemRepository | |
* |
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 bash | |
set -xe | |
SSH_USER_PWD="${SSH_USER_PWD}" | |
SSH_USER="${SSH_USER}" | |
VPN_GATEWAY="${VPN_GATEWAY}" | |
sshpass -p "${SSH_USER_PWD}" ssh -o StrictHostKeyChecking=no -v "${SSH_USER}@${VPN_GATEWAY}" -22 -D 9999 -nf "sleep 90000" & | |
echo 'base{log_debug = on; log_info = on; log = "file:/tmp/reddi.log";daemon = on; redirector = iptables;}redsocks { local_ip = 127.0.0.1; local_port = 12345; ip = 127.0.0.1;port = 9999; type = socks5; }' > ~/redsocks.conf |
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 | |
// Version 2016.2 | |
error_reporting(0); | |
define('HHVM_PHP_INI', "/etc/hhvm/php.ini"); | |
define('HHVM_SERVER_INI', "/etc/hhvm/server.ini"); | |
define('XDEBUG', "xdebug"); | |
define('ZEND_DEBUGGER', "Zend Debugger"); |
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
diff --git a/dmemcache.inc b/dmemcache.inc | |
index b19c9c2..e279144 100644 | |
--- a/dmemcache.inc | |
+++ b/dmemcache.inc | |
@@ -394,6 +394,11 @@ function dmemcache_get_multi($keys, $bin = 'cache', $mc = NULL) { | |
if ($collect_stats) { | |
foreach ($multi_stats as $key => $value) { | |
+ // If we are using the broken version of memcache library, we need to | |
+ // prepend the key prefix to get correct statistics for get/set_multiple. |
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
package com.davidlukac.learn.scala | |
/** | |
* Created by davidlukac on 30/04/16. | |
*/ | |
class Coins { | |
def countChange(money: Int, coins: List[Int]): Int = { | |
// Just for the sake of algorithm logic, sort the coins from highest value, to smallest value. |
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
error_reporting(E_ALL); | |
ini_set('display_errors', TRUE); | |
ini_set('display_startup_errors', TRUE); |
NewerOlder