Skip to content

Instantly share code, notes, and snippets.

View wongsyrone's full-sized avatar
😂
Babysitting

Syrone Wong wongsyrone

😂
Babysitting
View GitHub Profile
@wongsyrone
wongsyrone / nginx-v2ray.conf
Last active February 18, 2019 13:23 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/dhparam.pem 2048
@wongsyrone
wongsyrone / OpenSSL-1_1_0-stable-VS2015.md
Created February 4, 2018 14:52 — forked from terrillmoore/OpenSSL-1_1_0-stable-VS2015.md
Building OpenSSL 1.1.0 with Microsoft VS 2015

Building OpenSSL 1.1.0 with Microsoft VS 2015

MCCI needs OpenSSL for a Windows project (that will be cross-platform). A casual search didn't turn up either a good source for cross-platform libraries, which meant we have to build them ourselves. A deeper search found a detailed guide here, and yet the details don't match what I found when I checked out the code; and the post doesn't talk about doing it directly from GitHub (which I wanted to do).

Here's the procedure for building OpenSSL on 64-bit Windows 10, with Visual Studio 2015.

  1. If you don't have it, please install git bash from git-scm.com.
  2. Start a git bash window.

    In the following, I'll use lines beginning with {dir} $ to designate input to a bash Window. We'll also have to use a cmd.exe Window for much of the build, and those lines will be marked {dir}>, just as on Windows..

@wongsyrone
wongsyrone / 1027.c
Last active January 31, 2018 06:11
PAT 打印沙漏
/*
1027. 打印沙漏(20)
本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印
*****
***
*
***
*****
Yaourt is just wrapper around pacman and other utilities, e.g. cURL. If you want to download essential files such as PKGBUILDs, just pass
environments.
$ http_proxy=10.1.10.40:808 https_proxy=10.1.10.40:808 yaourt -S customizepkg
@wongsyrone
wongsyrone / part2.sh
Last active January 21, 2018 15:21 — forked from fgoinai/part2.sh
ln -sf /usr/share/zoneinfo/$(tzselect) /etc/localtime
hwclock --systohc
nano /etc/locale.gen && locale-gen
read -p "Default LANG is? [en_US,zh_CN...]" loc
echo "LANG=$loc.UTF-8" >> /etc/locale.conf
read -p "Hostname is?" hn
echo $hc > /etc/hostname
echo "127.0.1.1\t$hc.localdomain\t$hc" > /etc/hosts
@wongsyrone
wongsyrone / part1.sh
Created January 21, 2018 15:21 — forked from fgoinai/part1.sh
#!/bin/bash
#check network connection
con=$(ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` > /dev/null && echo ok || echo error)
if [ $con == "error" ]; then
exit -1
fi
timedatectl set-ntp true
lsblk
@wongsyrone
wongsyrone / introrx.md
Created November 26, 2017 00:53 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@wongsyrone
wongsyrone / gist:2ae6b641975b5685abbfd72edd9d483b
Last active October 2, 2018 13:03
visual studio 2017 offline installation
create initial layout, this write settings to --layout dir
D:\>vs_community.exe --layout D:\vs2017layout --lang en-US --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.CoreEditor --add Microsoft.VisualStudio.Component.NuGet --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop --add Microsoft.VisualStudio.Component.Windows81SDK --add Microsoft.Component.VC.Runtime.UCRTSDK
after initial layout creation, just execute this to update layout
D:\>D:\vs2017layout\vs_community.exe --layout D:\vs2017layout
clean old layout, after this cmd, can delete the Archive dir
@wongsyrone
wongsyrone / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created October 13, 2017 01:10 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \