Skip to content

Instantly share code, notes, and snippets.

Antoine Aflalo Belphemur

Block or report user

Report or block Belphemur

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
Belphemur /
Created Aug 4, 2019
Wirguard with Network Namespace
ip netns add vpn
ip link add $DEVICE type wireguard
wg setconf $DEVICE $CONFIG
ip link set $DEVICE netns vpn
Belphemur /
Last active Mar 12, 2020
Generate a new client configuration for WireGuard
#!/usr/bin/env bash
if [ -z "$1" ]
echo "$0 client-name"
exit 1
Belphemur /
Created Feb 28, 2018
Release script to use Debian Changelog and Git together to generate the new version
#!/usr/bin/env bash
# TYPE= argument to the script where 0 = MAJOR, 1 = MINOR, 2 = BUILD. Default to BUILD.
GIT_VERSION=$(git describe --tags)
CURRENT_VERSION=$(echo ${GIT_VERSION:1} | cut -d'-' -f1)
function increment_version() {
local VERSION="$1"
local PLACE="$2"
Belphemur /
Last active Nov 13, 2017
Generate Elastic Certificate (with CA if needed) for the full elastic stack. For Logstash use the .p8 key generated instead of the normal key.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Keybase proof

I hereby claim:

  • I am belphemur on github.
  • I am balor ( on keybase.
  • I have a public key ASAAofR_lNOYzKmOkgfa5ZtPCG-tLHrCUrvmTi4afHUVsQo

To claim this, I am signing this object:

Belphemur / converter.php
Created Jun 14, 2017
Salesforce ID 15 chars to 18 chars converter PHP
View converter.php
function to18char(string $inputId) {
$suffix = '';
for ($i = 0; $i < 3; $i++) {
$flags = 0;
for ($j = 0; $j < 5; $j++) {
$start = $i * 5 + $j;
$end = ($i * 5 + $j + 1) - $start;
$c = substr($inputId, $start, $end);
if (ctype_upper($c) && $c >= 'A' && $c <= 'Z') {
Belphemur / post-merge
Last active Mar 17, 2017 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
View post-merge
#!/usr/bin/env bash
# MIT © Sindre Sorhus -
# Modified for Composer by Antoine Aflalo -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
View cloudflare-firewall.conf
# Author: Antoine Aflalo
# Source:
# Referenced from:
# To get your Cloudflare API key:
View combobox-with-adding.js
// Extra JQuery Extensions and Widgets
(function($) {
$.widget("ui.combobox", {
_create: function() {
var self = this; = this.element.hide();
var select =;
var id = select.attr('id');
var initial = $(select).find(":selected").text();
if (!initial){
You can’t perform that action at this time.