Skip to content

Instantly share code, notes, and snippets.

View ayjayt's full-sized avatar

personal ayjayt

  • Grupo Pikul S.A.S.
  • Medellín, Colombia
View GitHub Profile
@ayjayt
ayjayt / EAGLE_FIX.md
Last active November 20, 2017 03:45
How to install Eagle 8.4.1 on Linux if you get OpenSSL errors

Special thanks to nate on #openssl and [R] on #linux on Freenode.

I downloaded Eagle 8.4.1 on my Gentoo box, and untar'ed it in my downloads folder. I went to run with ./eagle, but it gave me errors about OpenSSL!

Now, I don't like dumping proprietary software all over my hyper-secure ultima-fast uber-reliable system, so I want to keep Eagle 8.4.1 in it's own folder in ~/Downloads/eagle_-8.4.1/ and just create a shortcut to the binary in there.

Therefore, the full run command for Eagle is (replace $EAGLEHOME with your extracted directory or set EAGLEHOME equal to it):

@ayjayt
ayjayt / lxc_gentoo-day_1.md
Last active April 15, 2018 05:52
Just a really quick introduction to lxc for gentoo

sudo -i

emerge app-emulation/lxc

lxc-checkconfig

go set up your kernel for the security features it wants. make sure to back up your working version.

this is a quick hack, there are more formal methods and this is considered lazy, but it gets the job done:

A microcontroller is fundamentally controlled by storing certain values to certain specific memory addresses. For example, an ARM micontroller, memory address 0x4000AA00 might be an 8-bit wide address that toggles a digital output pin mapped to a specific bit when 1 is written to it. So to toggle all 8 pins, you would write:

*((uint8_t *) 0x4000AA00) = 255;

This casts the address as a pointer, derefences it, and then stores 255 to it, which is 0b11111111.

These memory addresses aren't really memory, they're used to control peripherals.

You read the "Technical Reference Manual" for the device and it has a reference for each memory address and what it does, divided into function units (timers, inputs, outputs, whatever).

#define OFF 0
#define START 1
#define PROCESS_ONE 2
#define PROCESS_TWO 3
#define END 4
uint8_t state;
if (state == OFF) // etc
@ayjayt
ayjayt / just*_Overview.md
Created October 31, 2018 16:05
This is the basic idea behind the just* Go packages for easy API access with http handlers

The basic idea of all just* packages is to

A) Configure their config structures in main.go or wherever you set the http handlers.

B) Import them (or an interface that supports a class of them) when defining your handler.

C) Negotiate with the configurations that main.go has supplied and...

D) Use a closure to return a HandlerFunc for http.HandleFunc or initialize a type

@ayjayt
ayjayt / cheatsheet.md
Last active March 17, 2019 23:34
A cheatsheet

Test Driven Design

Write your tests first.

Domain Driven Design

Theory (Domain) --> Implementation --> Delivery

You start with theory. IE, understand the fundamental problem before writing a program, I guess.

Interfaces (Go)

Types that don't have a specific definition but rather a set of constraints that other types can fufill. Those constraints are usually "The type must have these operators declared" or in go-speak "The type must have these receivers declared".

@ayjayt
ayjayt / index.md
Last active April 18, 2019 13:45
What are indexes and how do they search, sort, and filter?

An Index can Order, Filter, and Search

Think of a physical, book-loaning library. It's a big room of books, but it's organized by the Dewey Decimal System (DDS). The DDS is sorted first by topic, and then by author within topic. Each book then has an index in the back, which is an alphabetical list of topics with page numbers.

In computer science, both the book index and the Dewey Decimal System are called "indices" (some say indexes). That is, they provide a way for you to find quickly by some category (topic, author, etc) the information that is relevant to you.

Database (computer science) indices are similiar in concept to both those examples, but the math is very different, click at your own risk.

But what you should notice, is that the index is already sorted by topic and already sorted by author. The fundamental code that provides the index provides the search, sort, and filter mechanisms. The request (the query) is what changes:

@ayjayt
ayjayt / FIREWALL.md
Last active June 19, 2019 20:54
An overview of Linux firewall stuff

Firewalls in Linux

Summary

Backends

The multilayered kernel firewall is built on netfilter, moving towards Berkely Packet Filter architecture. There are two options for interacting with it:

  • ip_tables is the original kernel module, and comes with the iptables user utility (notice the missing underscore for the user utility).
@ayjayt
ayjayt / routerBB.md
Last active December 9, 2020 04:57
How to turn your BB into a router using wifi as internet source

First, set up DHCP on "router" device:

Give eth0 an IP address (forget command, I gave it 192.168.2.1)

Give DNSMASQ a config file with these lines:

NOTE:

  1. Doubt all lines necessary
  2. ADDED to defaults, and taken from here:
@ayjayt
ayjayt / CLASS.md
Last active March 27, 2024 14:34
CLASS.md

Class Notes

Video 1

  • Install Anaconda <-- You can stop here to get started!
    • Create new envionrment
    • Install basics
    • Download project sample
    • Install notebook
    • Do same for another environment
  • Demonstrate Use