Skip to content

Instantly share code, notes, and snippets.

View daparic's full-sized avatar

daparic

View GitHub Profile

Update /etc/apt/sources.list:

deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ zesty universe
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates universe
deb http://old-releases.ubuntu.com/ubuntu/ zesty multiverse
deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates multiverse
deb http://old-releases.ubuntu.com/ubuntu/ zesty-backports main restricted universe multiverse
deb http://old-releases.ubuntu.com/ubuntu zesty-security main restricted
AlignTrailingComments: true
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
BreakBeforeBinaryOperators: false
IndentWidth: 4
IndentAccessModifiers: true
AccessModifierOffset: -4
SortIncludes: false
NamespaceIndentation: All
sudo apt install git hexedit curl vifm tmux vim tree xmlstarlet jq ncal feh mplayer inotify-tools bc irssi asciinema openssh-server
# Turn off vbox Ubuntu guest
# Go to vbox guest settings then create/attach disc to it
# Turn on vbox guest
lsblk -fs # find /dev/sd? and its UUID
sudo mkfs.ext4 /dev/sd?
UUID=f6d532c9-5638-468e-9868-b7642f25760b /mnt ext4 defaults,errors=remount-ro 0 1
sudo swapon --show
sudo fallocate -l 5G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo "/swapfile none swap sw 0 0" >> /etc/fstab
sudo sysctl vm.swappiness=10

Reference

Visual Studio C++

#pragma pack(push, 1)
struct dog {
    int n;
    unsigned char buf[3];
};
#pragma pack(pop)
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
#include <iostream>
#include <unistd.h>
#include <limits.h>
#include <sys/utsname.h>
int main(int argc, char* argv[]) {
std::string s = argv[0];
std::size_t idx = s.find_last_of("/");
std::string ss = s.substr(0, idx);

both

cpptesttrace \
	--cpptesttraceOutputFile=/path/to/projname.bdf \
	--cpptesttraceProjectName=projname \
	[--cpptesttraceTraceLog=/path/to/projname.trace.log] \
	[--cpptesttraceTraceCommand=gcc]

standard

analysis_type
analyzer
analyzer_version
artifact
artifact_type
build
build_description
build_latest_run
build_persistence
build_review