gleport 最近的时间轴更新
gleport

gleport

V2EX 第 38454 号会员,加入于 2013-05-04 14:00:38 +08:00
网络电台
生活  •  gleport  •  2021-10-27 20:09:53 PM
日常跳板机技巧总结
服务器  •  gleport  •  2019-03-28 07:59:40 AM  •  最后回复来自 blueskit
1
一种实现 HTTPS 抓包的方法
奇思妙想  •  gleport  •  2018-08-07 13:43:35 PM  •  最后回复来自 sola97
14
一种把指定程序的 TCP 流量重定向到代理的方法
  •  5   
    分享创造  •  gleport  •  2021-07-07 21:26:12 PM  •  最后回复来自 gleport
    29
    湖边偶记
    职场话题  •  gleport  •  2018-03-12 20:26:15 PM  •  最后回复来自 gleport
    13
    躺在床上控制床外电脑播放音乐的一种方法
    奇思妙想  •  gleport  •  2017-08-24 16:31:43 PM  •  最后回复来自 fucker
    42
    微信小程序支持后台运行么
  •  1   
    微信  •  gleport  •  2016-10-17 00:26:28 AM  •  最后回复来自 xiqingongzi
    3
    简单的网络文件系统, 支持 Linux 挂载 Windows 的目录
    分享创造  •  gleport  •  2015-09-12 20:58:09 PM  •  最后回复来自 line
    6
    gleport 最近回复了
    tmux 的色彩和在终端上有差异的原因是:tmux 没有为终端开启 RGB 特性,本来应该是 RGB 24 位颜色的 ANSI 转义序列被 tmux 转换为比较接近的 256 色的转义序列,再输出给终端渲染。可以通过 `tmux -vvv` 启动日志查看 RGBCOLOURS flag 确认。

    tmux 也给用户提供了配置来开启 RGB 特性:set -as terminal-features ",根据自己的$TERM 值而定*:RGB"

    另外不推荐 export TERM=tmux-256color 这种方式修改 TERM 环境变量,这个值一般是终端模拟器初始化的时候终端自己设置的,许多外部程序会依赖这个值查询出对应的 terminfo ,从而确定终端特性能力以及在不同输入的行为,比如对 <CTRL>_l 这些控制序列的反应。正如 kitty 在这个配置上的警告说的:


    #: The value of the TERM environment variable to set. Changing this
    #: can break many terminal programs, only change it if you know what
    #: you are doing, not because you read some advice on "Stack Overflow"
    #: to change it. The TERM variable is used by various programs to get
    #: information about the capabilities and behavior of the terminal. If
    #: you change it, depending on what programs you run, and how
    #: different the terminal you are changing it to is, various things
    #: from key-presses, to colors, to various advanced features may not
    #: work. Changing this option by reloading the config will only affect
    #: newly created windows.

    我刚写了一篇 blog 来总结了一下 tmux 在不同终端下颜色差异的原因: https://hmgle.github.io/terminal/tmux/color/2024/05/12/term-color.html
    2022-02-15 18:19:27 +08:00
    回复了 workwonder 创建的主题 程序员 [viaproxy] 我基于 graftcp 封装了一个命令行代理 helper
    忘了 makefile 写法了,请忽略😅
    2022-02-15 18:07:33 +08:00
    回复了 workwonder 创建的主题 程序员 [viaproxy] 我基于 graftcp 封装了一个命令行代理 helper
    很不错!不过发现首层目录缺少 Makefile 导致不能执行 `make -C graftcp`,是否忘提交了?
    2021-07-07 21:26:12 +08:00
    回复了 gleport 创建的主题 分享创造 一种把指定程序的 TCP 流量重定向到代理的方法
    @mjikop1231 和 proxychains 的主要差别是支持 golang 的程序。
    2021-02-25 09:06:22 +08:00
    回复了 iceorange 创建的主题 程序员 cproxy: 使用简单的 Linux per app 透明代理
    回应一下楼主说的 graftcp 每次要起两个程序的问题:graftcp-local 是设计为守护进程方式使用的,"sudo systemctl --now enable graftcp-local.service" 后使用方式和 proxychains 基本一致。
    适合用字典树来实现。把这 100 万个词组从 MySQL 读出存进一棵字典树里,不会消耗多大内存。

    一百多行左右的核心代码就可以完成了:

    ```go
    package main

    import (
    "fmt"

    "github.com/hmgle/trie-x/go/trie"
    )

    func main() {
    t := trie.New()
    t.Insert("yellow wall", 1)
    t.Insert("little cat", 1)
    t.Insert("brown cat", 1)
    t.Insert("yellow dog", 1)
    t.Insert("coffee cup", 1)

    content := "a little cat is sleeping behind a yellow wall with a yellow dog"
    hits := t.ScanContent(content)
    for _, hit := range hits {
    fmt.Printf("word: %s, offset: %d\n", hit.Word, hit.Offset)
    }
    }
    ```

    输出:

    ```
    word: little cat, offset: 2
    word: yellow wall, offset: 34
    word: yellow dog, offset: 53
    ```
    2020-05-06 09:04:42 +08:00
    回复了 1and0 创建的主题 Ubuntu ubuntu 有办法让终端走 proxy 吗?
    浏览了上面的回复,发现不少人对设置代理这方面存在误解。比如:
    设置环境变量 http_proxy=socks5:********。有人提到需要配置 HTTP 协议的而不是 sock5,其实这完全取决于要运行的这个程序认不认,很多软件是支持这种方式的。https://twitter.com/chenshaoju/status/1181780020345233408 这里也提到了。设置环境变量的方法是把选择权完全交给要运行的程序,具有一定局限性。程序读取什么名字的环境变量,怎么转换就是它自己的事情了,有些程序是不支持的。
    2020-05-05 14:17:27 +08:00
    回复了 1and0 创建的主题 Ubuntu ubuntu 有办法让终端走 proxy 吗?
    proxychains 对 Go 编译出来的无效。docker 可以参考 https://github.com/hmgle/graftcp/issues/14
    2020-01-16 11:18:35 +08:00
    回复了 abu666 创建的主题 问与答 问下大佬们如何通过跳板机连接数据库
    之前总结过一些通过跳板机连接 MySQL、Redis 等服务的技巧:
    https://hmgle.github.io/wiki/tip/forwarded_tips.html
    希望能帮到你。
    2019-11-05 18:02:30 +08:00
    回复了 qiuyesuifeng 创建的主题 前端开发 让数据库运行在浏览器里? TiDB + WebAssembly 告诉你答案
    想问一下楼主编译出来的 TiDB wasm 文件有多大。
    我之前刚好也把一个用 Go 写的象棋引擎生成了 wasm 在浏览器运行,动用了 wasm-opt 和 wasm-strip 后,也有 2 MB 多一点,感觉体积还是挺大的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   976 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 22:55 · PVG 06:55 · LAX 15:55 · JFK 18:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.