Skip to content

Instantly share code, notes, and snippets.

View chankruze's full-sized avatar
🎯
Focusing

Chandan Kumar Mandal chankruze

🎯
Focusing
View GitHub Profile
@chankruze
chankruze / twrp-recovery-flags.mk
Created November 24, 2023 07:30 — forked from zawzaww/twrp-recovery-flags.mk
Makefile Flags for Compiling TWRP
# USEFUL TWRP RECOVERY FLAGS
# by ZawZaw @XDA-Developers
# Thanks to : @xda-developers for helps
# Add EXT4 support
TARGET_USERIMAGES_USE_EXT4 := true
# Disable/enable SELinux. Only suggested when you want to enable SELinux support
TWHAVE_SELINUX := true
@chankruze
chankruze / urlretrieve.py
Created June 25, 2021 19:33 — forked from xflr6/urlretrieve.py
Replacement for urllib.urlretrieve(url, filename) using the requests library
# urlretrieve.py - implement urllib.urlretrieve(url, filename) with requests
import contextlib
import urllib
import requests
def urlretrieve(url, filename):
with contextlib.closing(requests.get(url, stream=True)) as r:
r.raise_for_status()
@chankruze
chankruze / netgear-private-key-disclosure.md
Created January 20, 2020 12:04 — forked from nstarke/netgear-private-key-disclosure.md
Netgear TLS Private Key Disclosure through Device Firmware Images

Netgear Signed TLS Cert Private Key Disclosure

Overview

There are at least two valid, signed TLS certificates that are bundled with publicly available Netgear device firmware.

These certificates are trusted by browsers on all platforms, but will surely be added to revocation lists shortly.

The firmware images that contained these certificates along with their private keys were publicly available for download through Netgear's support website, without authentication; thus anyone in the world could have retrieved these keys.

@chankruze
chankruze / gist:66494de8d052408b1f5d18b7add292c8
Created June 18, 2019 17:04 — forked from yqritc/gist:ccca77dc42f2364777e1
Equal column spacing for Android RecyclerView GridLayoutManager by using custom ItemDecoration

ItemOffsetDecoration

public class ItemOffsetDecoration extends RecyclerView.ItemDecoration {

    private int mItemOffset;

    public ItemOffsetDecoration(int itemOffset) {
        mItemOffset = itemOffset;
    }
@chankruze
chankruze / README.md
Created May 29, 2019 21:12
CI with Travis, github Releases API, gh-pages and npm publish

CI with Travis, GitHub Releases API and gh-pages

When hosting a project on GitHub, it's likely you'll want to use GitHub Pages to host a public web site with examples, instructions, etc. If you're not using a continuous integration service like Travis, keeping your gh-pages site up to date requires continuous wrangling.

The steps below outline how to use Travis CI with GitHub Releases and GitHub Pages to create a "1-button" deployment workflow. After testing and running a release build, Travis will upload your release assets to GitHub. It will also push a new version of your public facing site to GitHub Pages.

Organize your project

Let's assume you are hosting a JavaScript project that will offer a single JavaScript file as a release asset. It's likely you'll organize your files like this.

@chankruze
chankruze / opera-vpn.md
Created March 30, 2019 21:54 — forked from spaze/opera-vpn.md
Opera VPN behind the curtains is just a proxy, here's how it works

When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

When loading a page with Opera VPN enabled, the browser sends a lot of requests to de0.opera-proxy.net with Proxy-Authorization request header.

The Proxy-Authorization header decoded: CC68FE24C34B5B2414FB1DC116342EADA7D5C46B:9B9BE3FAE674A33D1820315F4CC94372926C8210B6AEC0B662EC7CAD611D86A3 (that's sha1(device_id):device_password, where device_id and device_password come from the POST /v2/register_device API call, please note that this decoded header is from another Opera installation and thus contains

@chankruze
chankruze / made-with-love.html
Created December 9, 2018 14:20 — forked from oliveratgithub/made-with-love.html
Various HTML-snippets to add "Made with love" to your website
<!-- Example #1 - no styling -->
Made with ❤ in Switzerland
<!-- Example #2 - inline-styled ❤ -->
Made with <span style="color: #e25555;">&#9829;</span> in Switzerland
Made with <span style="color: #e25555;">&hearts;</span> in Switzerland
<!-- Example #3 - CSS-style class for ❤ -->
<style>.heart{color:#e25555;}</style>
Made with <span class="heart"></span> in Switzerland
@chankruze
chankruze / index.html
Created August 22, 2018 08:33 — forked from levonlee/index.html
HTML: Add an announcement box on the top of the website
<body>
<div class="alert-box">
<span class="badge">Announcement</span> Some Text
</div>
</body>
@chankruze
chankruze / buildtwrp.sh
Created March 2, 2018 11:47 — forked from bigbiff/buildtwrp.sh
Build TWRP for devices
#!/bin/bash
TWRPCM10REPO=/data/repos/cm10-twrp
TWRPCM101REPO=/builds/cm10.1-twrp
TWRPOUTDIR=/home/bigbiff/twrp
cm101devices=('n7100' 't0ltecan' 't0lte' 't0ltetmo' 't0lteatt' 't0ltespr' 't0ltevzw' 't03gduoszn' 't0lteskt')
cm10devices=('quincyatt' 'quincytmo')
contains() {
local i j=$1