Skip to content

Instantly share code, notes, and snippets.

View oddlyspaced's full-sized avatar

Hardik Srivastava oddlyspaced

View GitHub Profile
@verNANDo57
verNANDo57 / 8GB_android-11_compilation-note
Last active November 14, 2023 20:04
Workarounds for building Android 11 on 8GB RAM
Workarounds for building R on 8GB RAM environment:
1. At the start of the build:
[ 99% 138/139] /mnt/ssd/lineage/out/soong/.bootstrap/bin/soong_build /mnt/ssd/lineage/out/soong/build.ninja
This used to take around 30mins, after enabling zram now it takes around 30secs (thanks to @kdrag0n for the zram idea) which is on par with what happens in 16GB RAM building environments
sudo apt install zram-config for installing zram-config package
sudo nano /etc/fstab and add a # in front of the swap disk if you have one and then reboot
After booting cat /proc/swaps to check if zram is enabled or not
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@merothh
merothh / pancakes.sh
Last active July 24, 2020 10:14
pancakes | listing of commands i use to install arch on my laptop. (reference purposes)
pvcreate /dev/sdb2
pvcreate /dev/sda1
vgcreate arch-ssd /dev/sdb2
vgcreate arch-hdd /dev/sda1
lvcreate -L 16G arch-ssd -n arch-swap
lvcreate -l 100%FREE arch-ssd -n arch-root
lvcreate -l 100%FREE arch-hdd -n arch-home
mkswap /dev/arch-ssd/arch-swap
swapon /dev/arch-ssd/arch-swap
@kobeumut
kobeumut / ObserveOnceExtension.kt
Created April 21, 2019 08:24
Android Livedata Observe Once Only (Kotlin)
fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) {
observe(lifecycleOwner, object : Observer<T> {
override fun onChanged(t: T?) {
observer.onChanged(t)
removeObserver(this)
}
})
}
//Using
liveData.observeOnce(this, Observer<Password> {
@kirelagin
kirelagin / safetynet.diff
Last active June 5, 2024 14:13
Android (Lineage OS) kernel patch for SafetyNet
diff --git a/fs/proc/cmdline.c b/fs/proc/cmdline.c
index 14a4c5887848..ebce46d998b0 100644
--- a/fs/proc/cmdline.c
+++ b/fs/proc/cmdline.c
@@ -2,10 +2,13 @@
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
+#include <asm/setup.h>
+
@trandaison
trandaison / starUML.md
Last active July 20, 2024 19:34
Get full version of StarUML
@Aeonitis
Aeonitis / MainActivity.java
Created January 3, 2017 18:45
Android - Check Network State in your app, Notifying you when an app is online/offline
/**
* This would be the activity which registers the receiver class via it's interface
*/
public class MainActivity implements NetworkStateReceiver.NetworkStateReceiverListener {
private NetworkStateReceiver networkStateReceiver; // Receiver that detects network state changes
@Override
protected void onCreate(Bundle savedInstanceState) {
/***/
@romanbb
romanbb / gist:8011102
Last active April 11, 2022 01:58
compile, push, and start SystemUI.apk
#!/bin/bash
. build/envsetup.sh
mmm frameworks/base/packages/SystemUI/
adb start-server
adb shell pkill -TERM -f com.android.systemui
adb remount
adb push $OUT/system/priv-app/SystemUI.apk /system/priv-app/SystemUI.apk
adb shell pkill -TERM -f com.android.systemui
adb shell chmod 0644 /system/app-priv/SystemUI.apk
sleep 2
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"