Skip to content

Instantly share code, notes, and snippets.

View Jimmy-Xu's full-sized avatar

Jimmy Xu Jimmy-Xu

  • Ant Group
  • Beijing, China
View GitHub Profile
@aserhat
aserhat / 0 - setup
Last active March 23, 2024 14:51
QEMU and HVF
# Summary
A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux
I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc.
The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking.
# Installations
brew install qemu (For controlling Hypervisor Framework)
brew install cdrtools (For making cloud init iso's)
http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking)
@heywoodlh
heywoodlh / reset-terminal-services.ps1
Created September 1, 2017 14:49
Script for renewing RDP License
## This Script is intended to be used for Querying remaining time and resetting Terminal Server (RDS) Grace Licensing Period to Default 120 Days.
## Developed by Prakash Kumar (prakash82x@gmail.com) May 28th 2016
## www.adminthing.blogspot.com
## Disclaimer: Please test this script in your test environment before executing on any production server.
## Author will not be responsible for any misuse/damage caused by using it.
Clear-Host
$ErrorActionPreference = "SilentlyContinue"
## Display current Status of remaining days from Grace period.

这是一个用树莓派做Bitcoin Unlimited全节点的示例。对于没用使用过全节点钱包,也不熟悉命令行操作的朋友,建议先看这篇教程,尝试在PC或Mac上安装和同步区块链,这样更容易理解这个示例。

为什么要用树莓派做全节点?

树莓派体积小,耗电小,无噪音,非常适合24小时工作。比特币节点对系统性能要求不高,专门24小时开着一台电脑,耗电和噪音都是很不环保的,且性能有极大的浪费。树莓派耗电仅和手机充电器相当,也没有风扇。你甚至不需要为树莓派安排地方,随便塞在哪里就行了,操作可以在其他的电脑上,通过SSH进行。用树莓派搭建节点,也可以学习到基本的Linux系统操作知识。搭建节点之后,树莓派上可以继续搭建其他服务,比如做个人云盘,BT挂机下载等等。

准备工作

需要准备如下几样东西。此例使用树莓派3B,这版有1GB内存,也有wifi,性能是目前树莓派家族最好的。512MB内存的树莓派2或者zero也是可以用的。清单如下:

  • 树莓派 3B(配盒子,电源)
  • 16GB的SD卡Class 10 microSDHC
@r0l1
r0l1 / copy.go
Last active March 23, 2024 12:38
Copy a directory tree (preserving permissions) in Go.
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* 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
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@jpillora
jpillora / unix-to-tcp.go
Last active April 10, 2024 00:55
Forward unix socket to tcp socket
package main
import (
"io"
"log"
"net"
"os"
)
const (
@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@Jimmy-Xu
Jimmy-Xu / build-python-2.7.9.sh
Created December 14, 2015 16:45
upgrade Python 2.7.6 -> 2.7.9 on Ubuntu 14.04
#!/bin/sh
#
# Installs Python 2.7.9 on Ubuntu 14.04 to include security updates
# Run this script with superuser privileges.
#
BASEDEPS="build-essential python-pip"
BUILDDEPS="libbz2-dev \
libc6-dev \
libgdbm-dev \
@charlax
charlax / gist:38ecd925a8bcb8cadcf5
Created April 3, 2015 17:50
Fix Unable to find 'openssl/opensslconf.h'
SWIG/_m2crypto.i:30: Error: Unable to find 'openssl/opensslv.h'
SWIG/_m2crypto.i:33: Error: Unable to find 'openssl/safestack.h'
SWIG/_evp.i:12: Error: Unable to find 'openssl/opensslconf.h'
SWIG/_ec.i:7: Error: Unable to find 'openssl/opensslconf.h'
error: command 'swig' failed with exit status 1
@denji
denji / golang-tls.md
Last active April 29, 2024 03:39 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

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)
@sheikhwaqas
sheikhwaqas / setup-mysql.sh
Last active September 6, 2023 15:59
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22