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 | |
function getReplicationInfo($m) { | |
$db = $m->local; | |
$result = array(); | |
$ol = $db->system->namespaces->findOne(array("name" => 'local.oplog.$main')); | |
if ($ol && array_key_exists('options', $ol)) { | |
$result['logSizeMB'] = $ol['options']['size'] / 1000 / 1000; |
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 re | |
import sys | |
states = ('DEFAULT', 'HAVE_FILE') | |
fl = re.compile('^fl=(.*)') | |
num = re.compile('^\d+ (\d+)') | |
state = 0 | |
current_file = '' | |
inclusive = False |
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
#cloud-config | |
coreos: | |
etcd2: | |
# generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3 | |
# specify the initial size of your cluster with ?size=X | |
discovery: https://discovery.etcd.io/<token> | |
# multi-region and multi-cloud deployments need to use $public_ipv4 | |
advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001 | |
initial-advertise-peer-urls: http://$private_ipv4:2380 |
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 | |
# No username or passwords in this script, you should use mysql_config_editor | |
# to store it securely. The login-path in this script is set to "local-backup" so when you create | |
# your .mylogin.cnf with the mysql-config-editor make sure it is set the same | |
# See http://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html | |
# An example to create your config for a mysql user "backup": | |
# shell> sudo mysql_config_editor set --login-path=local-backup --host=localhost --user=backup --password | |
# The backup user in the mysql server needs these privileges: SELECT, RELOAD, SHOW DATABASES, REPLICATION CLIENT |
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 473846959772d8160b34b92ae3bcecddf24b972f Mon Sep 17 00:00:00 2001 | |
From: =?UTF-8?q?Julian=20Nu=C3=9F?= <julian.nuss@outlook.com> | |
Date: Tue, 23 Sep 2014 21:07:29 +0200 | |
Subject: [PATCH 1/1] [BUGIFX] Zend Framework 1 + PHP5.6 | |
--- | |
lib/Zend/Locale/Format.php | 22 +++++++++++----------- | |
lib/Zend/Service/Audioscrobbler.php | 6 +++--- | |
lib/Zend/Service/Technorati.php | 6 +++--- | |
lib/Zend/Validate/Hostname.php | 4 ++-- |
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 | |
/** | |
* Converts a PNG image to a .GRF file for use with Zebra printers | |
* | |
* The input is preferably a 1-bit black/white image but RGB images | |
* are accepted as well. | |
* | |
* This function uses PHP's GD library image functions. | |
* |
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 | |
/** | |
* Drop this into the shell directory in the Magento root and run with -h to see all options. | |
*/ | |
require_once 'abstract.php'; | |
/** | |
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints. |
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 | |
# Copyright 2013 Percona LLC and/or its affiliates | |
# @see https://www.percona.com/blog/2013/12/24/renaming-database-schema-mysql/ | |
set -e | |
if [ -z "$3" ]; then | |
echo "rename_db <server> <database> <new_database>" | |
exit 1 | |
fi | |
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss` | |
if [ -n "$db_exists" ]; then |
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 | |
require_once __DIR__.'/V8JsNodeModuleLoader_FileAccessInterface.php'; | |
require_once __DIR__.'/V8JsNodeModuleLoader_NormalisePath.php'; | |
/** | |
* Simple Node.js module loader for use with V8Js PHP extension | |
* | |
* This class understands Node.js' node_modules/ directory structure | |
* and can require modules/files from there. | |
* |
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/python | |
""" | |
msysGit to Unix socket proxy | |
============================ | |
This small script is intended to help use msysGit sockets with the new Windows Linux Subsystem (aka Bash for Windows). | |
It was specifically designed to pass SSH keys from the KeeAgent module of KeePass secret management application to the | |
ssh utility running in the WSL (it only works with Linux sockets). However, my guess is that it will have uses for other |
OlderNewer