Skip to content

Instantly share code, notes, and snippets.

View itsuwari's full-sized avatar

Lyndon Wu itsuwari

View GitHub Profile
@itsuwari
itsuwari / chrome_service.py
Created February 16, 2017 16:57
Use flask, Selenium, Chrome to get HTML or JSON, JSONP.
import os
from selenium import webdriver
from pyvirtualdisplay import Display
from flask import Flask, abord, request
app = Flask(__name__)
key = 'your secret key'
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
@itsuwari
itsuwari / python_pptv_downloader.py
Created February 22, 2017 15:38
This script will get play urls form PPTV
import re
import requests
# Use same session
s = requests.Session()
from time import sleep
# DEPRECATED in favor of match1()
def r1(pattern, text):
m = re.search(pattern, text)
if m:
@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
apt-get install xfce4 xfce4-goodies gnome-icon-theme tightvncserver -y
# adduser vnc
Give a password to your new user. You can skip all other questions by simply pressing ENTER.
Install sudo by executing this command:
apt-get install sudo
Add your new vnc user to the sudo group, which will give permissions to that user to execute root commands.
gpasswd -a vnc sudo
@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>

Keybase proof

I hereby claim:

  • I am itsuwari on github.
  • I am rikawu (https://keybase.io/rikawu) on keybase.
  • I have a public key whose fingerprint is AF98 B9E3 4B86 6057 2F09 CF03 FF83 57D7 2976 23D6

To claim this, I am signing this object:

@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 / x.s
Last active November 16, 2017 15:08
TITLE integer summation Program
;
;
;
;
INCLUDE Irvine32.inc
INTERGER_COUNT = 3
.data
str1 byte "enter a signe integer:",0
<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
{
"file": 1,
"format": 1
}{
"trackers": [
{
"url": "http://tracker.tfile.me:80/announce"
},
{
"url": "http://share.camoe.cn:8080/announce"