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 / README.md
Created October 21, 2022 08:37
Tulip DAO Governance Post For Mango Markets Asset Recovery

On Oct 11, 2022, Mango Markets suffered an exploit which consequently led to assets in their lending pools being drained. Tulip Protocol was partially affected in our USDC and RAY strategy vaults, with the amounts being 2465940.847 USDC tokens and 68475.68142 RAY tokens. Through negotiation efforts, Mango Markets have been able to retrieve some funds from the exploiter and the outstanding balance being covered by MangoDAO. With this, all users in the USDC and RAY strategy vault will be made whole with no material loss incurred.

Since the exploit, deposits and withdrawals have been disabled on the USDC and RAY strategy vaults. This ensures that the state of the vault shares have remained the same. With Mango Markets allowing users to claim their owed balance, Tulip will be able to do so for the two affected vaults. Our team will programmatically interact with Mango Market’s claim function. This function will transfer the token amounts 2465940.847 USDC and 68475.68142 RAY into each vault respectively, restorin

@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
@bonedaddy
bonedaddy / README.md
Last active May 3, 2022 09:21
Bastion Reward Claiming Ooptimization

Optimized Bastion Reward Claiming - Reduce Txns/Costs By ~75%

I accept no responsibility for loss of funds, or any perceived negative consequences that happens as a result of this code. It has not been audited use at your own risk

Due to the way Aurora works, each contract can only burn a certain amount of gas. Because of this we need to be able to optimize the way to send transactions. Using the following it's possible to claim all liquidity mining rewards from all realms in three transactions. Using this method you can send a max of 3 transactions, as opposed to the 8 that would be required harvesting rewards individually. This does not claim staking rewards given out by the kingdom.

Assuming a cost of 6 cents per transaction, using this method will save you approximately 30 cents in gas fees, allowing for quicker ROI when farming bastion.

Contract Code

Proposal

Start a buyback program with generated revenue, starting when this proposal passes. The DAO will be voting on the method of buyback which will be outlined below. Bought back $TULIP will be distributed to stakers.

Method 1:

  • Buy back $TULIP using 50% of revenue generated from either the highest TVL vault or the highest APY vault on Tulip.
  • Stakers will decide which vault to rotate to each month with a governance vote.

Method 2:

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGIgB90BEADTTH4KicXb+Dvpe7NoV3QOnJK/C9oG5gNVoXjSsTLhzfcwUXZC
2apK2OjQEaIK53s4pn208ivPyDHxGdXI9E6ud/+ekXHDK/huaqZ2a/+dwk1qUITC
jkqNq6bLucsDYKSqDzyA6FT+FLBjz3sSoZgFpqXUeHhECbysHidOrRHnoihUiHjf
/kUu6aO/HB66Tbva1FxeJT7NHCSNvDMiwS6Cakq52Fn7F0fwRbpp29wpLnr+oBey
fCC5urmJ9y5zu87ysX4a5ih/GsbZNsLKPxo75Hz+BUlkpmCNu6rXaewXCbnVrk7S
oubjUVCrgamhGI229Nt/QpXyKsHNM8GyhFzOoJ4LSv6AfKsZZQ0B2xPdNBp6yRbC
xl+84yBEsch2EIbgUX6MZOvibZ98mUm6goZFe4C9+2D/8WZhaQx7rzBwjP2IPwwL
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