Skip to content

Instantly share code, notes, and snippets.

View RhubarbSin's full-sized avatar

Rhubarb Sin RhubarbSin

View GitHub Profile
@RhubarbSin
RhubarbSin / macos-dock-animation.org
Last active May 9, 2024 15:15
Configure macOS dock animation

Increase speed of dock animation

defaults write com.apple.dock autohide-time-modifier -float 0.4; killall Dock

Remove dock animation

defaults write com.apple.dock autohide-time-modifier -int 0; killall Dock

Restore default dock animation

defaults delete com.apple.dock autohide-time-modifier; killall Dock
@RhubarbSin
RhubarbSin / oci-metadata.sh
Last active July 11, 2022 23:21
Get OCI compute instance metadata
curl http://169.254.169.254/opc/v1/instance/
curl -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/
curl -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/metadata/
curl -H "Authorization: Bearer Oracle" http://169.254.169.254/opc/v2/instance/metadata/<any-key-name>
@RhubarbSin
RhubarbSin / generate-ed25519-ssh-key.sh
Created May 1, 2022 16:24
Generate an Ed25519 SSH key
ssh-keygen -t ed25519 -a 200 -C "you@host" -f ~/.ssh/my_new_id_ed25519
@RhubarbSin
RhubarbSin / emacs-server-ssh-forwarding.org
Last active April 15, 2024 21:21
Use SSH to forward local Emacs server socket to remote host so emacsclient on remote host can open buffers in Emacs on local host

Get path of remote socket: execute on remote host

emacs --batch --execute "(progn
        (require 'server)
        (princ (expand-file-name \"remote\" server-socket-dir)
               #'external-debugging-output))"

Get path of local socket: execute on local host

emacs --batch --execute "(progn
@RhubarbSin
RhubarbSin / emacs-28.1-amazon-linux-2022.sh
Last active May 1, 2022 16:25
Compile Emacs 28.1 on Amazon Linux 2022
sudo dnf -y install '@Development Tools' cmake gnutls-devel libgccjit-devel ncurses-devel wget
wget https://ftpmirror.gnu.org/emacs/emacs-28.1.tar.gz https://ftpmirror.gnu.org/emacs/emacs-28.1.tar.gz.sig
gpg --keyserver keyserver.ubuntu.com --recv-keys 17E90D521672C04631B1183EE78DAE0F3115E06B
gpg --verify emacs-28.1.tar.gz.sig
tar zxf emacs-28.1.tar.gz
cd emacs-28.1
./configure --with-native-compilation
make
src/emacs -Q
src/emacs --debug-init --chdir ~
@RhubarbSin
RhubarbSin / aws-cli-s3-signature-version-4.sh
Created March 3, 2022 00:28
Configure AWS CLI to use AWS Signature Version 4 when creating presigned S3 URLs
aws configure set default.s3.signature_version s3v4
@RhubarbSin
RhubarbSin / emacs-reference-use-package.org
Last active March 3, 2022 00:32
Reference for Emacs use-package macro

:init execute code before a package is loaded

Summary

Accepts one or more forms, up to the next keyword.

Example

(use-package foo
  :init
  (setq foo-variable t))
@RhubarbSin
RhubarbSin / emacs-reference-straight.el.org
Last active March 3, 2022 00:33
Reference for Emacs straight package manager

Upgrading packages

straight-pull-package

Pull a single package to upgrade it to the latest version.

straight-pull-package-and-deps

Pull a package and all of its dependencies.

straight-pull-all

Upgrade all of your active packages.

straight-check-package

Activate the upgraded version of a package while Emacs is running.

straight-check-all

@RhubarbSin
RhubarbSin / gist:2d231f59acae2458cd8d015ebe9bcde3
Last active March 3, 2022 00:34
Compile GNU Emacs for macOS Catalina
sudo port install automake autoconf pkgconfig libxml2 gnutls
./configure --includedir=/opt/local/include --with-modules
make
make -i install
make -i install-info
sudo mv nextstep/Emacs.app/ /Applications/
# https://github.com/github/linguist/blob/master/docs/overrides.md
*.org linguist-detectable=true