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

SSH

Remote SSH forwarding

ssh -R 8080:localhost:80 public.example.com 

SSH Aliasing

Host example
     HostName host.example.com
     User example

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))))

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

Add another remote url for an origin

git remote set-url --add origin git@github.com:example/example.git

Filter repostitory

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch dir/' HEAD

Last updated: 2019-11-28 Thu

Home