Skip to content

Instantly share code, notes, and snippets.

View brosahay's full-sized avatar
🎯
Focusing

Rohan S brosahay

🎯
Focusing
View GitHub Profile
@brosahay
brosahay / adb-sync.md
Created January 25, 2021 11:15
Using `adb-sync` in Windows 10 WSL

ADB Sync on WSL 2

  • Disable firewall for WSL vEthernet so that the Windows adb binary can communicate with the Linux adb package and start the adb server on Windows side.

    Set-NetFirewallProfile -DisabledInterfaceAliases "vEthernet (WSL)"
    adb -a -P 5037 nodaemon server
  • Connect to the adb server on Windows from WSL.

@brosahay
brosahay / dumb-ap-wired-link.sh
Created May 9, 2021 19:42 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@brosahay
brosahay / OpenWRT-LEDE-uci-defauls-TP-LINK-factory-SSID-KEY.sh
Created May 10, 2021 02:38 — forked from braian87b/OpenWRT-LEDE-uci-defauls-TP-LINK-factory-SSID-KEY.sh
OpenWRT - LEDE uci-defaults for TP-LINK Routers for default factory SSID and KEY
@brosahay
brosahay / wireless-link-wds.sh
Created May 10, 2021 02:39 — forked from braian87b/wireless-link-wds.sh
How to setup Wireless Links to avoid Wired backbone using WDS on Atheros for OpenWRT / LEDE
@brosahay
brosahay / relayd-igmpproxy.sh
Created May 10, 2021 02:39 — forked from braian87b/relayd-igmpproxy.sh
How to setup Client Bridged / Client Mode / RelayD and IGMPProxy for OpenWRT / LEDE
# Client Bridged / Client Mode / RelayD and IGMPProxy (It works)
# RelayD is to redirect packages and IGMP is for redirect IGMP packages
# Our network is 192.168.1.0/24
# Steps:
# Configure WAN as static
# We should edit our wan iface and put static IP
uci set network.wan='interface'
uci set network.wan.proto='static'
uci set network.wan.ipaddr='192.168.1.239' # Main Network IP
@brosahay
brosahay / additional-vlan3-for-wan2.sh
Created May 10, 2021 02:39 — forked from braian87b/additional-vlan3-for-wan2.sh
Additional VLAN 3 for WAN2 on tl-wr1043nd-v2, tl-wdr3600-v1 and tl-wdr4300-v1 OpenWRT / LEDE
# This is done by luci (it just sets defaults and assigns an ID to each vlan entry)
uci set network.@switch[0].mirror_source_port='0'
uci set network.@switch[0].mirror_monitor_port='0'
uci set network.@switch_vlan[0].vid='1'
uci set network.@switch_vlan[1].vid='2'
# For tl-wr1043nd-v2:
# Switch, LAN (on tl-wr1043nd-v2 we must enable tagging on CPU port 0)
uci set network.@switch_vlan[0].ports='0t 1 2 3 4' # previously '0 1 2 3 4'
# Switch, WAN
@brosahay
brosahay / image-builder-openwrt-lede.sh
Created May 14, 2021 20:27 — forked from braian87b/image-builder-openwrt-lede.sh
Image-Builder Procedure for OpenWRT - LEDE
# ------------------------------------------------------------------------
# Image-Builder Procedure for OpenWRT - LEDE (In this case using Debian x64 NetInstall virtual machine)
# ------------------------------------------------------------------------
su
apt-get update # Optional, make and upgrade too in case it has too many old pakackes.
apt-get install make aria2 screen ncftp -y
screen -
cd ~
@brosahay
brosahay / gist-backup.py
Created May 14, 2021 20:28
Clone all my gists automatically (gist backup?)
#!/usr/bin/env python
# Git clone all my gists
import json
import urllib
from subprocess import call
from urllib import urlopen
import os
USER = os.environ['USER']
#!/bin/sh
################################################################
# Individual channel setting per distinct AP
case `uci get system.@system[0].hostname` in
"ap1")
CHANNELS="36 1"
;;
"ap2")
@brosahay
brosahay / Data+PrettyPrint.swift
Created February 9, 2022 20:15 — forked from cprovatas/Data+PrettyPrint.swift
Pretty print JSON string from Data in Swift 4.1 (especially useful printing to Xcode console)
import Foundation
extension Data {
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription
guard let object = try? JSONSerialization.jsonObject(with: self, options: []),
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]),
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil }
return prettyPrintedString
}