Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

Harry Dam naviat

🪲
View GitHub Profile
@naviat
naviat / .env.example
Last active September 3, 2025 15:56
GRPC data loss
# Yellowstone gRPC Configuration
ENDPOINT=https://your-grpc-endpoint.com
X_TOKEN=your_auth_token_here
# Alternative environment variable names
# GRPC_ENDPOINT=https://your-grpc-endpoint.com
# AUTH_TOKEN=your_auth_token_here
@naviat
naviat / main.rs
Last active August 29, 2025 01:14
Debug degradation connection, no tx received when replace account in the same filter name.
use std::collections::HashMap;
use std::time::{Duration, SystemTime};
use std::path::Path;
use tokio::time::sleep;
use futures::SinkExt;
use yellowstone_grpc_client::{GeyserGrpcClient, Interceptor};
use yellowstone_grpc_proto::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Serialize, Deserialize)]
@naviat
naviat / best-solana-snap-sources.md
Created December 6, 2024 01:59 — forked from MyBlueLotus/best-solana-snap-sources.md
Best Solana Snapshot Download Sources

Best sources to download solana mainnet snapshots

Download the snapshots using wget.

  cd snapshots
  wget --trust-server-names <URL>

US East / NYC

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
@naviat
naviat / verify_public_key_and_retrieve_secret.py
Last active April 25, 2024 05:13
Verify public key and retrieve secret
import json
import boto3
import base64
import os
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
from botocore.exceptions import ClientError
///////
// Warning, code untested
///////
type Thinger interface {
SomeMethod( arg bool ) bool
}
type RealThing struct {
state bool
@naviat
naviat / README.md
Created March 5, 2024 04:21
redshift-backup_restore

manage-redshift

Amazon Redshift is a cloud data warehouse tool included in AWS. You can manage your data warehouse clusters using the AWS management Console or using the Amazon Redshift APIs. This post demonstrates a small subset of the Redshift API to create clusters from a snapshot and vice versa using a bash shell script.

If you want to delete a cluster, you have a choice of saving it first as a snapshot or deleting it with no final snapshot. With a snapshot, you can restore the cluster at a later time. If you choose not to save it as a snapshot, then the cluster will be deleted permanently with no restore option. In this case, you would have to recreate the cluster manually from scratch.

The script below only gives the user the option to save an existing cluster to a snapshot or restoring a cluster from an existing snapshot. To provide a measure of security and protection, you should set up IAM policies that walls off clusters and snapshots from accidental deletes or unprivileged access to your data.

@naviat
naviat / instructions.md
Created January 15, 2024 21:07 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@naviat
naviat / gist:fbce54e6b1b68dbc9cea0e9149e36188
Created May 29, 2023 08:05 — forked from luckydev/gist:ed966a7c12fd4b1311c063b77dc81389
Reset Google authenticator token (2FA) for a specific openvpn user
SSH Login as openvpnas user
$ ssh openvpnas@<open-vpn-server-ip>
$ cd /usr/local/openvpn_as/scripts/ # Go to OpenVPN AS Scripts directory
$ sudo ./sacli --user USERNAME GoogleAuthRegen # Replace USERNAME with username to get a new Google Authenticator Secret
Source: https://forums.openvpn.net/viewtopic.php?t=15366
@naviat
naviat / post-to-slack.sh
Created April 20, 2023 05:01 — forked from stekhn/post-to-slack.sh
Post to Slack using curl on the command line. The incoming webhook for your Slack team needs to be created beforehand.
# Read more about Slack webhooks here: https://api.slack.com/messaging/webhooks
curl -X POST \
-H 'Content-type: application/json; charset=utf-8' \
--data '{ "channel": "#mychannel", "username": "superbot", "icon_emoji": ":bot:", "text": "Foo" }' \
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX