Skip to content

Instantly share code, notes, and snippets.

View staugust's full-sized avatar

Augusto Yao staugust

  • Hangzhou
  • 08:02 (UTC +08:00)
View GitHub Profile
@staugust
staugust / unique_ptr.cc
Last active July 23, 2024 06:45
unique_ptr get() return dangling pointer
#include <stdio.h>
#include <stdlib.h>
#include <memory>
#include <iostream>
#include <thread>
#include <unistd.h>
class Test{
public:
int a;
@staugust
staugust / 0-go-os-arch.md
Created December 6, 2022 03:54 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@staugust
staugust / README.md
Created October 21, 2021 03:26 — forked from manics/README.md
etcd self-signed client certificates
@staugust
staugust / Makefile
Created September 6, 2021 02:14 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@staugust
staugust / getcudauuid.cc
Created April 10, 2019 11:36
print all GPU's UUID, compile with *g++ getuuid.cc -o getuuid -I/usr/local/cuda/include -lnvidia-ml*
#include <nvml.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
int main(){
nvmlInit();
unsigned int cnt = 0;
nvmlReturn_enum res = nvmlDeviceGetCount(&cnt);
std::cout << res << std::endl;