Skip to content

Instantly share code, notes, and snippets.

View NNdroid's full-sized avatar
🎯
Focusing

NNdroid

🎯
Focusing
View GitHub Profile
@JaysonChiang
JaysonChiang / api.ts
Last active October 31, 2024 06:54
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;
@RajithaKumara
RajithaKumara / LocalServerSocket.md
Created September 20, 2019 13:45
Android create Unix domain socket by bound file descriptor

Android create Unix domain socket by bound file descriptor

Android provide LocalServerSocket and LocalSocket to create Unix domain sockets for local interprocess communication (IPC). Unix socket address can behave in three types[1],

  • pathname
  • unnamed
  • abstract

LocalServerSocket provide two public constructors for create socket in Linux abstract namespace[2] and create socket using file descriptor that's already been created and bound[3].

Create LocalServerSocket using [FileDescriptor](https://docs.oracle.com/javase/7/docs/api/j

@miguelmota
miguelmota / main.go
Created December 29, 2018 01:14
Golang file descriptor opening and closing example
package main
import (
"fmt"
"log"
"os"
"syscall"
)
func main() {
@HeraclesJam
HeraclesJam / [aria2] aria2.conf
Last active March 27, 2023 03:58
aria2.conf 設定檔的範例
## Basic Options ##
# 下載目錄
dir=/mnt/usb
# 進度紀錄
input-file=/mnt/usb/.aria2/aria2.session
# 同時進行任務數
max-concurrent-downloads=10
# 斷線續傳
continue=true
@wilhelmy
wilhelmy / dirlist.xslt
Last active June 5, 2023 10:44
make nginx dirlistings look like lighttpd's through the magic of xslt-transforming xml dirlistings. I don't even.
<?xml version="1.0"?>
<!--
dirlist.xslt - transform nginx's into lighttpd look-alike dirlistings
I'm currently switching over completely from lighttpd to nginx. If you come
up with a prettier stylesheet or other improvements, please tell me :)
-->
<!--
Copyright (c) 2016 by Moritz Wilhelmy <mw@barfooze.de>
@lopspower
lopspower / README.md
Last active August 16, 2024 15:51
All Android Directory Path

All Android Directory Path

Twitter

1) System directories

⚠️ We can't write to these folers

Method Result
@tomasinouk
tomasinouk / snat_dnat_advantech.md
Last active October 1, 2024 09:00
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP