Skip to content

Instantly share code, notes, and snippets.

View dzcpy's full-sized avatar
🎯
Focusing

dzcpy

🎯
Focusing
View GitHub Profile
FROM alpine:latest
WORKDIR /opt
EXPOSE 443/tcp 500/udp 4500/udp
ENV HOST_NAME=
ENV LOGIN_USER=
ENV LOGIN_PASSWORD=
ENV LOCAL_SUBNET=172.19.240.0/20
@dzcpy
dzcpy / arch-setup.sh
Last active June 27, 2021 01:59
Arch Linux setup
#!/bin/sh
pacman -Syu
pacman -S base-devel go nodejs npm npm-check-updates certbot certbot-nginx wget tree xz socat git zsh cronie
#enable en_US.UTF-8
#vim /etc/locale.gen
locale-gen
localectl set-locale LANG=en_US.UTF-8
#bbr
echo "net.core.default_qdisc=fq" >> /etc/sysctl.d/bbr.conf
@dzcpy
dzcpy / install-ikev2.sh
Last active June 2, 2023 07:11
Setup Strongswan IKEv2 VPN server on Debian 10 with Let's Encrypt
#!/bin/bash
apt update && apt upgrade -y
apt install strongswan strongswan-pki libcharon-extra-plugins net-tools wget certbot -y
DEBIAN_FRONTEND=noninteractive apt-get -y install iptables-persistent
HOST_NAME="vpn.example.com"
read -e -i "$HOST_NAME" -p "VPN host name: " HOST_NAME
HOST_NAME="${input:-$HOST_NAME}"
LOCAL_SUBNET="172.19.240.0/20"
@dzcpy
dzcpy / 超大字符集字体.md
Last active April 26, 2024 11:28
常用超大字符集字体

unicodecjkfonts

所谓“超大字符集字体”是指至少支持CJK-B的字体(约7万+字),常用的有如下几种:

中国大陆字形

  • 中易宋体(Windows 10 version 1809):部分支持CJK-E
13a81e63aae736ca2254492dd111d3ace4e9dbe9 *simsun.ttc
91a6e66e7c1139a27b6caa313dc451af36e4e5ed *simsunb.ttf
@dzcpy
dzcpy / debian-setup.sh
Last active November 21, 2023 00:47
Debian setup
#!/bin/sh
apt update
apt dist-upgrade -y
apt purge vim-tiny -y
apt install curl build-essential cmake pkg-config git zsh fonts-powerline apt-transport-https dirmngr sudo htop vim xz-utils net-tools socat -y
apt autoclean -y
userdel games
userdel lp
userdel news
userdel irc
@dzcpy
dzcpy / setup.sh
Last active July 30, 2018 09:00
Setup Raspberry Pi with Arch ARM
#!/bin/sh
sed -i 's/#en_US\.UTF-8 UTF-8/en_US\.UTF-8 UTF-8/g' /etc/locale.gen
locale-gen
sed -i '/gpu_mem=/s/=64$/=128/g' /boot/config.txt
echo 'dtparam=audio=on' >> /boot/config.txt
echo 'start_file=start_x.elf' >> /boot/config.txt
echo 'fixup_file=fixup_x.dat' >> /boot/config.txt
echo 'disable_camera_led=1' >> /boot/config.txt
echo 'bcm2835-v4l2' > /etc/modules-load.d/rpi-camera.conf

Visual C++ Build Tools 2015 (Pre-release). If you want to build your C++ projects targeting Windows desktop without having Visual Studio installed on your computer, Microsoft Visual C++ Build Tools 2015 provides the required tools: C++ compilers, libraries, build scripts, Windows SDKs. This Community Technology Preview ships with the same C++ compilers and libraries packaged with Visual Studio 2015 Update 1 RC (2015.1). http://blogs.msdn.com/b/vcblog/archive/2015/10/29/visual-studio-2015-update-1-rc-available.aspx The config steps with Node.js should now be as follows:

Install VC++ Build Tools Technical Preview

💡 [Windows 7 only] requires .NET Framework 4.5.1 Install Python 2.7, and add it to your PATH, npm config set python python2.7

Launch cmd, npm config set msvs_version 2015 --global (this is instead of npm install [package name] --msvs_version=2015 every time.)

@dzcpy
dzcpy / gist:c76da5bbf437356ea64b
Last active October 7, 2015 08:22 — forked from devzendo/gist:3a474908b71b66ffa9d7
Getting started with Arduino Micro, 1602A LCD, I2C LCD backpack.
// Using https://arduino-info.wikispaces.com/LCD-Blue-I2C
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup() {
lcd.begin(16, 2);
/**
* Simple authentication and authorization example with passport, node_acl,
* MongoDB and expressjs
*
* The example shown here uses local userdata and sessions to remember a
* logged in user. Roles are persistent all the way and applied to user
* after logging in.
*
* Usage:
* 1. Start this as server
// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},