Skip to content

Instantly share code, notes, and snippets.

View dregad's full-sized avatar

Damien Regad dregad

  • Switzerland
  • 22:57 (UTC +02:00)
View GitHub Profile
@dregad
dregad / dokuwiki_fix_timestamp.sh
Created June 19, 2018 14:13
DokuWiki set timestamp to fix `(external edit)`
#!/bin/bash
# DokuWiki helper script to fix the pages's last modified time stamp
# to match the one recorded in the metadata.
# This fixes pages shown as 'last modified by (external edit)', e.g. after
# restoring the wiki from a backup without preserving the files' timestamp.
#
# Copyright (c) 2018 Damien Regad
#
# Revision history
@dregad
dregad / create_test_users.php
Created May 23, 2016 20:44
Mantis test users creation script
#!/usr/bin/env php
<?php
define( 'MANTIS_CORE', 'core.php' );
if( !file_exists( MANTIS_CORE ) ) {
echo "ERROR: Mantis Core not found in current directory. Run the script from Mantis Home.\n";
die(1);
}
require_once( MANTIS_CORE );
@dregad
dregad / Mantis 1.2.x
Created July 24, 2013 14:21
Mantis / PHP compatibility notes
$ phpcompatinfo print mantisbt/ -R --report full >/tmp/rpt
filtering output:
$ grep -v -E "(4\..\..|5.(0\..|1\.0))[^/]" /tmp/rpt |grep "^. [0-9]$"
---------------------------------------------------------------------
json 5.2.0 5.2.0 2
curl_setopt_array curl-5.1.3 5.1.3 1
json_decode json-5.2.0 5.2.0 1
@dregad
dregad / TestSourceGithub.php
Last active December 16, 2015 07:08
This page allows testing of the SourceGithub plugin by simulating the sending of a Github post_receive hook's payload
<?php
# Testing for SourceGithub checkin process
$bin = get( 'bin', '' );
$req = get( 'req', '' );
$api = 'http://requestb.in/api/v1/bins';
$tpl_list = "$api/%s/requests";
$tpl_reqs = "$api/%s/requests/%s";
@dregad
dregad / ssh-agent-init.bat
Created December 16, 2012 07:46
Load Putty Pageant and Charade SSH agent in memory and initialize the environment variables for future use by OpenSSH (e.g. Cygwin)
@ECHO OFF
REM ===========================================================================
REM
REM ssh-agent-init.bat
REM
REM Load Putty Pageant and Charade SSH agent in memory and initialize the
REM environment variables for future use by OpenSSH (e.g. Cygwin)
REM
REM Prerequisites:
REM - charade [1]
@dregad
dregad / diff_adodb510_mantis12x.patch
Created May 31, 2012 15:44
MantisBT / ADOdb diffs upstream 5.10 vs 1.2.x
diff -r -w -u mantis_adodb5.10/adodb-datadict.inc.php ../dev/mantisbt/library/adodb/adodb-datadict.inc.php
--- mantis_adodb5.10/adodb-datadict.inc.php 2012-05-31 14:56:22.450304922 +0200
+++ ../dev/mantisbt/library/adodb/adodb-datadict.inc.php 2012-05-31 14:57:37.554308740 +0200
@@ -715,12 +715,12 @@
$ftype = $this->_GetSize($ftype, $ty, $fsize, $fprec);
- if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
+ //if ($ty == 'X' || $ty == 'X2' || $ty == 'B') $fnotnull = false; // some blob types do not accept nulls
@dregad
dregad / http - ok
Created November 14, 2011 16:33
git clone https NTLM proxy fails with "remote HEAD refers to nonexistent ref"
Cloning into guillotine...
* About to connect() to proxy proxy.COMPANY.com port 8080 (#0)
* Trying XXX.XXX.XXX.XXX... * Connected to proxy.COMPANY.com (XXX.XXX.XXX.XXX) port 8080 (#0)
> GET http://github.com/technoweenie/guillotine.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.5.4
Host: github.com
Accept: */*
Proxy-Connection: Keep-Alive
Pragma: no-cache