Skip to content

Instantly share code, notes, and snippets.

View newrerio's full-sized avatar
🌴
On vacation

大鸟 newrerio

🌴
On vacation
View GitHub Profile
@newrerio
newrerio / clash-config-trojan.yml
Last active December 19, 2022 11:09
clash-config-trojan.yml
port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: silent
external-controller: 127.0.0.1:9090
dns:
enable: true
ipv6: false
listen: 127.0.0.1:5450
@Ta180m
Ta180m / WSL 2 GNOME Desktop.md
Last active May 20, 2024 17:13
Set up a GNOME desktop environment on WSL 2

WSL 2 GNOME Desktop

NOTE: If you want the ultimate Linux desktop experience, I highly recommend installing Linux as your main OS. I no longer use Windows (except in a VM) so I will not be maintaining this guide anymore.

Think Xfce looks dated? Want a conventional Ubuntu experience? This tutorial will guide you through installing Ubuntu's default desktop environment, GNOME.

GNOME is one of the more complex — and that means more difficult to run — desktop environments, so for years people couldn't figure [o

@newrerio
newrerio / slice_trick.md
Last active January 22, 2021 08:10
slice trick

Since the introduction of the append built-in, most of the functionality of the container/vector package, which was removed in Go 1, can be replicated using append and copy.

Here are the vector methods and their slice-manipulation analogues:

AppendVector

a = append(a, b...)

Copy

使用SSH方式登录谷歌云服务器

通过网页端登录Google Cloud

切换到root用户

sudo su

修改root密码

@newrerio
newrerio / trojan-go_install.sh
Last active April 14, 2022 00:59
trojan-go一键安装
#!/bin/bash
#=================================================
# System Required: :Debian 9+/Ubuntu 18.04+/Centos 7+
# Description: Trojan&V2ray&SSR script
# Version: 1.0.0
# Author: Jeannie
# Blog: https://jeanniestudio.top/
# Official document: www.v2ray.com
#=================================================
sh_ver="1.0.0"
@miguelmota
miguelmota / crypto.go
Last active November 8, 2022 17:08
Golang Blake2b hash example
package crypto
import (
"golang.org/x/crypto/blake2b"
)
// NewBlake2b256 ...
func NewBlake2b256(data []byte) []byte {
hash := blake2b.Sum256(data)
return hash[:]
@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 20, 2024 08:42
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

git config --global https.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
npm config delete proxy
@fhferreira
fhferreira / beanstalkd.bat
Created November 7, 2014 01:28
Use Beanstalkd into Windows
C:\Users\MyUser\Downloads\beanstalkd-1.4.6-cygwin\bin\beanstalkd.exe -l 127.0.0.1 -p 11300
@jpetitcolas
jpetitcolas / parsing-binary-file.go
Last active July 27, 2020 12:40
How to parse a binary file in Go? Snippet based on MoPaQ SC2 replay parsing. Related blog post: http://www.jonathan-petitcolas.com/2014/09/25/parsing-binary-files-in-go.html
package main
import (
"bytes"
"encoding/binary"
"fmt"
"log"
"os"
)