Skip to content

Instantly share code, notes, and snippets.

@CarsonSlovoka
CarsonSlovoka / README.md
Last active January 13, 2025 03:54
for answer SSH reverse tunneling with ngrok

If you don't have the ~/.ssh/config file, you can create one yourself and then fill it with the content you need.

You can refer to the video around 0:51

This file is just for simplification. In fact, you can also use:

ssh -i ~/.ssh/my_privK -R 443:localhost:80 [email protected] http

@CarsonSlovoka
CarsonSlovoka / config.sh
Last active November 28, 2024 06:11
~./.config/sway/config
output DVI-D-1 mode 1920x1080@60Hz
output DP-1 mode 1920x1080@60Hz
bindsym $left resize shrink width 200px
bindsym $down resize grow height 200px
bindsym $up resize shrink height 200px
bindsym $right resize grow width 200px
bindsym Left resize shrink width 200px
@CarsonSlovoka
CarsonSlovoka / go.mod
Created September 14, 2024 08:39
go draw_text eample: winapi.{TextOut, ExtTextOut}
module demo-draw-text
go 1.23.0
require github.com/CarsonSlovoka/go-pkg/v2 v2.4.2-0.20240619074555-8d486f5913b0
@CarsonSlovoka
CarsonSlovoka / int_range.go
Created September 11, 2024 08:07
demo int range
package main
import (
"fmt"
)
func Example_int8_range() {
for _, val := range []byte{
0b1000_0000,
0b1000_0001,
package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"encoding/pem"
@CarsonSlovoka
CarsonSlovoka / README.md
Last active August 19, 2024 11:24
xml.UnmarshalXML

go想對xml的時間自定義Unmarshal,那麼要滿足 xml.Unmarshaler 接口

type Unmarshaler interface {
	UnmarshalXML(d *Decoder, start StartElement) error
}

go-playground

package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"encoding/base64"
"encoding/pem"
@CarsonSlovoka
CarsonSlovoka / README.md
Created August 2, 2024 03:18
go http chain-middleware
@CarsonSlovoka
CarsonSlovoka / test_glyf.xml
Last active July 17, 2024 09:56
test_glyf data
<TTGlyph name="glyph1358" xMin="49" yMin="-99" xMax="975" yMax="832">
<contour>
<pt x="139" y="685" on="1"/>
<pt x="139" y="660" on="1"/>
<pt x="169" y="620" on="0"/>
<pt x="211" y="546" on="1"/>
<pt x="222" y="563" on="1"/>
<pt x="180" y="633" on="0"/>
</contour>
<contour>