Skip to content

Instantly share code, notes, and snippets.

View soberich's full-sized avatar

soberich

  • Amsterdam, The Netherlands
View GitHub Profile
@cstancu
cstancu / DeletedClass.java
Last active April 19, 2019 20:49
--report-unsupported-elements-at-runtime test
public class DeletedClass {
}
@ixdy
ixdy / yubikey4-ssh-macos.md
Last active February 9, 2025 12:12
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048

How To Make A Working TWRP Device Tree For Your MediaTek Device & Start Building Them, Online

This Guide is tested on 64-bit mt6735/53 chipset device. It will also work on any 64-bit and 32-bit devices.

You will need something from your Stock ROM first. Get them all and Try to modify it using the procedure.

Note: This guide will be helpful for you if you have older mediatek devices (android-5.1 or android-6.0), but up-to-date devices can also work.

Update: This guide had a few typos and derps (Oops..), but I've tried to make it free of those now (Dated November 18, 2020)

Bonus: You can also use this tool by @SebaUbuntu, @yshalsager and @mauronofrio to auto generate the twrp tree. The tool is best if your device runs on android-9.0. The tools is still not 100% compatible to all devices, but I'll still recommend it and give it 8.5/10 in the scale of varsatility.

@yougg
yougg / proxy.md
Last active July 10, 2025 15:35
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@bernardolopes8
bernardolopes8 / BookPersister.java
Last active November 15, 2024 13:04
Jersey Pagination, Sorting, and Filtering Example
package my.application.dao;
import java.util.List;
import my.application.entity.Book;
import my.application.restutil.RequestOptions;
public interface BookPersister {
List<Book> getBooks(RequestOptions requestOptions);
}

iOS Shared Cache Extraction

Having fallen off the iOS-exploration train due to completing my Masters and other commitments, I have finally climbed back aboard in pursuit of understanding the telephony stack.

Like most things in iOS that are used frequently, the vast majority of the frameworks and libraries used in the telephony stack reside in the DYLD shared cache located at /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7.

In this post I am going to explain how to go about extracting this cache file so that you can then work with each library individually.

Get The Cache

The first step in all of this is to copy the cache over to your local machine. I did this using a program called iExplorer, but you can just as easily do it over SSH. As a side note, you can connect to your iDevice using SSH over USB if you install a tool called iProxy.

@ryantan
ryantan / resign-ipa.md
Last active June 25, 2025 16:48
How to resign an .ipa

How to Resign an iOS App

Let's say you receive an app (e.g. MyApp.ipa) from another developer, and you want to be able to install and run it on your devices (by using ideviceinstaller, for example).

Or your certificates and provision profiles have expired and you want to provide a new build to your clients without having to make a new build on the latest XCode or iOS SDK.

Prepare New Signing Assets

The first step is to attain a Provisioning Profile which includes all of the devices you wish to install and run on. Ensure that the profile contains a certificate that you have installed in your Keychain Access (e.g. iPhone Developer: Some Body (XXXXXXXXXX) ). Download the profile (MyProfile.mobileprovision) so you can replace the profile embedded in the app.

@retronym
retronym / diff.diff
Last active March 21, 2019 22:35
Graal CE vs EE config options
--- graal-ce-config.txt 2018-05-23 13:52:18.000000000 +1000
+++ graal-ee-config.txt 2018-05-23 13:52:34.000000000 +1000
@@ -1,11 +1,11 @@
-scala@scalabench:/usr/lib/jvm$ /usr/lib/jvm/graalvm-ce-1.0.0-rc1/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+JVMCIPrintProperties -version
+scala@scalabench:/usr/lib/jvm$ /usr/lib/jvm/graalvm-1.0.0-rc1/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+JVMCIPrintProperties -version
[JVMCI properties]
jvmci.Compiler := "graal" [String]
Selects the system compiler. This must match the getCompilerName() value returned by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. An empty string or the value "null" selects a compiler that will raise an exception upon receiving a compilation request. This property can also be defined by the contents of <java.home>/lib/jvmci/compiler-name.
jvmci.InitTimer = false [Boolean]
Specifies i
@tonyxu-io
tonyxu-io / linedin-login-sample-code.html
Last active August 8, 2020 13:23
Linkedin Login Sample Code #snippet
<!DOCTYPE html>
<html>
<head>
<title>Linkedin Demo</title>
<meta charset="utf-8">
<script type="text/javascript" src="//platform.linkedin.com/in.js">
api_key: 86012 cynxvvidr
onLoad: checkAuthentication
authorize: true
@raphw
raphw / Main.java
Last active May 9, 2018 19:07
Method handle invoke special
package main;
import bar.Bar;
import qux.Qux;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Proxy;
import java.util.function.Consumer;