Skip to content

Instantly share code, notes, and snippets.

@agam
agam / Chroot.sh
Created September 16, 2023 07:41
Simple chroot-er
#/bin/bash
mkdir /home/namespace/box
mkdir /home/namespace/box/bin
mkdir /home/namespace/box/lib
mkdir -p /home/namespace/box/usr/lib
mkdir /home/namespace/box/lib64
mkdir /home/namespace/box/proc
mkdir /home/namespace/box/data
@agam
agam / iTerm.md
Created April 29, 2016 03:12
Fix Alt-b and Alt-f behavior in iTerm
  • Open Preferences, select Profiles, and then the Keys tab.
  • Change the radio button selection for the left (and/or right) Option key to be +Esc instead of Normal
@agam
agam / image_conversion.md
Last active April 2, 2023 10:36
Convert Google Drive url for Images to a URL that can be used as a Direct Link
  1. Upload image to Google Drive
  2. Make the image publicly shareable, and get the sharing URL
  3. The URL might be something like https://drive.google.com/file/d/foo
  4. Rewrite this to something like https://drive.google.com/uc?id=foo
  5. When you enter this link in the browser, you'll get another link, something with docs.googleusercontent.com in the URL
  6. Go ahead and embed this last link ...
@agam
agam / ciel-lispworks.md
Last active September 7, 2022 07:35
Getting CIEL to work under Lispworks

Works fine in SBCL (though still needed some changes like avoiding fof and a new asdf version; some of that might be specific to the M1 Macbook I'm using)

Lispworks error:

CL-USER 1 > (ql:quickload "ciel")
To load "ciel":
  Load 1 ASDF system:
    ciel
@agam
agam / rebar-lfe.sh
Created April 25, 2022 06:04
Minimal LFE quick-start with Rebar
## Install rebar
$ brew install rebar3
## Create a basic app
$ rebar3 new lfe-main hello-world
## Run it
$ cd hello-world
$ rebar3 lfe run
@agam
agam / pq_copy_demo.go
Created October 27, 2021 08:28
Example of copying a CSV file into Postgres
package main
import (
"database/sql"
"encoding/csv"
"io"
"log"
"os"
"strconv"
@agam
agam / julia_nix_2.sh
Created May 28, 2020 21:35
Julia build errors in Nix (2)
abstractarray (3) | 95.06 | 10.17 | 10.7 | 4644.22 | 1128.55
copy (3) | 4.53 | 0.73 | 16.1 | 163.99 | 1137.33
math (3) | 61.15 | 4.49 | 7.3 | 2922.46 | 1166.40
fastmath (3) | 9.71 | 0.79 | 8.1 | 423.55 | 1172.64
functional (3) | 11.60 | 1.22 | 10.5 | 629.91 | 1186.18
iterators (3) | 66.29 | 8.28 | 12.5 | 3853.52 | 1252.83
operators (3) | 8.79 | 1.07 | 12.2 | 486.14 | 1263.14
path (3) | 4.47 | 0.19 | 4.3 | 96.64 | 1295.82
ccall (3) | 150.80 | 137.32 | 91.1 | 699.45 | 1297.29
parse (3) | 15.78 | 2.03 | 12.9 | 855.21 | 1297.29
@agam
agam / julia_nix_1.sh
Last active May 28, 2020 21:35
Julia install failure on Nix (1)
LINK src/support/libsupport.a
Warning: git information unavailable; versioning information limited
CC src/flisp/flisp.o
In file included from /build/source/usr/include/llvm/IR/IRBuilder.h:19,
from /build/source/src/llvmcalltest.cpp:7:
/build/source/usr/include/llvm/ADT/ArrayRef.h: In instantiation of 'llvm::ArrayRef<T>::ArrayRef(const std::initializer_list<_Tp>&) [with T = llvm::Type*]':
/build/source/src/llvmcalltest.cpp:20:42: required from here
/build/source/usr/include/llvm/ADT/ArrayRef.h:102:37: warning: initializing 'llvm::ArrayRef<llvm::Type*>::Data' from 'std::initializer_list<llvm::Type*>::begin' does not extend the lifetime of the underlying array [-Winit-list-lifetime]
102 | : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
Warning: git information unavailable; versioning information limited
@agam
agam / babushka.sh
Created May 28, 2020 06:40
Babashka build failure on Nix
Finished Archiving GRAALVM_UNKNOWN_STAGE1
Building gu.image... [dependencies updated: GRAALVM_UNKNOWN_STAGE1]
env MX_SUBPROCESS_COMMAND_FILE=/build/mx_subprocess_command.hjlpZv GRAAL_PYTHONHOME=/build/mxgitcache/graalpython/graalpython MX_HOME=/nix/store/ir3m6581n7r7h9c0f8xxplvzfnl4gfnv-mx-5.247.1/bin MX_PRIMAR
Y_SUITE_PATH=/build/source/vm MX__SUITEMODEL=sibling \
/build/mxbuild/vm/linux-amd64/GRAALVM_UNKNOWN_STAGE1/graalvm-unknown-19.2.1/jre/lib/svm/bin/native-image --macro:gu-launcher -H:NumberOfThreads=2 -H:Path=/build/mxbuild/vm/linux-amd64/gu.image
[gu:9553] classlist: 4,413.68 ms
[gu:9553] (cap): 3,512.98 ms
[gu:9553] setup: 5,923.23 ms
[gu:9553] (typeflow): 27,842.68 ms
[gu:9553] (objects): 18,776.35 ms
agam@ubuntu-s-2vcpu-4gb-sfo3-01:~$ nix search emacs
warning: using cached results; pass '-u' to update the cache

...

* nixpkgs.emacs (emacs)
  The extensible, customizable GNU text editor