Skip to content

Instantly share code, notes, and snippets.

let () =
let sock = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in
let address = Unix.inet_addr_of_string "127.0.0.1" in
let socket_address = Unix.ADDR_INET (address, 22) in
Unix.connect sock socket_address;
let buffer = Bytes.create 1024 in
let len = Unix.read sock buffer 0 (Bytes.length buffer) in
Printf.printf "%d %s" len (Bytes.to_string buffer)
@hellojukay
hellojukay / proxy_server.go
Last active May 12, 2022 08:39
A http(s) proxy server
package main
import (
"bytes"
"fmt"
"io"
"log"
"net"
"regexp"
"strings"
@hellojukay
hellojukay / git-open
Last active December 8, 2021 02:42
通过命令行在浏览器中打开当前仓库
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
GetOptions("p|pipeline" => \(my $pipeline),
"h|help" => \(my $help));
sub usage($) {
@hellojukay
hellojukay / download
Last active February 9, 2023 09:29
下载 m3u8 电视剧
#!/usr/bin/env python
import sys
import os
import re
data = sys.stdin.readlines()
for line in data:
url,name = re.compile("[\s\t]+").split(line.rstrip())
# https://github.com/oopsguy/m3u8 使用这个 golang 写的小工具来下载 m3u8 链接
@hellojukay
hellojukay / tomp3.go
Last active December 5, 2022 03:12
转化 wma 格式音频文件为 mp3 格式
package main
import (
"flag"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"sync"