Skip to content

Instantly share code, notes, and snippets.

@jkrehm
jkrehm / resetting-csync2-cluster.md
Created March 10, 2017 19:50 — forked from scottsb/resetting-csync2-cluster.md
Guide to Resetting a csync2 Cluster

Guide to Resetting a csync2 Cluster

Introduction

These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.

Use Cases

@jkrehm
jkrehm / ajaxListener.js
Last active February 15, 2017 21:20 — forked from icodejs/ajaxListener.js
JS: Listen to ajax calls from Javascript
var open = window.XMLHttpRequest.prototype.open,
send = window.XMLHttpRequest.prototype.send,
onReadyStateChange;
function openReplacement(method, url, async, user, password) {
var syncMode = async !== false ? 'async' : 'sync';
console.warn(
'Preparing ' +
syncMode +
' HTTP request : ' +
@jkrehm
jkrehm / Scanner.php
Created February 12, 2016 18:26
PHP Version Scanner
<?php namespace HighPoint\VersionScan;
use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Query;
/**
* Version scanner
*/
class Scanner
@jkrehm
jkrehm / 0_reuse_code.js
Created October 5, 2015 17:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
AJS.$(document).ajaxSuccess(function (e, xhr, settings) {
if (/\/dev-status\/.*dataType=repository/.test(settings.url)) {
xhr.done(function (data) {
var info = {};
data.detail[0].repositories.forEach(function (repository) {
info[repository.name] = info[repository.name] || [];
info[repository.name] = _.pluck(repository.commits, 'id');
});
@jkrehm
jkrehm / DraggableJiraDialogs.js
Last active August 29, 2015 14:20
DraggableJiraDialogs.js
// Requires Chrome and the Control Freak (https://chrome.google.com/webstore/detail/control-freak/jgnchehlaggacipokckdlbdemfeohdhc) extension
/* Libs:
- https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
- https://cdnjs.cloudflare.com/ajax/libs/draggabilly/1.2.0/draggabilly.pkgd.min.js
- https://cdn.rawgit.com/meetselva/attrchange/d3f8524374b0ad11f320b51f7b188ae940314dba/js/attrchange.js
*/
// Make dialogs draggable
$(function () {
@jkrehm
jkrehm / cvedetails-php-versions.json
Created January 11, 2015 16:20
CVEDetails.com PHP version ID's
[
{
"version": "5.6.4",
"id": "178362"
},
{
"version": "5.6.3",
"id": "178179"
},
{
@jkrehm
jkrehm / FacebookUtilities.js
Last active August 29, 2015 14:06
Facebook Utilities
/* CSS
.timerWrapper {
color: #fff;
left: 5px;
position: fixed;
top: 5px;
z-index: 9999;
}
.timer {
height: 15px;
@jkrehm
jkrehm / PSTurboMode.js
Created August 7, 2014 18:41
Add turbo mode to PeopleSoft process monitor refresh
var $frame = $('#ptifrmtgtframe');
$frame.load(function () {
// If refresh button not found, don't continue
if ($frame.contents().find('#REFRESH_BTN').length === 0) {
$('#turbo-enabled').remove();
return;
}
@jkrehm
jkrehm / GetCommits.js
Last active August 29, 2015 14:03
Get commits by repository & branch from Jira
/*jshint browser:true, devel:true*/
/*global $*/
$(document).on('click', '#dvcs-commits-tabpanel', function () {
// Wait for the commits to load...
setTimeout(function () {
var commits = {};
$('.CommitHeader > a').each(function() {
var $this = $(this);