Skip to content

Instantly share code, notes, and snippets.

View wujiyu115's full-sized avatar
🎯
Focusing

farwmarth wujiyu115

🎯
Focusing
View GitHub Profile
@newrerio
newrerio / trojan-go_install.sh
Last active April 14, 2022 00:59
trojan-go一键安装
#!/bin/bash
#=================================================
# System Required: :Debian 9+/Ubuntu 18.04+/Centos 7+
# Description: Trojan&V2ray&SSR script
# Version: 1.0.0
# Author: Jeannie
# Blog: https://jeanniestudio.top/
# Official document: www.v2ray.com
#=================================================
sh_ver="1.0.0"
@namidairo
namidairo / pppd-cve.py
Last active January 25, 2022 08:05
Xiaomi RM2100 1.0.14 vs. CVE-2020-8597
from scapy.all import *
from socket import *
interface = "enp0s31f6"
def mysend(pay,interface = interface):
sendp(pay, iface = interface)
def packet_callback(packet):
@moyaldror
moyaldror / remove_git_submodule.sh
Last active August 3, 2021 04:51
Complete remove of git submoule
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <submodule full name>"
exit 1
fi
MODULE_NAME=$1
MODULE_NAME_FOR_SED=$(echo $MODULE_NAME | sed -e 's/\//\\\//g')
@xebecnan
xebecnan / reload_adb_devices.py
Created January 6, 2018 03:37
reload_adb_devices.py
#!/usr/bin/python
import re
import sys
from subprocess import Popen, PIPE, STDOUT
def print_lines(tag, lines):
lines = str(lines).splitlines()
n = len(tag)
n += (4 - (n % 4)) % 4
@akaxxi
akaxxi / RPi-aria2-with-webui.sh
Created October 11, 2016 12:21
Install Aria2 and webui on Raspberry Pi with one simple script.
#!/bin/sh
DOWNLOAD_DIR="${HOME}/MiniDLNA"
CONFIG_DIR="${HOME}/.aria2"
RPC_TOKEN="changeIt"
RPC_PORT="6800"
change_apt_source(){
if [ -f /etc/apt/sources.list ]; then
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
@eliangcs
eliangcs / tornado_subprocess.py
Last active January 7, 2020 08:48
A minimal web server that runs shell commands, powered by Tornado and its Subprocess module
"""
A minimal web server that runs shell commands, powered by Tornado and its
Subprocess module. It does non-blocking IO and streams the response.
To start the server:
$ python tornado_subprocess.py
To send a shell command using httpie:
@stephenturner
stephenturner / install-gcc48-linuxbrew-centos6.md
Last active March 6, 2022 02:49
Installing gcc 4.8 and Linuxbrew on CentOS 6

Installing gcc 4.8 and Linuxbrew on CentOS 6

The GCC distributed with CentOS 6 is 4.4.7, which is pretty outdated. I'd like to use gcc 4.8+. Also, when trying to install Linuxbrew you run into a dependency loop where Homebrew's gcc depends on zlib, which depends on gcc. Here's how I solved the problem.

Note: Requires sudo privileges.

Resources:

@brunocribeiro
brunocribeiro / SendEmailOffice365.java
Created June 2, 2015 00:05
JavaMail samples using Office365 SMTP
import java.util.Date;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
@huqi
huqi / trial.key
Created April 11, 2015 09:01
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@floer32
floer32 / python_bind_function_as_method.py
Created February 11, 2015 01:42
Bind Python function as method
# based on: http://stackoverflow.com/questions/1015307/python-bind-an-unbound-method#comment8431145_1015405
def bind(instance, func, as_name):
""" Turn a function to a bound method on an instance
.. doctest::
>>> class Foo(object):
... def __init__(self, x, y):
... self.x = x
... self.y = y