Skip to content

Instantly share code, notes, and snippets.

View crazyguitar's full-sized avatar
🎯
Focusing

CHANG-NING TSAI crazyguitar

🎯
Focusing
View GitHub Profile
@crazyguitar
crazyguitar / Helm.md
Last active March 18, 2020 15:47
Helm Cheat Sheet

Helm Cheat Sheet

# Add stable repo (similar to add-apt-repository)
$ helm repo add stable https://kubernetes-charts.storage.googleapis.com/ 

# list repo
$ helm repo list

# helm repo update (similar to apt update)

GDB Note

Set binary affinity in GDB

taskset -c 4 gdb --args ./a.out
@crazyguitar
crazyguitar / phoronix-cmd.md
Created September 15, 2020 04:58 — forked from anshula/phoronix-cmd.md
Phoronix Test Suite Cheat Sheet
@crazyguitar
crazyguitar / event.cpp
Created September 18, 2020 01:20 — forked from darkf/event.cpp
Simple event system in C++
#include <functional>
#include <map>
#include <typeinfo>
#include <iostream>
struct Event {
virtual ~Event() {}
};
struct TestEvent : Event {
std::string msg;
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <[email protected]> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
@crazyguitar
crazyguitar / example.cpp
Created October 14, 2020 17:19 — forked from dflemstr/example.cpp
A C++ implementation of fixed point math
#include "fixedp.h"
#include <iostream>
int main(int, char **)
{
fixedp<true, 16, 16> x(0); //32-bit signed 16.16 fixed-point number
fixedp<false, 8, 8> y(10); //16-bit unsigned 8.8 fixed-point number
std::cout << (fixedp<false, 4, 4>(3.5) + fixedp<false, 4, 4>(4.5)).toFloat() << std::endl;
//prints "8"
@crazyguitar
crazyguitar / CircBuf.h
Created October 16, 2020 17:38 — forked from xstherrera1987/CircBuf.h
Generic Circular Buffer and tests, C++
#include <stdexcept>
/*
T must implement operator=, copy ctor
*/
template<typename T> class CircBuf {
// don't use default ctor
CircBuf();
@crazyguitar
crazyguitar / CMakeLists.txt
Created December 9, 2020 14:22 — forked from baiwfg2/CMakeLists.txt
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@crazyguitar
crazyguitar / External_GTest.cmake
Created December 9, 2020 15:38 — forked from ClintLiddick/External_GTest.cmake
CMake ExternalProject_Add for Google Mock (gmock) and Google Test (gtest) Libraries
find_package(Threads REQUIRED)
ExternalProject_Add(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
UPDATE_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON)