Skip to content

Instantly share code, notes, and snippets.

@aserhat
aserhat / 0 - setup
Last active Oct 12, 2021
QEMU and HVF
View 0 - setup
# 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 Sep 1, 2017
Script for renewing RDP License
View reset-terminal-services.ps1
## 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.
View 用树莓派做Bitcoin Unlimited全节点.md

这是一个用树莓派做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 Oct 11, 2021
Copy a directory tree (preserving permissions) in Go.
View copy.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 Oct 14, 2021
Forward unix socket to tcp socket
View unix-to-tcp.go
package main
import (
"io"
"log"
"net"
"os"
)
const (
View jq-cheetsheet.md

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 Dec 14, 2015
upgrade Python 2.7.6 -> 2.7.9 on Ubuntu 14.04
View build-python-2.7.9.sh
#!/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 \
@denji
denji / golang-tls.md
Last active Oct 14, 2021 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
View golang-tls.md

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 Sep 9, 2021
Install MySQL Server on Ubuntu (Non-Interactive Installation)
View setup-mysql.sh
# 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
@JamesChevalier
JamesChevalier / mac_utf8_insanity.md
Last active Oct 15, 2021
Unicode on Mac is insane. Mac OS X uses NFD while everything else uses NFC. This fixes that.
View mac_utf8_insanity.md

convmv manpage

Install convmv if you don't have it

sudo apt-get install convmv

Convert all files in a directory from NFD to NFC:

convmv -r -f utf8 -t utf8 --nfc --notest .