Skip to content

Instantly share code, notes, and snippets.

View genedna's full-sized avatar
🦀
Rust !

Quanyi Ma genedna

🦀
Rust !
View GitHub Profile
@genedna
genedna / gentoo-install-manual.md
Last active March 26, 2024 10:19
Gentoo 安装手册

Gentoo 安装手册

第一步:下载安装介质

GentooMinimal Install CD 每周都会自动构建一个版本,服务器一般使用最新的 x86_64 版本。 国内的镜像下载地址是:

第二步:启动机器,设置网络环境和开启 SSH 服务

@genedna
genedna / git-branching-diagram.md
Created November 26, 2021 14:05 — forked from bryanbraun/git-branching-diagram.md
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/bf563eb36c3623bb9e7e1faae349c5da802f9fed/template-data.xml
  4. Customize as needed for your team.

#Golang Markdown Librarise Analytics

  • Weekly Agenda (created on a different day, and embedded with /Block Reference)
  • [[Morning Questions]] [[2/24 -- 3/1/2020]]
    • {{[[slider]]}} How many hours of sleep did I get?
    • [[What's one thing top of mind today?]]
    • [[What's the one thing I need to get done today to make progress?]]
  • Agenda
    • {{[[TODO]]}} 2 hours focused time
    • {{[[TODO]]}} Read 30 minutes #goal-learning #habit
  • Health & self-care
  • {{[[TODO]]}} 30 minutes outside #goal-health #habit
@genedna
genedna / playground.rs
Created January 2, 2020 12:04 — forked from anonymous/playground.rs
Shared via Rust Playground
use std::collections::HashMap;
use std::collections::HashSet;
use std::hash::Hash;
use std::fmt::Debug;
#[derive(Debug, Clone)]
struct EdgeIndex<Ix>(Ix);
#[derive(Debug, Clone)]
struct NodeIndex<Ix>(Ix);
# GCC
CFLAGS="-march=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
MAKEOPTS="-j5"
# USE
SUPPORT="pulseaudio btrfs mtp git udisks gvfs png jpg jpeg alsa client icu sudo python consolekit udev"
DESKTOP="X policykit fileroller cairo cups mount curl dbus vim infinality emoji cjk"
@genedna
genedna / indicatif-hyper.rs
Created September 18, 2019 15:51 — forked from clux/indicatif-hyper.rs
indicatif progress bars with hyper 0.10
pub fn http_download_to_path(url: &str, save: &PathBuf) -> Result<()> {
let client = Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap()));
let mut res = client.get(url).send()?;
if res.status != hyper::Ok {
return Err(Error::SomeError)));
}
let use_progress = true;
if use_progress {
use indicatif::{ProgressBar, ProgressStyle};
pub fn copy_with_progress<R: ?Sized, W: ?Sized>(progress: &ProgressBar,
reader: &mut R, writer: &mut W)
-> io::Result<u64>
where R: Read, W: Write
{
let mut buf = [0; 16384];
let mut written = 0;
loop {
let len = match reader.read(&mut buf) {
Ok(0) => return Ok(written),
@genedna
genedna / audit.rules
Created June 5, 2019 11:21 — forked from Neo23x0/audit.rules
Linux Auditd Best Practice Configuration
# IMPORTANT!
# This gist has been transformed into a github repo
# You can find the most recent version there:
# https://github.com/Neo23x0/auditd
# ___ ___ __ __
# / | __ ______/ (_) /_____/ /
# / /| |/ / / / __ / / __/ __ /
# / ___ / /_/ / /_/ / / /_/ /_/ /
# /_/ |_\__,_/\__,_/_/\__/\__,_/
@genedna
genedna / email.go
Created July 2, 2014 15:44
Golang 从腾讯企业邮箱的发送邮件和一个 HTML 模板。
package main
import (
"crypto/tls"
"fmt"
"log"
"net"
"net/smtp"
)