Skip to content

Instantly share code, notes, and snippets.

View chojayr's full-sized avatar

Luis R. Lavina Jr. chojayr

View GitHub Profile
@yihuang
yihuang / native-asset-design.md
Last active March 17, 2021 06:50
native asset design patterns

native asset design patterns

Fixed max supply

Problem

You want your token to have fixed max supply (NFT is just token with 1 max supply).

Solution

@nevack
nevack / archived.md
Last active July 1, 2024 22:29
[ARCHIVED] Fix for CSR Dongle 0a12:0001 ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)

This gist is currenctly archived.

Please refer to previous revisions if you know what to do.

The patch proposed was merged into kernel in 5.8 release, but no longer working as of linux 5.11

@voluntas
voluntas / sysctl.conf
Created October 14, 2017 13:07 — forked from techgaun/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@hassy
hassy / kms-vault
Last active December 29, 2023 04:11
Encrypt/decrypt files using AWS KMS
#!/usr/bin/env bash
# License: MIT - https://opensource.org/licenses/MIT
#
# Usage:
#
# Encrypt a file:
# kms-vault encrypt My-Key-Alias some-file-i-want-encrypted.txt > topsecret.asc
#
@eferro
eferro / _aws_golang_examples.md
Last active July 21, 2023 09:35
golang aws: examples

AWS Golang SDK examples

@magnetikonline
magnetikonline / README.md
Last active January 24, 2023 21:06
Python - comparing JSON data structures.

Python - comparing JSON data structures

A function compare_json_data(source_data_a,source_data_b), accepting structures populated with data loaded from json.load() and comparing for equality.

Example

$ ./compare.py 
Compare JSON result is: True
@bkozora
bkozora / lambdaAMICleanup.py
Last active March 12, 2023 11:55
AWS Lambda Function to Delete AMIs and Snapshots
# Automated AMI and Snapshot Deletion
#
# @author Bobby Kozora
#
# This script will search for all instances having a tag named "Backup" with a value of "Backup".
# As soon as we have the instances list, we loop through each instance
# and reference the AMIs of that instance. We check that the latest daily backup
# succeeded then we store every image that's reached its DeleteOn tag's date for
# deletion. We then loop through the AMIs, deregister them and remove all the
# snapshots associated with that AMI.
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active July 19, 2024 17:32
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@nickbabcock
nickbabcock / graphite.conf
Last active December 6, 2019 06:18
Installs Graphite on CentOS 6
server {
listen 80;
root /opt/graphite/webapp/content;
location / {
# checks for static file, if not found proxy to app
try_files \$uri @app;
}
location @app {
@manuelmeurer
manuelmeurer / _etc_monit.d_mysql
Last active January 10, 2021 21:38
Monit config files
check process mysql
with pidfile /var/run/mysqld/mysqld.pid
start program = "/usr/sbin/service mysql start" with timeout 60 seconds
stop program = "/usr/sbin/service mysql stop" with timeout 60 seconds
if totalmem > 400 MB for 5 cycles then alert
if totalmem > 600 MB for 5 cycles then restart
if cpu > 50% for 5 cycles then alert
if cpu > 90% for 5 cycles then restart
if 3 restarts within 5 cycles then timeout