Skip to content

Instantly share code, notes, and snippets.

View renaudcerrato's full-sized avatar

Renaud Cerrato renaudcerrato

View GitHub Profile
@renaudcerrato
renaudcerrato / hostapd.conf
Created May 27, 2016 13:31
Sample hostapd.conf for documentation.
##### hostapd configuration file ##############################################
# Empty lines and lines starting with # are ignored
# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for
# management frames with the Host AP driver); wlan0 with many nl80211 drivers
interface=wlan0
# In case of atheros and nl80211 driver interfaces, an additional
# configuration parameter, bridge, may be used to notify hostapd if the
# interface is included in a bridge. This parameter is not used with Host AP
@renaudcerrato
renaudcerrato / snippet.kt
Last active April 2, 2023 13:55
Kotlin Interfaces
interface A {
val a: Int // abstract
val b: Int // abstract
fun foo() // abstract
fun bar() {
// optionnal body
}
}
interface B { ... }
@renaudcerrato
renaudcerrato / 402-ath_regd_optional.patch
Last active February 28, 2023 15:03
Atheros driver patch to disable EEPROM regulatory restrictions enforcing.
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -341,6 +341,10 @@ ath_reg_apply_beaconing_flags(struct wip
struct ieee80211_channel *ch;
unsigned int i;
+#ifdef CONFIG_ATH_USER_REGD
+ return;
+#endif
+
@renaudcerrato
renaudcerrato / dyndns.ovh
Last active December 26, 2021 13:33
POSIX Shell Script to Update ovh dyndns.
#!/bin/sh
error () {
echo "error: $1"
usage
}
usage () {
echo "usage: $0 -u <username> -p <password> -d <domain> -i <seconds> <subdomain>";
exit 1
@renaudcerrato
renaudcerrato / MergeRecyclerAdapter.java
Created May 15, 2015 13:01
MergeAdapter for RecyclerView
package recyclerview.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@renaudcerrato
renaudcerrato / ArrayRecyclerAdapter.java
Last active April 7, 2021 14:50
Lightweight ArrayAdapter for RecyclerView.
package recyclerview.adapter;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Index: linux-4.15.0/drivers/net/wireless/ath/Kconfig
===================================================================
--- linux-4.15.0.orig/drivers/net/wireless/ath/Kconfig 2018-01-28 22:20:33.000000000 +0100
+++ linux-4.15.0/drivers/net/wireless/ath/Kconfig 2018-07-01 07:56:11.988486650 +0200
@@ -22,6 +22,9 @@
if WLAN_VENDOR_ATH
+config ATH_USER_REGD
+ bool "Do not enforce EEPROM regulatory restrictions"

Keybase proof

I hereby claim:

  • I am renaudcerrato on github.
  • I am renaudcerrato (https://keybase.io/renaudcerrato) on keybase.
  • I have a public key ASABbJwczM3qvM1NIE5Nv6myqn1Ou-ypR6p5XFAcsvCf-Qo

To claim this, I am signing this object:

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.PowerManager;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.view.View;
import java.math.BigInteger;
final public class Base63 {
static public final char[] CHARSET = new char[]{'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','_'};
static private final BigInteger BASE = BigInteger.valueOf(CHARSET.length);
public static String encode(BigInteger integer) {
final StringBuilder sb = new StringBuilder();
BigInteger[] r = new BigInteger[]{integer, null};