Skip to content

Instantly share code, notes, and snippets.

@fs000x
fs000x / ByteArray.kt
Created March 12, 2020 08:53 — forked from fabiomsr/ByteArray.kt
ByteArray and String extension to add hexadecimal methods in Kotlin
private val HEX_CHARS = "0123456789ABCDEF".toCharArray()
fun ByteArray.toHex() : String{
val result = StringBuffer()
forEach {
val octet = it.toInt()
val firstIndex = (octet and 0xF0).ushr(4)
val secondIndex = octet and 0x0F
result.append(HEX_CHARS[firstIndex])
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global http.proxy "socks5://127.0.0.1:1080"
@fs000x
fs000x / gist:2f6b8fa1e3caecf2a11f55626df138cf
Created December 13, 2018 01:24 — forked from vnsam/gist:187be13c408b291f9b9c0a28c72fb7ff
Pro version key for Beyond Compare - v4.2.3.22587
This can be used in Mac by using following trick:
Open trial.key at path: /Applications/Beyond\ Compare.app/Contents/Resources/trial.key
Replace content of trial.key with:
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
q2Kw2pjoiDs5gIH-uw5U49JzOB6otS7kThBJE-H9A76u4uUvR8DKb+VcB
rWu5qSJGEnbsXNfJdq5L2D8QgRdV-sXHp2A-7j1X2n4WIISvU1V9koIyS
@fs000x
fs000x / hshy_checkin.py
Created June 8, 2018 05:16 — forked from ficapy/hshy_checkin.py
练手python脚本,登陆Discuz论坛打卡签到
# -*- coding: utf-8 -*-
import requests
import hashlib
import re
username = '' ###账号###
password = ''###密码###
UA = "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) \
Chrome/27.0.1453.116 Safari/537.36"
headers = {
@fs000x
fs000x / clock_init_exynos4412.i
Last active May 9, 2018 15:05
Tiny4412 SDK1312 clock set
# 1 "arch/arm/mach-exynos/clock_init_exynos4412.c"
# 1 "/home/dell/git/new_tiny4412/u-boot-2018.01//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "././include/linux/kconfig.h" 1
# 1 "include/generated/autoconf.h" 1
# 5 "././include/linux/kconfig.h" 2
@fs000x
fs000x / dh.c
Created April 16, 2018 02:24 — forked from cloudwu/dh.c
Diffie-Hellman Key Exchange
// The biggest 64bit prime
#define P 0xffffffffffffffc5ull
#define G 5
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
// calc a * b % p , avoid 64bit overflow