Skip to content

Instantly share code, notes, and snippets.

View bonedaddy's full-sized avatar
🌷
pfSense > cisco

bonedaddy bonedaddy

🌷
pfSense > cisco
View GitHub Profile
@bonedaddy
bonedaddy / 60-sysctl.conf
Created June 14, 2022 21:33 — forked from bouroo/60-sysctl.conf
Kernel tuning for dedicated linux server. /etc/sysctl.d/60-sysctl.conf
# Kernel sysctl configuration file for Linux
# https://www.kernel.org/doc/Documentation/sysctl/
#
# Original by Michiel Klaver <https://klaver.it/linux/sysctl.conf>
# Modify by Kawin Viriyaprasopsook <kawin.vir@zercle.tech>
#
# The following is suitable for dedicated web server, mail, file server, KVM server etc.
# place file in /etc/sysctl.d/60-sysctl.conf
# and run `sysctl --system`
@bonedaddy
bonedaddy / generic.org
Created April 30, 2022 05:30 — forked from hrkrshnn/generic.org
Some generic writeup about common gas optimizations, etc.

Upgrade to at least 0.8.4

Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!

The advantages of versions 0.8.* over <0.8.0 are:

  • Safemath by default from 0.8.0 (can be more gas efficient than some library based safemath).
  • Low level inliner from 0.8.2, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@bonedaddy
bonedaddy / ffmpeg-watermark.md
Created February 19, 2021 07:16 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@bonedaddy
bonedaddy / tcp_flags.txt
Created January 5, 2021 05:03 — forked from tuxfight3r/tcp_flags.txt
tcpdump - reading tcp flags
##TCP FLAGS##
Unskilled Attackers Pester Real Security Folks
==============================================
TCPDUMP FLAGS
Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere)
Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere)
Pester = PSH = [P] (Push Data)
Real = RST = [R] (Reset Connection)
Security = SYN = [S] (Start Connection)
@bonedaddy
bonedaddy / nginx.conf
Created December 21, 2020 08:25 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@bonedaddy
bonedaddy / ANSI-color-codes.h
Created July 5, 2020 01:40 — forked from RabaDabaDoba/ANSI-color-codes.h
The entire table of ANSI color codes working in C!
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
#define YEL "\e[0;33m"
#define BLU "\e[0;34m"
#define MAG "\e[0;35m"
#define CYN "\e[0;36m"
#define WHT "\e[0;37m"
@bonedaddy
bonedaddy / ANSI.md
Created July 5, 2020 01:01 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@bonedaddy
bonedaddy / gtest-install.rst
Created June 27, 2020 07:15 — forked from massenz/gtest-install.rst
Describes how to install and run GTest, a Google framework to conduct unit testing in C++

Build and install Google Test

Download the latest_ (1.7.0) from Google Code (Q: where is it going to live, once GCode shuts down?)

Then follow the primer_, but more to the point, the README (YMMV) Having installed CLion and cmake, this is how I built gtest:

brew install cmake
cd gtest-1.7.0
@bonedaddy
bonedaddy / main.ino
Created March 9, 2020 23:26 — forked from dmiddlecamp/main.ino
Photon Audio Example
#define MICROPHONE_PIN A5
#define AUDIO_BUFFER_MAX 8192
int audioStartIdx = 0, audioEndIdx = 0;
uint16_t audioBuffer[AUDIO_BUFFER_MAX];
uint16_t txBuffer[AUDIO_BUFFER_MAX];
// version without timers
unsigned long lastRead = micros();