Skip to content

Instantly share code, notes, and snippets.

View itsuwari's full-sized avatar

Lyndon Wu itsuwari

View GitHub Profile
@itsuwari
itsuwari / china-dnsmasq.conf
Created March 11, 2023 03:12
China dnsmasq.conf
This file has been truncated, but you can view the full file.
server=/0-100.com/114.114.114.114
server=/0-6.com/114.114.114.114
server=/00.net/114.114.114.114
server=/000.link/114.114.114.114
server=/00000.host/114.114.114.114
server=/00042.com/114.114.114.114
server=/00058.com/114.114.114.114
server=/0006266.com/114.114.114.114
server=/0007.net/114.114.114.114
server=/000714.xyz/114.114.114.114
@itsuwari
itsuwari / Install environment.sh
Last active July 25, 2022 17:01
Install openresty with Fancyindex
#!/bin/bash
#Install base pakages
sudo apt-get -y update && apt upgrade -y
sudo apt-get -y install ntpdate man man-db mtr ipset iperf3 dnsmasq python3-pip curl aria2 python3-lxml \
fuse build-essential git zip libpcre3-dev libevent-dev libssl-dev libcurl4-openssl-dev libgd-dev libgeoip-dev libpq-dev libxslt1-dev \
software-properties-common autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts \
autoconf libtool pkg-config python3-dev libssl-dev
sudo apt-get autoremove -y
# Update time
@itsuwari
itsuwari / sending-raw-ethernet-packets-from-a-specific-interface-in-c-on-linux.c
Created August 22, 2017 14:47
Sending raw Ethernet packets from a specific interface in C on Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@itsuwari
itsuwari / topsis.py
Created March 15, 2020 18:46
Topsis in Python
import numpy as np
import warnings
class topsis:
a=None #Matrix
w=None #Weight matrix
r=None #Normalisation matrix
m=None #Number of rows
n=None #Number of columns
aw=[] #worst alternative
ab=[] #best alternative
@itsuwari
itsuwari / login.py
Last active September 11, 2019 04:37
import urllib2
import urllib
from time import sleep
def login(username, passwd, v6):
post_t = {
'0MKKey': '123456789',
'v6ip': v6,
'DDDDD': username,
'upass': passwd
#For ASUS AC66u
#ID = ps | grep odhcp6c
odhcp6c -df -R -s /tmp/dhcp6c -N try -c 00030001708bcdcc8ec8 -FP 0:c8ec8 -r23 -r24 -r82 -r83 eth0
apt-get install -y git build-essential protobuf-compiler protobuf-c-compiler
autogen pkg-config\
libtalloc-dev libreadline-dev libpam0g-dev libhttp-parser-dev libpcl1-dev \
libgnutls28-dev libev-dev libprotobuf-c-dev libhttp-parser-dev libseccomp-dev gnutls-bin autoconf;
wget 'ftp://ftp.infradead.org/pub/ocserv/ocserv-0.11.8.tar.xz'
tar xvf ocserv*xz && rm oc*xz*
cd ocserv*
./configure --prefix=/usr --sysconfdir=/etc
make && make install
user daemon
# PID file
pidfile /var/run/sniproxy.pid
resolver {
nameserver 114.114.114.114
mode ipv4_first
}
{
"file": 1,
"format": 1
}{
"trackers": [
{
"url": "http://tracker.tfile.me:80/announce"
},
{
"url": "http://share.camoe.cn:8080/announce"
<link rel="stylesheet" href="https://comment.back.re/dist/iDisqus.min.css" />
<script src="https://comment.back.re/dist/iDisqus.min.js"></script>
<div id="comment"></div>
var disq = new iDisqus('comment', {
forum: 'hampus-blog',
api: 'https://comment.back.re/api',
site: 'https://back.re',
mode: 1,
timeout: 3000,
init: true