Skip to content

Instantly share code, notes, and snippets.

View nathanleclaire's full-sized avatar
👨‍🍳
Cooking up great code

Nathan LeClaire nathanleclaire

👨‍🍳
Cooking up great code
View GitHub Profile
@nathanleclaire
nathanleclaire / manifest.json
Created March 10, 2016 20:30
chrome extension contextmenus sample
{
"name": "Context Menus Sample",
"description": "Shows some of the features of the Context Menus API",
"version": "0.6",
"permissions": ["contextMenus"],
"background": {
"scripts": ["sample.js"]
},
"manifest_version": 2
project:
id: 8854c0fe-1367-4a83-8632-6193d2a20609
name: traces
defaults:
python_version: 3.11
diff --git a/Anchor.toml b/Anchor.toml
index 9bf3ac1..9e62d44 100644
--- a/Anchor.toml
+++ b/Anchor.toml
@@ -2,7 +2,7 @@
seeds = false
[programs.localnet]
-karma = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
+karma_token = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS"
(async () => {
console.log('LFG');
const startBlock = 117416695;
const blocks = range(startBlock, startBlock + 100000);
let fees = 0;
for (const i of blocks.values()) {
try {
const solConn = new sol.Connection(
'solapi.com',

with cli tools:

$ solana airdrop 1 --url localhost
Requesting airdrop of 1 SOL
Error: airdrop request failed. This can happen when the rate limit is reached.

rpc logs:

$ solana-keygen new --outfile ~/my-solana-wallet/my-keypair2.json
Generating a new keypair

For added security, enter a BIP39 passphrase

NOTE! This passphrase improves security of the recovery seed phrase NOT the
keypair file itself, which is stored as insecure plain text

BIP39 Passphrase (empty for none): thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 6, kind: Other, message: "The handle is invalid." }', keygen\src/keygen.rs:574:92
@nathanleclaire
nathanleclaire / ssh-tunnel-proxy-digitalocean.md
Last active September 2, 2021 08:53
A description of how to get started using SSH tunneling. Intended for subverting network shaping and other nasty things imposed on you by arbitrary networks.

This is a method to create a proxy which is pretty simple and does not involve using shady websites or proprietary applications, etc.

  1. First, create a server, such as a DigitalOcean droplet.

  2. Once the server is created, verify that you can login via SSH:

    $ ssh user@<ip>
    
  3. If that is working, creating a local [SOCKS5] proxy using OpenSSH is just one command. Here is one suggestion:

class LinkedList:
next = None
val = None
def __init__(self, val):
self.val = val
def add(self, val):
if self.next == None:
self.next = LinkedList(val)
@nathanleclaire
nathanleclaire / ffmpeg_dark_magic.md
Created June 27, 2021 01:08
Encode YouTube compatible video file of just one image with audio using ffmpeg

Trying to crank out a video which is:

  1. YouTube compatible
  2. Small-ish
  3. Preserves lossless audio
  4. Doesn't crash VLC, etc. (this happened embedding a FLAC direct in a WMV)
  5. Encodes as quickly as possible

So far, the best I've come up with is as follows:

@nathanleclaire
nathanleclaire / coreos-aws-docker-machine.md
Created March 3, 2017 19:43
Create CoreOS VM on AWS with Docker Machine

This is slightly trickier than I anticipated so noting it down for future reference.

The command should be along these lines (assuming AWS keys are configured via environment variables or config file):

$ docker-machine create \
  -d amazonec2 \
  --amazonec2-region us-west-1 \
  --amazonec2-ami ami-818bd5e1 \
 --amazonec2-zone b \