Skip to content

Instantly share code, notes, and snippets.

@adityatelange
adityatelange / janpatch-android-security-10.0.0_r49-android-security-10.0.0_r50.txt
Created January 15, 2021 18:46
Contains patch commits for AOSP 10 january 2021 ASB
project external/freetype/
c3a3f04 Cherry-pick one upstream patch
project external/gptfdisk/
886331c RESTRICT AUTOMERGE ANDROID: Fix negative stack write in sgdisk
project external/libexif/
065ec3f fixes some (not all) buffer overreads during decoding pentax makernote entries.
project frameworks/av/
@adityatelange
adityatelange / recursive_unzip.py
Created January 22, 2021 11:27
recursively unzip a zip file with python
#!/usr/bin/python3
# og source: https://gist.github.com/JamesPHoughton/0f4f269e93a2b85958d8
from zipfile import ZipFile
def unpack_zip(zipfile='', path_from_local=''):
filepath = path_from_local+zipfile
extract_path = filepath.strip('.zip') + '/'
@adityatelange
adityatelange / ngrok-dir-share.txt
Created February 13, 2021 09:27
share directory with ngrok
ngrok http file:///some/dir
# with basic auth
ngrok http file:///some/dir -auth="user:pass"
# credits https://twitter.com/Regala_/status/1360193684663242759?s=20
@adityatelange
adityatelange / Postman.desktop
Created February 19, 2021 05:54
Adding icon launcher for Postman Native App in Ubuntu/GNOME based DE
# location: ".local/share/applications/Postman.desktop"
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Postman
Icon=/opt/Postman/app/resources/app/assets/icon.png
Path=/opt/Postman
Exec=/opt/Postman/Postman
@adityatelange
adityatelange / WhatsAppWeb.md
Created March 15, 2021 08:12
create WhatsAppWeb native app for Ubuntu 20.10
<!-- contents of render-image.html -->
{{- $link := split .Destination "#" }}
{{- $image := (.Page.Resources.ByType "image").GetMatch (printf "*%s*" (index $link 0)) }}
{{- $logo := (resources.Get "images/logo.png") }}
{{- if and $image $logo }}
{{- $size := math.Round (mul $image.Height 0.25) }}
{{- $size := cond (ge $size 80) ($size) (80.0) }}
{{- $logo := $logo.Resize (printf "%.0fx jpg" $size) }}
@adityatelange
adityatelange / youtube_hd.user.js
Created June 3, 2021 17:23 — forked from adisib/youtube_hd.user.js
Make youtube videos in HD and automatically resize
// ==UserScript==
// @name Youtube HD
// @author adisib
// @namespace namespace_adisib
// @description Select a youtube resolution and resize the player.
// @version 2021.01.02
// @match https://www.youtube.com/*
// @noframes
// @grant none
// ==/UserScript==
@adityatelange
adityatelange / ghidra-sre.md
Created July 6, 2021 05:09
Adding Ghidra App Shortcut in Launcher and side bar and ubuntu

Example .desktop at ~/.local/share/applications/ghidra-sre.desktop

[Desktop Entry]
Encoding=UTF-8
Name=Ghidra
Type=Application
Terminal=false
Path=/home/aditya/Apps/ghidra_10.0_PUBLIC/
Exec=/home/aditya/Apps/ghidra_10.0_PUBLIC/ghidraRun
@adityatelange
adityatelange / Qemu-KVM-shrink+compress.MD
Created January 23, 2022 10:53 — forked from nimbosa/Qemu-KVM-shrink+compress.MD
shrink + compress virtual disk image in Qemu/KVM

shrink + compress virtual disk image in Qemu/KVM

originally from Martin Kopta's blog

Tue Apr 22 10:41:10 UTC 2014

In order to shrink virtual disk of your virtual machine (process called disk space reclamation) in Qemu/KVM, you can go with following. In your running virtual machine, fill all remaining empty space with zeroes. Then, shut down virtual machine and convert the disk image from original format to the same format (esentially doing nothing). In the process of conversion, Qemu will skip the zeroes and save you some space. You can even add some compression to save even more space.

root@vm# dd if=/dev/zero of=/file
root@vm# rm /file