Skip to content

Instantly share code, notes, and snippets.

View tigarcia's full-sized avatar

Tim Garcia tigarcia

View GitHub Profile
@tigarcia
tigarcia / Solana Validator SSH Config.md
Last active September 6, 2023 16:50
A walkthrough of an ssh configuration that disables password login and root login for operators of Solana Validators

Step 1: Create sol User With SSH Access

Assuming you are logged into the remote machine with sudo privledges

  • sudo useradd sol
  • sudo usermod -aG sudo sol

Next verify that the sol user has sudo privledges:

  • sudo ls /root/
@tigarcia
tigarcia / solana-1.9-whats-new.md
Last active May 29, 2022 03:00
An overview of new features in solana v1.9.x that is relevant for validators

Solana 1.9.x Release Overview For Validators

The new 1.9.x release will be landing in mainnet soon. Here are some important new features to be aware of for validators:

1. Incremental snapshots

Snapshot size has become very large (On the order of 20 to 30GB to get a validator up and running). This change creates smaller incremental snapshots. Important: Once a validator starts using incremental snapshots, it cannot go back to version 1.8.

Recommended Upgrade Procedure:

const upperCaseFirstLetter = word => `${word[0].toUpperCase()}${word.slice(1)}`;
const upperCaseWords = s => s.split(" ").map(w => upperCaseFirstLetter(w)).join(" ");
console.log(upperCaseWords("code example to refactor"));
/*
or
const upperCaseFirstLetter = word => `${word[0].toUpperCase()}${word.slice(1)}`;
function upperCaseFirstLetter(word) {
return word[0].toUpperCase() + word.slice(1);
}
function upperCaseWords(sentence) {
var words = sentence.split(" ");
for (var i = 0; i < words.length; i++) {
words[i] = upperCaseFirstLetter(words[i]);
}
return words.join(" ");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js"></script>
@tigarcia
tigarcia / functional-stuff.md
Created April 18, 2017 01:30
functional-stuff.md

Functional Programming in JavaScript

Objectives:

  • Define what functional programming is
  • Define what a pure function is
  • Use built in functional methods forEach, filter, map, reduce
  • Understand key components of functional programming like composition and currying
  • Write curry, compose and flow functions
@tigarcia
tigarcia / movies.js
Created April 1, 2017 20:34
Top 50 IMDB Movies of 2016
var ids = ["tt3748528", "tt3470600", "tt3521164", "tt4972582", "tt1355644", "tt1082807", "tt2034800", "tt2119532", "tt1679335", "tt4501244", "tt4975722", "tt2094766", "tt2543164", "tt3183660", "tt0490215", "tt4550098", "tt4572514", "tt3783958", "tt2592614", "tt3385516", "tt1211837", "tt4846340", "tt3741834", "tt4034228", "tt4954522", "tt1386697", "tt1711525", "tt1212428", "tt3631112", "tt3640424", "tt2671706", "tt1431045", "tt1289401", "tt5073620", "tt1895315", "tt2361317", "tt4682786", "tt3387266", "tt3717252", "tt2140479", "tt2788732", "tt2660888", "tt4540710", "tt2948356", "tt1700841", "tt1564777", "tt1878870", "tt4838534", "tt2674426", "tt3553976"];
var movieData = [
{
"Title": "Rogue One",
"Year": "2016",
"Rated": "PG-13",
"Released": "16 Dec 2016",
"Runtime": "133 min",
"Genre": "Action, Adventure, Sci-Fi",
"Director": "Gareth Edwards",
// npm install --save twitter dotenv sentiment
require('dotenv').config();
const Twitter = require('twitter');
const sentiment = require('sentiment');
const rpio = require('rpio');
const Promise = require('bluebird');
function delay(ms) {
var deferred = Promise.pending();
@tigarcia
tigarcia / raspberry_pi.js
Last active March 2, 2017 20:38
workshop demo of raspberry pi and node js
import RPi.GPIO as GPIO
import time
led = 11
GPIO.setmode(GPIO.BOARD)
GPIO.setup(led, GPIO.OUT)
GPIO.output(led, GPIO.HIGH)
time.sleep(2)