Skip to content

Instantly share code, notes, and snippets.

View rjloura's full-sized avatar

Rui Loura rjloura

View GitHub Profile
@rjloura
rjloura / memory.d
Created March 27, 2020 14:10 — forked from rhb2/memory.d
#!/usr/sbin/dtrace -s
#pragma D option quiet
pid$target::malloc:entry
{
self->size = arg0;
}
pid$target::malloc:return
/self->size/
@rjloura
rjloura / postgres-cheatsheet.md
Created April 9, 2019 13:45 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@rjloura
rjloura / trunk-images.md
Last active March 27, 2020 13:21 — forked from jperkin/trunk-images.md
Test pkgsrc trunk bootstraps and images

consider using 20200124 images and tools

pkgsrc trunk packages and images

Now that pkgin has refresh support and the macOS trunk builds have proven that a rolling trunk release works well, I am happy to make SmartOS/illumos trunk packages and images available again for testing.

These are rolling builds of pkgsrc trunk every day (or so), providing the latest packages without having to upgrade across quarterly releases. Just install once then pkgin full-upgrade to keep up-to-date.

This is primarily of interest to:

@rjloura
rjloura / trunk-images.md
Created February 5, 2019 20:53 — forked from papertigers/trunk-images.md
Test pkgsrc trunk bootstraps and images

pkgsrc trunk packages and images

Now that pkgin has refresh support and the macOS trunk builds have proven that a rolling trunk release works well, I am happy to make SmartOS/illumos trunk packages and images available again for testing.

These are rolling builds of pkgsrc trunk every day (or so), providing the latest packages without having to upgrade across quarterly releases. Just install once then pkgin full-upgrade to keep up-to-date.

This is primarily of interest to:

  • Users who just want the latest software.
  • Users who don't want to bother with having to upgrade releases every quarter.
@rjloura
rjloura / README.md
Created September 11, 2018 15:09 — forked from jperkin/README.md
Creating a NetBSD VM on SmartOS

Instructions for building a NetBSD VM

Install

vmadm create < netbsd-install.json
vmadm list
zoneuuid=...
cp NetBSD-6.0-amd64.iso /zones/$zoneuuid/root/netbsd.iso

vmadm boot $zoneuuid order=cd,once=d cdrom=/netbsd.iso,ide

# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@rjloura
rjloura / no_compute_resources_available.md
Last active January 11, 2019 16:52 — forked from bahamat/no_compute_resources_available.md
Diagnosing "No Compute Resources Available" messages in Triton.

No Compute Resources Available

This error is somewhat ambiguious because there is seemingly no indication which resource is exhausted.

From Job UUID

Triton chooses compute nodes with a subcomponent called sdc-designation (also refered to as , DAPI). The full DAPI log for a provision job is embedded in the CNAPI log file and can be extracted with the workflow job uuid and the following script.

#!/bin/bash