Skip to content

Instantly share code, notes, and snippets.

@bjhaid
bjhaid / Install LT4 21.1.md
Created September 15, 2020 15:32 — forked from jetsonhacks/Install LT4 21.1.md
Install LT4 21.1 on Jetson TK1

For best results, you should read through the official NVIDIA documentation found on:

https://developer.nvidia.com/linux-tegra-rel-21

In particular, the Quick Start Guide.

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04 is officially recommended. In practice, this may be a virtual machine, I have used VirtualBox in the past. Also, I've successfully flashed from Ubuntu Linux 14.04. Your mileage may vary.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply

Linux Hugepages

Hugepages are a hardware feature designed to reduce pressure on the translation lookaside buffer (TLB) for applications that operate on large contiguous memory regions.

Take a program that operates on a large 2MB internal structure as an example. If the program accesses that space in such a way that one byte in each regular 4k page is accessed, 2M/4k = 512 TLB entries are needed. Each TLB miss at the hardware level requires and interrupt and kernel intervention to resolve. However, if the allocation is backed by a 2M hugepage by mmap()ing with MAP_HUGETLB, only 1 TLB entry is required.

On x86_64, there are two hugepage sizes: 2MB and 1G. 1G hugepages are also called gigantic pages. 1G must be enabled on kernel boot line with hugepagesz=1G. Hugeages, especially 1G ones, should to be allocated early before memory fragments (i.e. at/near boot time) to increase the likelihood that they can be allocated successfully with minimal memory migration (i.e. defreg) required

@bjhaid
bjhaid / exit_notify.go
Created May 8, 2019 16:41 — forked from pmalmgren/LICENSE
Go proc connector example, detects when a process exits
package main
import (
"bytes"
"encoding/binary"
"fmt"
"golang.org/x/sys/unix"
"os"
"syscall"
)
@bjhaid
bjhaid / ec2-metadata
Created January 22, 2019 16:26 — forked from copernicus/ec2-metadata
ec2-metadata: a simple tool for exploring Amazon EC2 metadata, extended with network and VPC info
#!/bin/bash
#
#########################################################################
#This software code is made available "AS IS" without warranties of any #
#kind. You may copy, display, modify and redistribute the software #
#code either by itself or as incorporated into your code; provided that #
#you do not remove any proprietary notices. Your use of this software #
#code is at your own risk and you waive any claim against Amazon #
#Digital Services, Inc. or its affiliates with respect to your use of #
#this software code. (c) 2006-2007 Amazon Digital Services, Inc. or its #
@bjhaid
bjhaid / main.go
Created April 28, 2017 17:12 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@bjhaid
bjhaid / service-checklist.md
Created September 23, 2016 15:11 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
%%% -*- coding: utf-8; Mode: erlang; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
%%% ex: set softtabstop=4 tabstop=4 shiftwidth=4 expandtab fileencoding=utf-8:
%%%
%%%------------------------------------------------------------------------
%%% @doc
%%% ==Abstract Code Insertion==
%%% A method to get the abstract code representation directly from the
%%% binary beam module representation.
%%%
%%% Other methods could be used, but they are not as efficient.
@bjhaid
bjhaid / Makefile
Last active August 29, 2015 14:05 — forked from seth/Makefile
DEPS = $(CURDIR)/deps
DIALYZER_OPTS = -Wunderspecs
# List dependencies that should be included in a cached dialyzer PLT file.
# DIALYZER_DEPS = deps/app1/ebin \
# deps/app2/ebin
DEPS_PLT = {{name}}.plt

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: