Skip to content

Instantly share code, notes, and snippets.

interface=${1:-wg0}
if wg show | rg "interface: $interface"; then
echo -e "\033[0;33mCalling: \033[0;31mwg-quick down $interface\033[0m"
wg-quick down $interface
else
echo -e "\033[0;33mCalling: \033[0;32mwg-quick up $interface\033[0m"
wg-quick up $interface
fi
wg show

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias grep='grep --color=auto'
alias less='less -R'
alias ls='ls -h --color=auto'
alias ll='ls -alF'
alias la='ls -lA'
alias l='ls -CF'
apt install build-essential libssl-dev libc6 zlib1g-dev
wget https://github.com/Kitware/CMake/releases/download/v3.21.3/cmake-3.21.3.tar.gz
tar -zxvf cmake-3.21.3.tar.gz
cd cmake-3.21.3
./bootstrap
make
make install
cd ..
rm cmake-3.21.3.tar.gz
File
Enter
Execute, change folder
Shif­t+E­nter
Execute in separate window
F3
View
Ctrl+Q
Toggle quick view panel
F4
@missglory
missglory / timer.h
Last active July 12, 2019 15:22
timer.h
struct Timer {
std::chrono::time_point<std::chrono::steady_clock> startp, endp;
std::chrono::duration<float> duration;
float ms[4];
Timer() {
startp = std::chrono::high_resolution_clock::now();
for (int i = 0; i < 4; i++) ms[i] = 0.0;
}
@missglory
missglory / main.cpp
Last active June 30, 2022 12:26
boost tcp asio listener
#include <cstdlib>
#include <iostream>
#include <memory>
#include <utility>
#include <boost/asio.hpp>
#include <boost/thread.hpp>
using boost::asio::ip::tcp;
class session
#include <netdb.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sys/types.h>
#include <sys/uio.h>
#include <unistd.h>
#include <sys/socket.h>
#define MAX 1024
@missglory
missglory / .bashrc
Last active December 23, 2022 13:25
aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias lo='la -d $PWD/*'
alias lor='ls -laR $PWD/*'
alias cb='xclip -selection c'
alias ga='git add -v'
alias gs='git status'
alias gco='git checkout'
+--------+----+----+----+----+------+------+------+------+
| | C1 | C2 | C3 | C4 | C(5) | C(6) | C(7) | C(8) |
+--------+----+----+----+----+------+------+------+------+
| CV_8U | 0 | 8 | 16 | 24 | 32 | 40 | 48 | 56 |
| CV_8S | 1 | 9 | 17 | 25 | 33 | 41 | 49 | 57 |
| CV_16U | 2 | 10 | 18 | 26 | 34 | 42 | 50 | 58 |
| CV_16S | 3 | 11 | 19 | 27 | 35 | 43 | 51 | 59 |
| CV_32S | 4 | 12 | 20 | 28 | 36 | 44 | 52 | 60 |
| CV_32F | 5 | 13 | 21 | 29 | 37 | 45 | 53 | 61 |
| CV_64F | 6 | 14 | 22 | 30 | 38 | 46 | 54 | 62 |