This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("patching started.") | |
Object.defineProperty(process, "platform", { get() { return "linux" }, }) | |
const os = require('os'); | |
var old_networkInterfaces = os.networkInterfaces | |
// console.log(old_networkInterfaces); | |
function wrap_net() | |
{ | |
var networkInterfaces = old_networkInterfaces() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
def scrape_hn(): | |
url = 'https://news.ycombinator.com/' | |
proxies = { | |
'http': 'http://192.168.1.66:8118', | |
'https': 'http://192.168.1.66:8118' | |
} | |
response = requests.get(url, proxies=proxies) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import filedialog, messagebox, ttk, simpledialog | |
from moviepy.editor import VideoFileClip, concatenate_videoclips | |
from threading import Thread | |
import sys | |
def adjust_resolution(clip, target_resolution): | |
# Function to adjust video resolution while keeping the aspect ratio | |
target_width, target_height = target_resolution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import OpenSSL.crypto as crypto | |
import sys | |
def progress_bar(current, total): | |
"""Print a progress bar to the console.""" | |
progress = float(current) / float(total) | |
bar_length = 40 | |
filled_length = int(round(bar_length * progress)) | |
bar = '=' * filled_length + '-' * (bar_length - filled_length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clist = document.getElementsByClassName("inner_page");//change class name to yours or use other getElementXXX functions | |
var newTab = window.open('about:blank','canvase_to_image'); //need enable popup window for current site | |
for(ind=0;ind<clist.length;ind++){ | |
var dataURL = clist[ind].toDataURL("image/png"); | |
newTab.document.write("<img src='" + dataURL + "' alt='"+clist[ind].id+"'/><br/>"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Clash auto switch", | |
"nodes": [ | |
{ | |
"parameters": {}, | |
"name": "Start", | |
"type": "n8n-nodes-base.start", | |
"typeVersion": 1, | |
"position": [ | |
240, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Youtube Link: https://www.youtube.com/watch?v=PgLjwl6Br0k | |
import tkinter as tk | |
from tkinter import filedialog, messagebox, ttk | |
import pandas as pd | |
# initalise the tkinter GUI | |
root = tk.Tk() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# def xterm(): | |
# from tkinter import * | |
# import os | |
# root = Tk() | |
# termf = Frame(root, height=400, width=500) | |
# termf.pack(fill=BOTH, expand=YES) | |
# wid = termf.winfo_id() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50543fc0bca1bb4f21300f0074990f846a8009febded0b2198324c1b31d2e2563c908dcabbc461f194e70527e03a807e9a478f9a56f7 | |
66bbd551d9847c1a10755987b43f8b214ee9c6ec2949eef01321b0bc42cffce6bdbd604924e5cbd99b7c56cf461561186921087fa1e9 | |
44fc6f82bdd0dff9aca3e0e82cbb9d6683516524c245494b89c272a83d2b88452ec0bfa0a73ffb42e304fe3748896111b9bdf4171903 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.stats import entropy | |
def bytes_entropy(target_bytes,base=None): | |
v,c = np.unique([int(i) for i in target_bytes],return_counts=True) | |
if base is None: | |
base = len(target_bytes) | |
if base >256: | |
base = 256 | |
return entropy(c,base=base) |
NewerOlder