This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# introduced in https://tlehman.blog/p/introduction-to-puppet | |
# refined in https://tlehman.blog/p/introduction-to-puppet-part-3 | |
node default { | |
# Ensure the required packages are installed | |
package { ['ruby', 'bundler', 'libyaml-dev']: | |
ensure => installed, | |
} | |
exec { 'gem install rails -v 7.1.2': | |
cwd => '/', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# introduced in https://tlehman.blog/p/introduction-to-puppet | |
# refined in https://tlehman.blog/p/introduction-to-puppet-part-2 | |
node default { | |
# Ensure the required packages are installed | |
package { ['nginx', 'ruby', 'ruby-railties']: | |
ensure => installed, | |
} | |
# Configure Nginx to listen on port 80 and proxy to port 3000 | |
file { '/etc/nginx/sites-available/default': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node 'your-blog-name' { | |
# Ensure the required packages are installed | |
package { ['nginx', 'ruby', 'rails']: | |
ensure => installed, | |
} | |
# Configure Nginx to listen on port 80 and proxy to port 3000 | |
file { '/etc/nginx/sites-available/default': | |
ensure => file, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
GRAPH_NAME=tlehman | |
function roam_api_get_blocks_containing_string() { | |
curl -X POST "https://api.roamresearch.com/api/graph/$GRAPH_NAME/q" --location-trusted \ | |
-H "accept: application/json" \ | |
-H "Authorization: Bearer $ROAM_API_KEY" \ | |
-H "Content-Type: application/json" \ | |
-d "{\"query\" : \"[:find ?block-str :in \$ ?search-string :where [?b :block/uid ?block-uid] [?b :block/string ?block-str] [(clojure.string/includes? ?block-str ?search-string)]]\", \"args\": [\"$1\"]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// imgscale by tlehman: Fri 03/16/2012 | |
// toggles the size of images by some factor, defined as the variable "scale" | |
// | |
// NOTE: To change how much an image scales, just set the "scale" variable to | |
// some number, with 1.0 being 100%, 2.0 being 200% ... etc | |
// | |
// select images | |
var imgs = $("img"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <openssl/sha.h> | |
#include <openssl/ripemd.h> | |
#include <bitcoin/bitcoin.h> | |
#define BIP39_ENTROPY_LEN 32 | |
#define BIP39_MNEMONIC_LEN 12 | |
void bip39_to_address(const char *mnemonic, const char *password) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ec2type | mem_gb | vcpu | network_gigabits | maxpods | |
---|---|---|---|---|---|
vt1.3xlarge | 24 | 12 | 3.12 | 58 | |
vt1.6xlarge | 48 | 24 | 6.25 | 234 | |
c6gd.medium | 2 | 1 | 10 | 8 | |
x2gd.medium | 16 | 1 | 10 | 8 | |
m6gd.medium | 4 | 1 | 10 | 8 | |
r6gd.medium | 8 | 1 | 10 | 8 | |
r6g.medium | 8 | 1 | 10 | 8 | |
m6g.medium | 4 | 1 | 10 | 8 | |
c6g.medium | 2 | 1 | 10 | 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"log" | |
"github.com/awesome-gocui/gocui" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code golf: generating a Mandelbrot set in ASCII | |
# Height and Width of terminal | |
H = 40; W = 80; | |
def coord_to_complex(i, j): | |
""" map the region [0,H)x[0,W) into the | |
complex plane """ | |
re = float(4*i)/float(W-1) - 2.0 # real component | |
im = float(2.2*j)/float(H-1) - 1.1 # imaginary component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'colorize' | |
# find all available three-letter .io domains | |
alph = ('a'..'z') | |
# generate all three-character strings | |
threes = alph.map { |a| alph.map { |b| alph.map { |c| "#{a}#{b}#{c}" } } }.flatten | |
def io_available?(tld) | |
url = URI.parse("http://www.nic.io/cgi-bin/whois?query=#{tld}.io") |
NewerOlder