Skip to content

Instantly share code, notes, and snippets.

View itsuwari's full-sized avatar

Lyndon Wu itsuwari

View GitHub Profile
@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
@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 / 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 / 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 / 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