pandoc file.md -t beamer -o out.pdf
- create beamer presentation from markdown filenm
- list symbols from object file- sending file with Xmodem (requires
lrzsz
): -
screen /dev/tty* 115200
-
- Ctrl + A,
:exec !! sx file.txt
- Ctrl + A,
sudo getty -L 115200 ttyUSB0 vt102
- terminal over serial line (persistent)objdump -D -b binary -mi386 -Maddr16,data16 -Mintel file.bin
- disassemble raw 16-bit i386 binary file with Intel syntaxffmpeg ... -vcodec hevc_nvenc/h264_nvenc
- use Nvidia GPU for video encoding withffmpeg
echo "file.txt" | entr command
- run command each time file changes
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
/* | |
Compile with: clang -O3 -o nsect nsect.c -Wall -DCOUNT=5000000 -DNSECT=? -funroll-loops | |
*/ | |
#include <math.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <sys/time.h> |
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
# liblightmodbus - a lightweight, multiplatform Modbus library | |
# Copyright (C) 2017 Jacek Wieczorek <[email protected]> | |
# This file is part of liblightmodbus. | |
# Liblightmodbus is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
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
struct iir_filter | |
{ | |
float *w; // w coefficients | |
float *a; // a coefficients | |
float *b; // b coefficients | |
int n; // filter size | |
}; | |
float iir_push( struct iir_filter *f, float x ) | |
{ |
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
#Group | Package name | Description | |
---|---|---|---|
sudo | running programs as root | ||
ssh | remote shell | ||
sshfs | for mapping filesystems over network | ||
pv | program for measuring data flow through pipes | ||
git | version control system | ||
moreutils | more utilities | ||
rsync | for making backups and copying files | ||
tree | file tree view | ||
rename | powerful renaming utility |
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 | |
BLOCK="gambling porn fakenews social" | |
EXCEPT="" | |
cp hosts hosts.new | |
# Base | |
echo "blocking adware + malware..." | |
curl -s "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" | sed -ne '/# Start StevenBlack/,$p' >> hosts.new |
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
#include <setjmp.h> | |
#include <stdio.h> | |
union exception_data | |
{ | |
const char *string; | |
double d; | |
int i; | |
}; |
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
--- | |
BasedOnStyle: LLVM | |
TabWidth: 4 | |
IndentWidth: 4 | |
UseTab: Always | |
ColumnLimit: 0 | |
--- | |
Language: Cpp | |
AccessModifierOffset: 0 |
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
#include "url_request.hpp" | |
#include <algorithm> | |
#include <stdexcept> | |
// The write callback function | |
size_t url_request::write_callback( void *contents, size_t size, size_t nmemb, void *userp ) | |
{ | |
size_t realsize = size * nmemb; | |
url_request *rq = static_cast<url_request*>( userp ); | |
std::uint8_t *b = static_cast<std::uint8_t*>( contents ); |
Warnings:
-Weverything
- even more than-Wpedantic
in Clang
Debugging:
-g
- Preserve debugging symbols-fno-omit-frame-pointer
- if some symbols remain broken-fno-builtin
- Do not perform someprintf
,scanf
,malloc
, etc. optimizations (debugging is easier)-fsanitize=address
- Use address sanitizer-fsanitize=thread
- Use thread sanitizer-fsanitize=undefined
- Use UB sanitizer