Skip to content

Instantly share code, notes, and snippets.

Arno Moonen itavero

Block or report user

Report or block itavero

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@itavero
itavero / am_get_real_ip.php
Created Dec 23, 2011
Get the real IP address of the client and optionally also the one from the proxy server.
View am_get_real_ip.php
<?php
/**
* Get the IP address of the client.
*
* @author Arno Moonen <info@arnom.nl>
* @version 0.1-201112231035
* @param boolean $get_all Set to true to get an array containing all the IP addresses found.
* @return mixed Depending on the value of $get_all the return value will be either a string or an array
*/
@itavero
itavero / form_div_layout.html.twig
Created May 9, 2012
Workaround for the "Unable to choose translation" problem when using the Form component, Validation component, Translation component and Twig. (keywords: Symfony, Silex)
View form_div_layout.html.twig
{% extends 'Form/form_div_layout.html.twig' %}
{#
Extends from Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Overrides the form_errors block so it no longer uses transchoice (which
was causing a problem).
#}
{% block form_errors %}
{% spaceless %}
@itavero
itavero / amnl.simple.crypt.php
Created Jul 2, 2012
Easy way to encrypt stuff, just to make it less visible for the end-user. It's not really secure or anything.
View amnl.simple.crypt.php
<?php
/**
* Easy way to encrypt / decrypt a string. Notice that this is NOT
* a very secure encryption. But you can use it to make stuff less
* visible for the end user.
*
* (c) Arno Moonen <info@arnom.nl>
*
* @author Arno Moonen <info@arnom.nl>
@itavero
itavero / headless_pi.sh
Created Nov 27, 2015
Remove all of the graphical stuff from Raspbian
View headless_pi.sh
#!/usr/bin/env
# Still a work in progress...
sudo apt-get remove -y --auto-remove --purge libx11-*
sudo apt-get autoremove -y --purge
# Run raspi config to disable boot via GUI
sudo raspi-config
@itavero
itavero / git_export.sh
Last active Dec 14, 2015
Bash script to export the current branch/rev of a Git repository as a ZIP archive.
View git_export.sh
#!/bin/bash
# Easy Git Export Command
# Copyright (C) 2013, Arno Moonen <info@arnom.nl>
#
# Example usage (from within a Git repository, when using the alias):
# git-export ~/Desktop
# -> Creates the exported archive on your desktop.
# git-export
# -> Creates the exported archive one level up in your path.
#
@itavero
itavero / lpc1549_custom.tcl
Created Jan 4, 2016
OpenOCD Target configuration for NXP LPC1549
View lpc1549_custom.tcl
# NXP LPC1549 (based on lpc1xxx.cfg)
set _CHIPNAME lpc1549
set _WORKAREASIZE 0x9000
set _CHIPSERIES lpc1500
set _BANKSIZE 0x40000
source [find target/swj-dp.tcl]
if { [info exists CCLK] } {
# Allow user override
@itavero
itavero / modem_spammer.py
Created Feb 16, 2016
Tele2 Modem Spammer
View modem_spammer.py
import urllib2
import re
import collections
from pushbullet.pushbullet import PushBullet
from time import sleep
base_url = 'http://192.168.1.1/'
pushbullet_key = 'YOUR_KEY'
# Set-up basic authentication
View uncrustify.cfg
#
# General options
#
# The type of line endings
newlines = crlf # auto/lf/crlf/cr
# The original size of tabs in the input
input_tab_size = 3 # number
@itavero
itavero / set_java_home.bat
Created Jun 14, 2016
Set JAVA_HOME on a Windows machine based on registry keys
View set_java_home.bat
@echo off
setlocal
:: Check if JAVA_HOME is already defined
IF DEFINED JAVA_HOME (exit /b 0)
:: Get the JDK version from the registry
set KEY="HKLM\SOFTWARE\JavaSoft\Java Development Kit"
set VALUE=CurrentVersion
@itavero
itavero / EnvInject_BuildStartedBy.groovy
Created Sep 23, 2016
Jenkins EnvInject script to inject the User ID and name of the person that started the Build
View EnvInject_BuildStartedBy.groovy
def map = [BUILD_USER_ID: "unknown", BUILD_USER_NAME:"Unknown"]
try {
def cause = currentBuild.getCause(hudson.model.Cause.UserIdCause.class)
if (cause != null) {
map.BUILD_USER_ID = cause.userId
map.BUILD_USER_NAME = cause.userName
}
} catch (Throwable t) {
out.println(t)
}
You can’t perform that action at this time.