Skip to content

Instantly share code, notes, and snippets.

View nyimbi's full-sized avatar

Nyimbi Odero nyimbi

  • Datacraft
  • Nairobi
View GitHub Profile
@nyimbi
nyimbi / Document_Conversion.md
Created October 30, 2023 04:49 — forked from datacustodian/Document_Conversion.md
Document Conversion

Document Conversion

This document outlines some ideas for document conversion on Linux and Mac OS X platforms using command line tools. Distribute documents as plain text using UTF-8 encoding whenever possible. Everyone should embrace the mantra "plain text is beautiful".

Document Metadata

Use file command to obtain basic metadata for most file formats. For image files make sure you have ImageMagick installed, then use identify command to extract image metadata.

Encoding Conversion

@nyimbi
nyimbi / usa_sic_codes.sql
Created October 9, 2023 04:21 — forked from robcowie/usa_sic_codes.sql
US SIC Codes, sql table definition and data
CREATE TABLE `sic_code` (
`code` varchar(32) NOT NULL DEFAULT '',
`label` varchar(256) DEFAULT NULL,
`parent_code` varchar(32) DEFAULT NULL,
`level` int(11) DEFAULT NULL
) DEFAULT CHARSET=utf8;
INSERT INTO `sic_code` (`code`,`label`,`parent_code`,`level`)
VALUES
('D','MANUFACTURING',NULL,0),
Remove file from git repository (history)
SOLUTION: This is the shortest way to get rid of the files:
1. check .git/packed-refs - my problem was that I had there a refs/remotes/origin/master line for a remote repository, delete it, otherwise git won't remove those files
2. (optional) git verify-pack -v .git/objects/pack/#{pack-name}.idx | sort -k 3 -n | tail -5 - to check for the largest files
3. (optional) git rev-list --objects --all | grep #{SHA_FROM_#_3} - to check what files those are
@nyimbi
nyimbi / AWS components.txt
Created September 19, 2023 15:50 — forked from jaytaph/AWS components.txt
A list of AWS components and what they do.
Compute
EC2 Virtual Private Servers
Lightsail Amazon's hosting provider (vps, dns, storage)
Lambda Functions you can run, written in Python, NodeJS, Go etc. Can run many in parallel.
Batch Run software jobs on EC2 machines
Elastic Beanstalk Run software on managed virtual machines
Serverless Application Repository Repository of serverless applications that you can deploy (on lambda)
AWS Outposts Basically run Amazon services on your own hardware (datacenter)
EC2 Image Builder Create EC2 (ami?) images automatically
@nyimbi
nyimbi / normcore-llm.md
Created September 7, 2023 21:59 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
# must have conda installed
git clone https://github.com/joonspk-research/generative_agents.git
cd generative_agents
# open visual studio code, open gen agents folder
# within vscode, go to reverie/backend_server
# create new file utils.py
# copy/paste contents from github (below)
###
# Copy and paste your OpenAI API Key
@nyimbi
nyimbi / s3fs mac mount linode bucket as folder
Last active May 26, 2023 23:47 — forked from jcaddel/S3FS on Mac OS X
How to mount a linode object store on a mac
Install s3fs on Mac OS X
1 - Install Homebrew if you haven't already - http://brew.sh/"Acce
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install --cask macfuse
brew install gromgit/fuse/s3fs-mac
3. Get the access key and secret key from linode for your buckets.
javascript:(function() {
var timeout = null;
var delay = 1000;
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
document.head.appendChild(script);
script.addEventListener('load', function() {
var mathJaxConfig = {
@nyimbi
nyimbi / System Design.md
Created September 28, 2022 05:03 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@nyimbi
nyimbi / exclude.sql
Created May 2, 2022 04:12 — forked from fphilipe/exclude.sql
PostgreSQL EXCLUDE constraint
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
EXCLUDE USING gist (
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)