Skip to content

Instantly share code, notes, and snippets.

View Karl-Han's full-sized avatar

Kunlin Han Karl-Han

View GitHub Profile
@Karl-Han
Karl-Han / cloudflare_reverseproxy.html
Last active September 6, 2020 06:47
revise version of HTML for ukuq / cloudflare
<html>
<head>
<style>
.content{
position: absolute;
left: 50%;
top: 30%;
margin: -50px 0 0 -50px;
}
</style>
@Karl-Han
Karl-Han / host-amuse.zsh-theme
Created June 10, 2020 10:48
customized theme based on amuse.
# vim:ft=zsh ts=2 sw=2 sts=2
# Must use Powerline font, for \uE0A0 to render.
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}\uE0A0 "
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹"
import newspaper
import json
source_list = []
def run():
for url in source_list:
scrap(url)
def scrap(url):
[package]
name = "async-await-echo"
version = "0.1.0"
authors = ["Karl Han <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# The latest version of the "futures" library, which has lots of utilities
#![cfg(feature="unstable")]
extern crate futures;
extern crate hyper;
use {
hyper::{
// Miscellaneous types from Hyper for working with HTTP.
Body, Client, Request, Response, Server, Uri,
// This function turns a closure which returns a future into an
@Karl-Han
Karl-Han / dec_rsa.cpp
Created October 29, 2019 15:05
Attack RSA
#include <gmp.h>
#include <iostream>
#include "dec.h"
using namespace std;
const char* N_str =
"10715086071862673209484250490600018105614048117055336074437503883703510511"
"24936122493198378815695858127594672917553146900293377082438286592673040090"
"27987431371873358107053098846355341597977322595205943373851868976298683624"
@Karl-Han
Karl-Han / test.c
Created October 21, 2019 03:57
Test for gf28
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
short multiply(short a, short b, short xor_num) {
short res = 0;
while (a && b) {
if (b & 1) {
res ^= a;
data segment
one_word dw 0110111000101001B
data ends
stack1 segment para stack
dw 10h dup(0)
stack1 ends
codeseg segment
start:
data segment
err db 'ERROR','$'
data ends
stack1 segment para stack
dw 10h dup(0)
stack1 ends
codeseg segment
start:
data segment
array db 1,-2,8,-23,-24,76,-98,123,25,82
sizeArr db 10
bmax db ?
bmin db ?
data ends
stack1 segment para stack
dw 20h dup(0)
stack1 ends