Skip to content

Instantly share code, notes, and snippets.

View thuzhf's full-sized avatar
🎯
Focusing

Fang Zhang thuzhf

🎯
Focusing
  • Tsinghua University
  • Beijing, China.
View GitHub Profile
@Dlfaith
Dlfaith / gist:0d43be3dfb296bb6260af75ef082faa8
Created December 6, 2022 02:51
Free Windows Server 2022 Product Key
Free Windows Server 2022 Standard Product Key
HP9DJ-NK2X6-4QPCH-8HY8H-6X2XY
RRNMT-FP29D-CHKCH-GWQP2-DDDVB
44QN4-X3R72-9X3VK-3DWD6-HFWDM
Free Windows Server 2022 Datacenter Product Key
WX4NM-KYWYW-QJJR4-XV3QB-6VM33
Download windows Sever 2022 Evaluation edition:
Windows Server 2022 Evaluation English
@githubfoam
githubfoam / Mellanox OFED cheat sheet
Last active April 1, 2024 07:32
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
/*
* @Author: Fang Zhang <thuzhf@gmail.com>
* @Date: 2016-09-24 16:03:32
*/
#include <iostream>
using namespace std;
using ull = unsigned long long;
@SimonSun1988
SimonSun1988 / gist:2ef7db45e46b889783647d941ec15e4d
Created April 12, 2016 03:03
解決 Ubuntu "can’t set the locale; make sure $LC_* and $LANG are correct" 的錯誤
## 安裝語系檔
`$ sudo locale-gen "en_US.UTF-8"`
## 重新設定語系檔
`$ sudo dpkg-reconfigure locales`
## 設定檔
@lizhongz
lizhongz / decorator.cpp
Last active September 13, 2023 08:55
C++ decorator measuring the execution time of a function
#include <functional>
#include <chrono>
#include <iostream>
template <class> struct ExeTime;
// Execution time decorator
template <class R, class... Args>
struct ExeTime<R(Args ...)> {
public:
@harrifeng
harrifeng / redhat-compile-emacs.sh
Last active April 1, 2024 13:15
Compile emacs on redhat and centos
yum -y groupinstall "Development Tools"
yum -y install gtk+-devel gtk2-devel
yum -y install libXpm-devel
yum -y install libpng-devel
yum -y install giflib-devel
@border
border / get_sn.c
Created September 19, 2014 11:49
Get Disk Serial Number For Linux
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <scsi/sg.h>
#define SCSI_TIMEOUT 5000 /* ms */
static char *device = "/dev/sda";
@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off