Skip to content

Instantly share code, notes, and snippets.

Avatar

Youri Bonnaffé youribonnaffe

View GitHub Profile
@youribonnaffe
youribonnaffe / README.md
Last active Sep 13, 2020
Recover OSMC installation on SD card after power failure
View README.md

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 / gist:8937568
Created Feb 11, 2014
ssh-copy-id for multiple servers
View gist:8937568
set -x
[ -f "$0" ] && SCRIPT=$0
TARGET1=$1
shift
TARGETS=$*
TARGET2=$1
for TARGET in $TARGETS
do
@youribonnaffe
youribonnaffe / RecordTest.java
Last active Mar 22, 2020
Java 14 Record (JEP 359) deserialization with Jackson
View RecordTest.java
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 / netExtender Ubuntu install and service
Last active Mar 12, 2020
netExtender Ubuntu 14.04 Install and run as a service
View netExtender Ubuntu install and 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)
@youribonnaffe
youribonnaffe / leclerc_receipts.js
Created Oct 11, 2019
Import de tickets de caisse Leclerc
View leclerc_receipts.js
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);
View gist:27d623e85dcc0e44e50c
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 / gist:7401737
Last active Mar 30, 2018
Gradle IDEA add project dependencies instead of JAR dependencies in Intellij configuration file (.iml)
View gist:7401737
apply plugin: 'idea'
idea.module.iml {
def customDependencies = ['org.objectweb.proactive', 'org.ow2.proactive']
whenMerged { module ->
// to reorder dependencies
def existingDependencies = module.dependencies
module.dependencies = new LinkedHashSet()
configurations.compile.resolvedConfiguration.resolvedArtifacts.each {
if (it.moduleVersion.id.group == project.group || customDependencies.contains(it.moduleVersion.id.group) ) {
logger.info("Custom idea: adding ${it.name}")
View gist:895d0e545115ba53ea521e7820b73604
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
View gist:6375515
task wrapper(type: Wrapper) {
gradleVersion = '1.7'
jarFile "${project.projectDir}/.gradle/wrapper/gradle-wrapper.jar"
}
View Windows quick settings
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
You can’t perform that action at this time.