Skip to content

Instantly share code, notes, and snippets.

View itsuwari's full-sized avatar

Lyndon Wu itsuwari

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