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 / Compile-Vanila.md
Last active April 6, 2024 07:26
How To Compile OpenWrt Firmware For Any Router

Checking out Source

  • clone latest source repository by git clone https://www.github.com/openwrt/openwrt -b branch_name
  • Now change directory to openwrt by cd openwrt.This is our <buildroot dir> for this guide.

Updating Feeds

  • Update feeds: ./scripts/feeds update -a
  • Make downloaded package(s) available in make menuconfig:
    • single package : ./scripts/feeds install <PACKAGENAME>
    • all packages : ./scripts/feeds install -a

Image Configuration

@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
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def ReturnJSON():
if request.method == 'POST':
data = {"event": "Message Receive",
"messageID": "wamid.HBgMOTE4MTQ0MzU2NzY3FQIAEhggN0MxQUZCNDg2OTc1ODBBMTIxREQ0MDIwMzkyNTRDQ0IA",

fix: /usr/bin/env: ‘bash\r’: No such file or directory

Check your path, echo $PATH. WSL2 normally imports Windows path there. To fix this create file /etc/wsl.conf in WSL2:

[interop]
appendWindowsPath = false

Then restart WSL2 with wsl --shutdown. Then check your path is shorter now and doesn't include any Windows dependencies: echo $PATH

How to turn off Windows Defender in Windows 10/11 permanently

Step 1. Boot into safe mode

Click on Windows Start and search for msconfig. Run System Configuration as administrator.

image

You can also start the program Run. Type msconfig and click on OK.

/*
Author: chankruze (chankruze@gmail.com)
Created: Wed Mar 09 2022 10:06:36 GMT+0530 (India Standard Time)
Copyright (c) geekofia 2022 and beyond
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Using JS, convert:

[ "OR", ["<", "a", "b"], [ "AND", ["==", "c", "d"], ["!=", "e", "f"] ] ]
// To:
a < b OR (c == d AND e != f)

Installing Jenkins

  1. Install Java
$ sudo apt update
$ sudo apt install openjdk-8-jdk
  1. Add the Jenkins Debian repository
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
const rgb2hex = (...args) => {
const hexColour = (c) => {
if (c < 256) return Math.abs(c).toString(16).padStart(2, "0");
return 0;
}
let hex = "#";
args.forEach(val => hex += hexColour(val))
return hex
}