Skip to content

Instantly share code, notes, and snippets.

@snowdream
snowdream / gist:012f9b269d5a6f6779dc077dfadb81af
Last active September 19, 2024 13:43
list all valid combinations of GOOS and GOARCH
@snowdream
snowdream / pkcs5.c
Last active June 22, 2024 00:38 — forked from dzmitryk/pkcs5.c
Simple command line tool to demonstrate using of PKCS#5 PBKDF2 HMAC SHA1 capabilities of OpenSSL library.Params: -i number of iterations; -s salt; -p password; -l hash length; -x flag which allows to specify salt as hex string;Compile using: $gcc pkcs5.c -L/usr/lib -lssl -lcrypto -o pkcs5
/*
MIT License
Copyright (c) 2013 Dzmitry Kazimirchyk
Copyright (c) 2024-present SnowdreamTech Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@snowdream
snowdream / golang-tls.md
Created May 18, 2023 12:59 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
FROM centos:latest
LABEL maintainer="snowdream <[email protected]>"
ENV CPULIMIT_VERSION 0.2
ENV XMRIG_VERSION 5.3.0
RUN dnf groupinstall -y 'Development Tools' \
&& dnf install -y wget \
@snowdream
snowdream / .bashrc.sh
Last active August 14, 2019 16:33
阿里云Go Module代理仓库服务 https://mirrors.aliyun.com/goproxy/
# Enable the go modules feature
export GO111MODULE=on
# Set the GOPROXY environment variable
export GOPROXY=https://mirrors.aliyun.com/goproxy/
snowdream@R7000-C0CE:/tmp/mnt/MULTIBOOT/bin# entware-setup.sh
Info: This script will guide you through the Entware installation.
Info: Script modifies "entware" folder only on the chosen drive,
Info: no other data will be changed. Existing installation will be
Info: replaced with this one. Also some start scripts will be installed,
Info: the old ones will be saved on Entware partition with name
Info: like /tmp/mnt/sda1/jffs_scripts_backup.tgz
Info: Looking for available partitions...
[1] --> /tmp/mnt/MULTIBOOT
@snowdream
snowdream / gist:fca547c17fe483c44f0ec9b9f07adc87
Created November 5, 2016 07:24
mac电脑如何显示U盘里的隐藏文件
刚刚查到的正解:
第一步:打开[应用程序]-[终端]
第二步:在自动弹出来的一串字后面,输入如下命令:
defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder
第三步:按下「Return」键确认。
现在你将会在 Finder 窗口中看到那些隐藏的文件和文件夹了。
如果你想再次隐藏原本的隐藏文件和文件夹的话,将上述命令替换成
@snowdream
snowdream / arc_setup.sh
Last active August 4, 2016 03:56 — forked from makinde/arc_setup.sh
Arc Setup (Ubuntu)
#!/bin/bash
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
if hash apt-get &> /dev/null; then
sudo apt-get install git-core php-cli php-curl
elif hash port &> /dev/null; then
sudo port install php-curl
elif hash fink &> /dev/null; then
file:
========================
q close
r reload
S save
p presentation
view:
========================
@snowdream
snowdream / apt-fast for ubuntu
Last active June 18, 2016 03:06
apt-fast for ubuntu
https://github.com/ilikenwf/apt-fast
Ubuntu 14.04 and later versions
sudo add-apt-repository ppa:saiarcot895/myppa
sudo apt-get update
sudo apt-get -y install apt-fast