This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt install flex bison | |
| git clone https://github.com/microsoft/WSL2-Linux-Kernel --depth 1 | |
| cd WSL2-Linux-Kernel/tools/perf | |
| make -j8 | |
| sudo cp perf /usr/local/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef DEBUG_H | |
| #define DEBUG_H | |
| #include <bits/stdc++.h> | |
| #define yo cout << "YO[" << __FILE__ << ":" << __LINE__ << "]" << std::endl;std::cerr.flush();std::cout.flush();exit(0) | |
| #define check(x) std::cerr.flush();std::cout.flush();std::assert(x) | |
| template<typename Arg, typename... Args> | |
| void print_debug(const char * filename, int line, Arg&& arg, Args&&... args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-AppxPackage -AllUsers | Remove-AppxPackage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export PS1='$(if [[ ! "$?" = "0" ]]; then echo "\[\e[1;31m\]($?)\[\e[0m\] "; fi)\h:\[\e[1;31m\]$(basename $PWD)\[\e[0m\]\[\e[1;33m\]$(__git_ps1 " [%s]")\[\e[0m\]> ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| powershell.exe "$(wslpath -w .)\myscript.ps1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # man gpg | |
| # configuration in ~/.gnupg | |
| # generate gpg keypair with default options | |
| gpg --gen-key | |
| # or use dialog | |
| gpg --full-generate-key | |
| # import a key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| verbosity=1 | |
| debug=false | |
| function cmd_foo { | |
| echo "foo" | |
| } | |
| function cmd_bar { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC ?= gcc | |
| CFLAGS += -std=c99 -Wall -Wextra -Iinclude | |
| LDLIBS = -lm | |
| .PHONY: all release debug native %test clean% | |
| all: release | |
| release: target/release/foobar | |
| debug: target/debug/foobar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Survey | |
| advixe-cl --collect=survey --stacks -- ./foo | |
| # Dependencies | |
| advixe-cl --collect=dependencies --stacks -- ./foo | |
| # Memory access patterns | |
| advixe-cl --collect=map --stacks -- ./foo | |
| # Create snapshot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $vswhere = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' | |
| $vsfound = Test-Path $vswhere | |
| if (-Not $vsfound) { | |
| Write-Host "vswhere not found in $vswhere" | |
| Exit 1 | |
| } | |
| $vspath = & $vswhere -property installationPath | |
| Write-Host "vspath = $vspath" | |
| Push-Location "$vspath\Common7\Tools" | |
| cmd /c "VsDevCmd.bat&set" | Foreach { |