Skip to content

Instantly share code, notes, and snippets.

View julianhille's full-sized avatar
🏠
Working from home

Julian Hille julianhille

🏠
Working from home
View GitHub Profile
@julianhille
julianhille / psExec.nsh
Last active April 28, 2022 20:30
NSIS Powershell execution with win64 support. 32bit NSIS starts a 64bit powershell script
;based on https://nsis.sourceforge.io/PowerShell_support but with x64 support
!include x64.nsh
!ifndef PSEXEC_INCLUDED
!define PSEXEC_INCLUDED
!macro PowerShellExecMacro PSCommand
InitPluginsDir
;Save command in a temp file
Push $R1
FileOpen $R1 $PLUGINSDIR\tempfile.ps1 w
@julianhille
julianhille / segfault.py
Last active August 29, 2015 14:06
found a segfault in python3 / py.test
#needs py.test and needs unittest
# python -m py.test segfault.py
# works with unittest only
# used: Python 3.4.1.1 (default, Aug 24 2014, 21:32:40)
import unittest
class TestCase(unittest.TestCase):
def test_bug(self):
with self.assertRaises(TypeError) as context:
@julianhille
julianhille / filesizeformat.js
Last active August 29, 2015 14:06
javascript file size format human readable
function filesizeformat(bytes, binary, precision) {
/*
Javascript filesizeformater.
Inspired by jinja2 and some gists.
@version 1.0.0
@copyright 2014 Julian Hille
@author Julian Hille
*/
binary = typeof binary !== 'undefined' ? binary : false;
@julianhille
julianhille / gist:0073aa15e0c34c853f8c
Created August 14, 2014 10:05
elasticsearch 1.3.1 null_value NPE (null pointer exception)
export ES_HOST=http://localhost:9200
export ES_INDEX=test
# delete & recreate index with defaults
curl -XDELETE $ES_HOST/$ES_INDEX -s -o /dev/null
curl -XPUT $ES_HOST/$ES_INDEX -s -o /dev/null
# configure the mapping of the bug type in the test index
curl -XPUT $ES_HOST/$ES_INDEX/bug/_mapping -d '{
@julianhille
julianhille / gist:f4d1014a0072cc3233fb
Last active August 29, 2015 14:04
ids filter in percolator
export ES_HOST=http://localhost:9200
export ES_INDEX=test
# delete & recreate index with defaults
curl -XDELETE $ES_HOST/$ES_INDEX -s -o /dev/null
curl -XPUT $ES_HOST/$ES_INDEX -s -o /dev/null
# configure the mapping of the bug type in the test index
curl -XPUT $ES_HOST/$ES_INDEX/bug/_mapping -s -o /dev/null -d '
@julianhille
julianhille / gist:bd23e8e43e28a193401e
Last active August 29, 2015 14:02
In this scriupt are two tests running each after another. For Es 1.2.1
export ES_HOST=http://localhost:9200
# delete & recreate index with defaults
curl -XDELETE $ES_HOST/test
curl -XPUT $ES_HOST/test
# configure the mapping of the bug type in the test index
curl -XPUT $ES_HOST/test/bug/_mapping -d'
{
"bug": {
@julianhille
julianhille / gist:5203065480dc62bb6752
Last active August 29, 2015 14:02
In this scriupt are two tests. For Es 0.90
export ES_HOST=http://localhost:9200/
# delete & recreate index with defaults
curl -XDELETE $ES_HOST/test
curl -XPUT $ES_HOST/test
# configure the mapping of the bug type in the test index
curl -XPUT $ES_HOST/test/bug/_mapping -d'
{
"bug": {
@julianhille
julianhille / apache32_bit_1_0.sh
Created October 19, 2011 16:14
Mamp 2.0.x run apache as 32bit
mv /Applications/MAMP/Library/bin/httpd /Applications/MAMP/Library/bin/httpd.64
lipo -thin i386 /Applications/MAMP/Library/bin/httpd.64 -out /Applications/MAMP/Library/bin/httpd.32
ln -s /Applications/MAMP/Library/bin/httpd.32 /Applications/MAMP/Library/bin/httpd