Skip to content

Instantly share code, notes, and snippets.

View JokerCatz's full-sized avatar

JokerCatz JokerCatz

View GitHub Profile
@JokerCatz
JokerCatz / cloudflare_tunnel_guide.txt
Last active February 15, 2022 04:23
cloudflare tunnel guide
## install tools
# doc at https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation
## no domain at cloudflare
# https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/trycloudflare
@JokerCatz
JokerCatz / golang_disable_http2_main.go
Last active January 2, 2022 22:08
Redpill of Golang disable http2
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
resty "gopkg.in/resty.v1"
@JokerCatz
JokerCatz / image_merge_main.go
Last active December 28, 2021 15:19
golang image append , support jpg / png / webp
package main
import (
"bytes"
"fmt"
"image"
"image/draw"
"image/jpeg"
"image/png"
"io/ioutil"
// please nowrap to check this file
// source := "ff02ffff01ff02ffff03ffff18ff2fffff010180ffff01ff02ff36ffff04ff02ffff04ff05ffff04ff17ffff04ffff02ff26ffff04ff02ffff04ff0bff80808080ffff04ff2fffff04ff0bffff04ff5fff808080808080808080ffff01ff088080ff0180ffff04ffff01ffffffff4602ff3304ffff0101ff02ffff02ffff03ff05ffff01ff02ff5cffff04ff02ffff04ff0dffff04ffff0bff2cffff0bff24ff3880ffff0bff2cffff0bff2cffff0bff24ff3480ff0980ffff0bff2cff0bffff0bff24ff8080808080ff8080808080ffff010b80ff0180ff02ffff03ff0bffff01ff02ff32ffff04ff02ffff04ff05ffff04ff0bffff04ff17ffff04ffff02ff2affff04ff02ffff04ffff02ffff03ffff09ff23ff2880ffff0181b3ff8080ff0180ff80808080ff80808080808080ffff01ff02ffff03ff17ff80ffff01ff088080ff018080ff0180ffffffff0bffff0bff17ffff02ff3affff04ff02ffff04ff09ffff04ff2fffff04ffff02ff26ffff04ff02ffff04ff05ff80808080ff808080808080ff5f80ff0bff81bf80ff02ffff03ffff20ffff22ff4fff178080ffff01ff02ff7effff04ff02ffff04ff6fffff04ffff04ffff02ffff03ff4fffff01ff04ff23ffff04ffff02ff3affff04ff02ffff04ff09ffff04ff53ffff04ffff02ff26ffff0
@JokerCatz
JokerCatz / ChiaBuildFlow.txt
Last active March 19, 2022 12:20
Chia (XCH) build local private chain (regtest / self testnet) for testing
// chia node need ssl keys when connection , it auto gen ssl keys at init , so no offical open node or endpoint
// need build node , testnet no node to sync , so ... build regtest by self : )
// ============== chia mainnet just need
git clone --depth=1 https://github.com/Chia-Network/chia-blockchain
cd chia-blockchain
sh install.sh
. ./activate
chia init
@JokerCatz
JokerCatz / arweave_or_testweave_error_wrong_network.md
Last active July 1, 2021 08:22
Arweave or Testweave error wrong_network

Arweave or Testweave error wrong_network

easy ... it no doc ... WTF ... like this

if use like this

curl -X POST http://127.0.0.1:1984/peers

will return

@JokerCatz
JokerCatz / vlc_converter_main.go
Last active February 4, 2021 10:06
golang , vlc , mp4 to mp3 , test at macOS , and not stable
package main
import (
"bytes"
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"regexp"
@JokerCatz
JokerCatz / session_share.go
Created April 2, 2020 17:55
Golang get Rails redis session & verify auth token
package main
import (
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"regexp"
"strconv"
@JokerCatz
JokerCatz / session_store.rb
Created January 17, 2020 03:10
Rails6 Redis Session Store (serializer by JSON)
# -*- encoding : utf-8 -*-
Rails.application.config.session_store(
:redis_store,
key: "_#{Rails.application.class.parent_name.downcase}_session",
expire_after: 2.days,
threadsafe: true,
url: "redis://127.0.0.1:6379/8",
)
# Redis session store(serializer by JSON) for Rails 6
# License : WTF License
# for Rails project & put it at %RAILS_APP%/script/i18n_unused_scanner.rb and exec it
# just for fun , only test with OSX
require 'yaml'
require 'open3'
require 'awesome_print'
module I18nUnusedScanner
SEARCH_PATTERNS = %w(js rb erb html)