Skip to content

Instantly share code, notes, and snippets.

@youribonnaffe
youribonnaffe / README.md
Last active September 13, 2020 13:25
Recover OSMC installation on SD card after power failure

After a power failure my Rasberry Pi running OSMC would not boot anymore. SD Card do not seem to appreciate power failures and the FS is often left corrupted.

When booting the Pi, no bootable filesystem could be found.

Using a Mac I was able to recover it.

Backup the partition with data

The SD card holds 2 partitions one to bootstrap OSMC and one with the system.

@youribonnaffe
youribonnaffe / RecordTest.java
Last active December 21, 2020 13:15
Java 14 Record (JEP 359) deserialization with Jackson
package com.github.youribonnaffe.jackson;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
@youribonnaffe
youribonnaffe / leclerc_receipts.js
Created October 11, 2019 19:26
Import de tickets de caisse Leclerc
function import() {
var threads = GmailApp.search('from:@ticketcaisse.e-leclerc.com');
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
for (t = 0; t < threads.length; t++) {
var message = threads[t].getMessages()[0];
var shoppingList = parseEmail(message);
https://tbnm9.app.goo.gl/?link=https%3a%2f%2fboogi.fr%2fbordeaux%3fsearch%3d104&apn=com.is.android.boogibordeaux&al=https://www.boogi.fr&ibi=com.instantsystem.boogi-bordeaux&d=0
@youribonnaffe
youribonnaffe / netExtender Ubuntu install and service
Last active July 19, 2022 10:14
netExtender Ubuntu 14.04 Install and run as a service
# Install
Get the archive from http://ainola.sdf.org/NetExtender.Linux.8.0.784.x86_64.tgz
Run ./install as root (otherwise it got stuck on Connecting ... for me)
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v Hidden /t REG_DWORD /d 1 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v SuperHidden /t REG_DWORD /d 1 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v ShowSuperHidden /t REG_DWORD /d 1 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v TaskbarGlomming /t REG_DWORD /d 0 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v TaskbarGlomLevel /t REG_DWORD /d 2 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v TaskbarSmallIcons /t REG_DWORD /d 1 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f
reg add HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v FriendlyTree /t REG_DWORD /d 1 /f
reg add HKEY_CURRENT_USER
@youribonnaffe
youribonnaffe / rm-start-docker-node
Created June 11, 2014 08:57
rm-start-docker-node
#!/bin/sh
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/
/opt/proactive/bin/unix/rm-start-node -r $1 -f /opt/proactive/config/authentication/rm.cred -Dproactive.useIPaddress=true -n docker_$HOSTNAME
@youribonnaffe
youribonnaffe / Dockerfile
Created June 11, 2014 08:50
Dockerfile for ProActive
# ProActive
#
# VERSION 3.4.4
FROM dockerfile/java
MAINTAINER Youri Bonnaffé <youri.bonnaffe@activeeon.com>
COPY ./ProActiveScheduling-3.4.4_bin_full /opt/proactive
COPY rm-start-docker-node /opt/proactive/
<?xml version="1.0" encoding="UTF-8"?>
<job xmlns="urn:proactive:jobdescriptor:dev" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:proactive:jobdescriptor:dev ../../src/scheduler/src/org/ow2/proactive/scheduler/common/xml/schemas/jobdescriptor/dev/schedulerjob.xsd"
name="docker" priority="normal" cancelJobOnError="false">
<taskFlow>
<task name="run">
<scriptExecutable>
<script>
<code language="groovy">
println "ps -e".execute().text
@youribonnaffe
youribonnaffe / gist:76dfab1c2b4fa1319ce9
Created June 11, 2014 08:38
Run the ProActive Scheduler with Docker
unzip ProActiveScheduling-3.4.4_bin_full.zip
cd ProActiveScheduling-3.4.4_bin_full
./bin/unix/scheduler-start-gui -Dproactive.useIPaddress=true -Dproactive.net.interface=docker0