Dev

This is an ongoing collection of handy dev tricks.

Arch Linux

encrypted uefi install Guide

mount usb

mkdir /mnt/usb
# check for the usb dev with
sudo fdisk -l 
sudo mount /dev/sdx /mnt/usb

Weird fonts in firefox

fix

pacman -S ttf-liberation

screen recording

use xiwinfo to get x and y coords of desired windows. –on-the-fly-encoding stops memory usage from growing out of control.

xiwinfo 
recordmydesktop -x 64 -y 49  --width 672 --height 629 --no-sound --delay 2  --on-the-fly-encoding
ffmpeg -i out-6.ogv -ss 00:00:00 -to 00:00:22  -c:v libx264 -preset veryslow -crf 22  -c:a libmp3lame -qscale:a 2 -ac 2 -ar 44100 del.mp4

latex

install

mkdir /mnt/iso
mount -o loop texlive.iso /mnt/iso
cd /mnt/iso
sudo ./install-tl

stymied error

Error

Fatal format file error; I'm stymied

Fix

export PATH=/usr/local/texlive/2017/texmf-dist/doc/man/:$PATH
export PATH=/usr/local/texlive/2017/texmf-dist/doc/info/:$PATH
export PATH=/usr/local/texlive/2017/bin/x86_64-linux/:$PATH

emacs

pdf-info-check-epdfinfo is not executable

fix

M-x pdf-tools-install

Netowkring

ip link set dev eth0 up

wifi-menu

not finding any networks

sudo rfkill unblock wifi
sudo rfkill unblock all

Android

logging

You can log an error such that it prints the entire stack trace.

try {
// Dangerous thing
} catch (Exception e) {
   Log.e("Dangerous thing","Exception occured",e);
}

Sh

Docker

build

sudo docker build -t tag .

run

sudo docker run -it tag /bin/bash

commit

You should commit containers if you want to save changes made to it during runtime

sudo docker commit b0944b7ed78b alice/haskell

mnt current working directory

docker run --mount type=bind,source="$(pwd)",target=/app -it haskell /bin/bash

copying files

copy file into running docker container

Emacs

add magit

(use-package magit
  :ensure t)

;; add magit status keyboard
(global-set-key (kbd "C-x g") 'magit-status)

making org bullets look pretty

(unless (package-installed-p 'use-package)
        (package-refresh-contents)
        (package-install 'use-package))

(use-package org-bullets
  :ensure t
  :config
  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))

generate batches of org checkboxes from range

import random
x = [i+1 for i in range(22)]
#print(x)
res = []
while len(x) > 0:
  y = []
  i = 0
  while len(x) > 0 and i < 5:
    z = random.choice(x)
    x.remove(z)
    y.append(z)
    i+=1
  res.append(y)
print(res)
for ind,i in enumerate(res):
  print("**** batch " + str(ind))
  print("- [/] progress")
  for z in res[ind]:
    print("  - [ ] ." + str(z))

orgmode

Rust

cargo build cargo run cargo update cargo doc –open rustup doc –book

enable nightly mode

rustup default nightly

Git

set upstream origin

git push -u origin dev

Last updated: 2019-10-09 Wed

Home