Skip to content

Instantly share code, notes, and snippets.

Léo Peltier L-P

Block or report user

Report or block L-P

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
@L-P
L-P / Makefile
Created Dec 13, 2018
Generic golang command Makefile
View Makefile
VERSION=$(shell git describe --tags)
BUILDFLAGS=-ldflags '-X main.Version=${VERSION}'
EXEC=$(shell basename "$(shell pwd)")
all: $(EXEC)
$(EXEC):
go build ${BUILDFLAGS}
.PHONY: $(EXEC)
@L-P
L-P / humanize.php
Created Apr 28, 2017
Humanize sizes
View humanize.php
<?php
/**
* @param mixed size byte count, this is not typehinted so large values can be
* passed as float.
* @return human-readable byte count
*/
function humanizeByteCount($size): string
{
assert($size >= 0);
@L-P
L-P / munin-fcgi.service
Created Oct 10, 2016
Munin dynazoom graphs with nginx and spawn-fcgi
View munin-fcgi.service
[Unit]
Description=Munin FCGI
After=network.target
[Service]
Type=forking
PIDFile=/var/run/munin/fcgi-graph.pid
Restart=always
ExecStartPre=/bin/mkdir -p /var/lib/munin/cgi-tmp/munin-cgi-graph
@L-P
L-P / k501ux-setup.md
Last active Sep 1, 2016
Installing lubuntu 15.10 on an Asus K501UX laptop with UEFI/SecureBoot enabled.
View k501ux-setup.md

Installing lubuntu 15.10 on an Asus K501UX laptop with UEFI/SecureBoot enabled.

When you first try to install lubuntu on an Asus K501UX, you will have a black screen and no clue about what is happening.
This is the situation I faced and this guide is the result of 5 hours of hair-pulling and cursing at various corporations including Asus, nvidia, Microsoft and even Canonical.

This guide will hold you hand until you can boot to the desktop. How to install the nvidia drivers is not included in this guide.

View keybase.md

Keybase proof

I hereby claim:

  • I am l-p on github.
  • I am lp0 (https://keybase.io/lp0) on keybase.
  • I have a public key ASAQHTmm8-4I5XqQJ7FE6XeVPIL7nYw9VRy3O6Da08D62wo

To claim this, I am signing this object:

@L-P
L-P / libssh_std_thread.cpp
Last active Aug 29, 2015
C++11 thread support for the SSH Library.
View libssh_std_thread.cpp
/**
* C++11 thread support for the SSH Library.
* Copyright (c) 2014 Léo Peltier <lpeltier@ivsweb.com>
*/
#include <mutex>
#include <thread>
#include <libssh/callbacks.h>
#include "libssh_std_thread.hpp"
@L-P
L-P / Makefile
Last active Aug 29, 2015
Strict Makefile
View Makefile
#### PROJECT SETTINGS ####
# The name of the executable to be created
BIN_NAME :=
# Compiler used
CXX ?= g++
# Extension of source files used in the project
SRC_EXT = cpp
# Path to the source directory, relative to the makefile
SRC_PATH = src
# Space-separated pkg-config libraries used by this project
@L-P
L-P / exec-notify.c
Created Mar 11, 2014
Watch process creation.
View exec-notify.c
/* exec-notify, so you can watch your acrobat reader or vim executing "bash -c"
* commands ;-)
* Requires some 2.6.x Linux kernel with proc connector enabled.
*
* $ cc -Wall -ansi -pedantic -std=c99 exec-notify.c
*
* (C) 2007-2010 Sebastian Krahmer <krahmer@suse.de> original netlink handling
* stolen from an proc-connector example, copyright folows:
*/
/*
View fizzbuzz.php
<?php
$f = function($a) {
switch(0) {
case $a % 15:
return 'FizzBuzz';
case $a % 3:
return 'Fizz';
case $a % 5:
return 'Buzz';
@L-P
L-P / enc.md
Last active Jan 22, 2019
Removing device encryption on a Samsung Galaxy S3 (i9300) running CyanogenMod 10.1
View enc.md

Removing device encryption on a Samsung Galaxy S3 (i9300) running CyanogenMod 10.1

I couldn't disable the full-device encryption on my phone even by doing factory resets both from Android and the recovery mode, the later being unable to mount /data. There was a lot of people complaining about this on the internet but nobody provided a working solution so I had to investigate this myself.

Note: this will erase everything as would a factory reset do.

You can’t perform that action at this time.