Skip to content

Instantly share code, notes, and snippets.

View fkztw's full-sized avatar
📺
Hello World!

Frank Zheng fkztw

📺
Hello World!
  • Taiwan
  • 09:48 (UTC +08:00)
View GitHub Profile
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active September 17, 2024 18:08
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@david50407
david50407 / 00-README.md
Last active August 17, 2021 06:48
Open GitHub in VS Code Remote Repository without cloning repo

Open GitHub repo with VSCode Remote Repository

How to use

Configuration

@magickatt
magickatt / cloudbuild.yaml
Created August 10, 2021 15:31
Add deploy key to SSH agent forwarding for Docker build in Google Cloud Build
- name: 'gcr.io/cloud-builders/git'
secretEnv: ['SSH_KEY']
entrypoint: 'bash'
args:
- -c
- |
echo "$$SSH_KEY" >> /root/.ssh/id_rsa
chmod 400 /root/.ssh/id_rsa
volumes:
- name: 'ssh'
@dino-su
dino-su / README.md
Last active June 8, 2020 03:15
Pocket 的延伸閱讀功能
@markkcc
markkcc / switching-to-webdrivers-gem.md
Last active November 23, 2023 07:00
Fixing Chromedriver compatibility issues in Heroku

Fixing Selenium Webdriver Compatibility Errors in Heroku

The Problem

If you are using the chromedriver and Google Chrome Heroku buildpacks together, you may run into a driver compatibility issue with the version of chrome installed.

Example error:

Selenium::WebDriver::Error::SessionNotCreatedError (session not created: This version of ChromeDriver only supports Chrome version 83):
@adolli
adolli / 如何使用python3逃逸沙箱,获得进程上下文权限提升.md
Last active April 30, 2024 13:07
如何使用python3逃逸沙箱,获得进程上下文权限提升

如何使用python3逃逸沙箱,获得进程上下文权限提升

最近突发奇想,想对所掌握的python知识进行总结一下,目前其实还停留在python层面如何使用,还没有深入到虚拟机部分,如果下面有哪些错误,欢迎指出。

背景

OJ(Online judge, 在线编程测评提交代码到后台运行检查)网站一般都允许各种各样的代码提交,其中很有可能包含python3,于是决定尝试通过python3的代码执行,进行沙箱逃逸,以及绕过各种限制。

我随便找了一个OJ网站,这个站点的python3有如下限制

@apua
apua / gòngfěi_fish.jl
Last active June 10, 2021 11:05 — forked from fkztw/korean_fish.py
Yet another chatbot
# Julia 1.0.3
buzzwords = (
"自經區", "自貿區",
"摩天輪", "愛情摩天輪", "愛情產業鏈",
"發大財", "愛河的水甘甘", "選總統",
"迪士尼",
"F1", "F1賽車場", "F1 賽車場",
"賭馬", "賽馬",
"九二共識", "一中各表", "一國兩制", "兩岸統一",
)
@johncantrell97
johncantrell97 / satoshistreasure.md
Last active April 15, 2023 15:09
How I Obtained Satoshi's Treasure Keys 1, 2, and 3 in Minutes

Today (April 16th 2019 at noon) the first major clues to discover key #1 was set to be released in a few cities. A QR code with the words 'orbital' were found at these locations and looked like this: (https://imgur.com/a/6rNmz7T). If you read the QR code with your phone you will be directed to this url: https://satoshistreasure.xyz/k1

At this URL you are prompted to input a passphrase to decrypt the first shard. An obvious first guess was to try the word 'orbital' from the QR code. Not suprisingly this worked! This reveals a congratulations page and presents the first key shard:

ST-0001-a36e904f9431ff6b18079881a20af2b3403b86b4a6bace5f3a6a47e945b95cce937c415bedaad6c86bb86b59f0b1d137442537a8.

Now, we were supposed to wait until April 17th to get clues from the other cities for keys #2 and #3 but that wouldn't stop me from digging around with all the new information we had. All that time "playing" notpron (http://notpron.org/notpron/) years ago was going to help me here.

The first thing I noticed was

@apua
apua / 00__origin_code.py
Last active August 11, 2018 09:28
an obfuscation code
# source: https://twitter.com/dabeaz/status/1018134539917512704
# output -> ****666****
print(f'''{(lambda f: (lambda x: (f()(lambda: (x()(x))))) (lambda:
(lambda x: (f()(lambda: (x()(x)))))))(lambda: (lambda r:
(lambda n: (lambda x: x()(lambda: (lambda x: (lambda y:
y())))(lambda: (lambda x: x()(lambda: (lambda x: (lambda y:
y())))(lambda: (lambda x: (lambda y: x())))))(lambda: (lambda
x: (lambda y: y()))))(n) (lambda: (lambda f: (lambda x: x())))
(lambda: (n()(lambda: (lambda n: (lambda f: (lambda x:
@jonathan-kosgei
jonathan-kosgei / timer.py
Last active June 14, 2021 05:01
Python Decorator to Time a Function
""" A simple decorator that times the duration of a function's execution. More info on Decorators at https://pythonconquerstheuniverse.wordpress.com/2009/08/06/introduction-to-python-decorators-part-1/"""
import timeit
def timer(function):
def new_function():
start_time = timeit.default_timer()
function()
elapsed = timeit.default_timer() - start_time
print('Function "{name}" took {time} seconds to complete.'.format(name=function.__name__, time=elapsed))
return new_function()