Skip to content

Instantly share code, notes, and snippets.

@maxco2
maxco2 / gpg-tour.md
Created January 20, 2023 07:36 — forked from jhjguxin/gpg-tour.md
GPG 加密解密简明教程 </br> 作者: riku / 本文采用CC BY-NC-SA 2.5协议 授权

GPG 加密解密简明教程

大家都知道,互联网上充斥着大量的明文传输方式,可以说绝对是不安全地带。那么,我们如何保证在不安全的互联网中更可靠的传输重要数据呢?个人认为最好的方式之一就是使用 GPG 工具进行加密。此文只是简单介绍了 GPG 的常规用法,重在推广和普及 GPG 加密工具,详细的使用请参见 GPG 手册。

名词解释

RSA / DSA / ElGamal : 是指加密算法

GPG :(全称 GnuPG ) 是一款非对称加密(PGP)的免费软件,非对称加密方式简单讲就是指用公钥加密文件,用私钥解密文件。如果你想给谁发送加密信息,首先你要得到他的公钥,然后通过该公钥加密后传给他,对方利用自已的私钥就可解密并读取文件了。

@maxco2
maxco2 / xorg.conf
Created April 20, 2020 06:04
xorg.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
@maxco2
maxco2 / mcmc.ipynb
Created July 17, 2019 08:34
Markov Chain Monte Carlo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxco2
maxco2 / gist:833e8184254b948428fc0999b0691784
Created February 5, 2019 17:38 — forked from allex/gist:11203573
Ubuntu 安装中文字体

环境 (Environment)

版本:Ubuntu 14.04 LTS 默认语言:English(United States)

安装 (Setup)

Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。

@maxco2
maxco2 / zsh_to_fish.py
Created December 5, 2018 12:12 — forked from dvdbng/zsh_to_fish.py
Migrate zsh history to fish
import os
import re
def zsh_to_fish(cmd):
return (cmd.replace('&&', '; and ')
.replace('||', '; or '))
def is_valid_fish(cmd):
@maxco2
maxco2 / setupWindows.md
Created November 21, 2018 13:51 — forked from josephst/setupWindows.md
Setup for a new Windows system

Getting Windows set up for development and daily driver use

Notes to self

Similar guides for inspiration

@maxco2
maxco2 / chromeos-crosh-custom-setup.md
Created November 8, 2018 08:21 — forked from aaronhalford/chromeos-crosh-custom-setup.md
Customize ChromeOS Crosh Terminal with Custom Fonts and Solarized Dark Theme

Customize Chromebook Chrosh Shell Environment

Requirement: Chromebook, Common Sense, Commandline Ablity, 1 hour of time

Dear developers with a spare Chromebook lets inject a little personalization into your Crosh shell with custom fonts, the solarized theme, and extra secure shell options.

Also, keep in mind that the terms Chrosh, Chrosh Window, and Secure Shell all refer to various versions and extentions built around the ChromeOS terminal. Settings that affect the ChromeOS terminal are global.

Custom Fonts

@maxco2
maxco2 / 2scomplement.py
Created August 27, 2018 10:10
python console运算结果32位补码表示
def display_as_hex(item):
def int2hex(number, bits):
if number < 0:
return hex((1 << bits) + number)
else:
return hex(number)
if isinstance(item, (int, long)):
print(int2hex(item,32))
else:
print repr(item)
@maxco2
maxco2 / Demo.c
Created June 4, 2018 07:12 — forked from mikeando/Demo.c
Example of using C++ from C.
#include "HMyClass.h"
#include <stdio.h>
void my_eh( const char * error_message, void * unused)
{
printf("my_eh: %s\n", error_message);
}
int main()
{
@maxco2
maxco2 / ADL.md
Last active May 25, 2018 07:52
C++奇技淫巧!!!