Skip to content

Instantly share code, notes, and snippets.

View z3ntu's full-sized avatar

Luca Weiss z3ntu

View GitHub Profile
@MartinBrugnara
MartinBrugnara / doc.txt
Last active June 14, 2024 16:53
DigitalOcean, assign public ipv6 to wireguard clients
# /etc/sysctl.d/wireguard.conf
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.eth0.proxy_ndp=1
#/etc/wireguard/wg0.conf (DO virtual machine)
[Interface]
# The server interface does not actually need an ipv6.
# The 2 following must be repeated for each used addres [0, 1]
@gcollic
gcollic / git_for_intellij.sh
Last active February 15, 2023 10:03
Replace the path to git by the path of this file in order to stop IntelliJ from messing with your staging area (no config for rename & co).
#!/bin/bash
inner() {
local cmd="$@"
local REGEX="(^|log.showSignature=false )(add|rm|mv) "
if [[ $cmd =~ $REGEX ]]; then
echo 'Stopping IntelliJ from being a not well-behaved git client. See IDEA-194592, IDEA-63391, IDEA-176961, ...' >&2
return 1
fi
git "$@"
}
@blu3r4y
blu3r4y / leitspital-liezen.ipynb
Last active January 5, 2021 17:28
Wahlverhalten der Gemeinden in Relation zur Fahrzeitänderung zum neu geplanten Leitspital Stainach-Pürgg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@justfortherec
justfortherec / 0001-Fix-reboot-on-shutdown-issue-with-the-new-camera-mod.patch
Created February 18, 2019 09:17
Linux kernel patch in Fairphone 19.02.1 to fix shutdown issue
From eb244d10da4f96f8147cc0bcadf2e043106745a4 Mon Sep 17 00:00:00 2001
From: Francesco Salvatore <francesco@fairphone.com>
Date: Fri, 14 Dec 2018 16:15:44 +0100
Subject: [PATCH] Fix reboot-on-shutdown issue with the new camera module
Since the introduction of Android N on FP2 devices equipped
with the new camera module, when an user tries to shutdown the device
it starts the power-off procedure but reboots before finishing.
This makes it impossible to turn off the phone and,
as a side effect, even to encrypt the device.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leandrotoledo
leandrotoledo / main.py
Last active February 2, 2024 00:08
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
@fffaraz
fffaraz / exec.md
Last active March 1, 2021 12:23
execl, execlp, execle, execv, execvp, execvpe
- e p
l execl execle execlp
v execv execve execvp

  • int execl(char const *path, char const *arg0, ...);
  • int execle(char const *path, char const *arg0, ..., char const *envp[]);
@geekygecko
geekygecko / android.md
Last active October 14, 2022 19:32
Android Cheat Sheet

Android Cheat Sheet

Developer tips

Record a video of your app

Developer options -> Check show touches
adb shell screenrecord /sdcard/video.mp4
adb pull /sdcard/video.mp4
@marteinn
marteinn / volley-timeout.java
Created July 1, 2014 19:15
Android Volley Samples: Catching a timeout error.
import com.android.volley.TimeoutError;
import com.android.volley.VolleyError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.toolbox.JsonObjectRequest;
import org.json.JSONObject;
Response.Listener<JSONObject> successListener = new Response.Listener<JSONObject>() {
@konklone
konklone / ssl-redirect.html
Last active January 2, 2024 15:09
Force a quick redirect to HTTPS on Github Pages for your domain (and only your domain)
<script>
var host = "YOURDOMAIN.github.io";
if ((host == window.location.host) && (window.location.protocol != "https:"))
window.location.protocol = "https";
</script>