Skip to content

Instantly share code, notes, and snippets.

View nerd190's full-sized avatar
🤓
coding to music 🎵

Scott nerd190

🤓
coding to music 🎵
  • London
View GitHub Profile
@sultanofcardio
sultanofcardio / git-https-to-ssh.sh
Last active February 12, 2022 18:28
git-https-to-ssh.sh
#!/usr/bin/env bash
set -e
if [ "$#" -ne 1 ]; then
echo "Search root was not supplied. Searching from current directory"
SEARCH_ROOT="$(pwd)"
else
SEARCH_ROOT="$(readlink -f $1)"
echo "Searching from ${SEARCH_ROOT}"
@angerman
angerman / nixos-on-rockpi4.org
Created May 28, 2020 13:53
NixOS on RockPi4

Installing NixOS on the RockPi4 (B)

The general plan is to build an sd-image-aarch64 from nixpkgs/nixos/modules/installer/cd-dvd/sd-image-aarch64.nix flash it to the eMMC and have the system come up, similar to how this “just works” for raspberry-pis.

The RockPi 4 is a RockChip RK3399 based board, build by radxa with the same formfactor as a rasperry Pi. One noticable difference is that the Rock Pi’s cpu is at the bottom to better allow for the

@chrisanthropic
chrisanthropic / nixos-raspi4.md
Last active August 14, 2024 17:01
NixOS + Raspi4

Download the image builder

  • git clone git@github.com:Robertof/nixos-docker-sd-image-builder.git
  • cd nixos-docker-sd-image-builder

Configure for Raspi4

  • modify /config/rpi4/default.nix to increase size of boot partition
    • this step is optional but I ran out of space in /boot pretty quickly with the default setting since I'm still learning and rebuilding a lot. Let's leave some room for trial & error.
    • sdImage.firmwareSize = 1024;
  • modify /config/sd-image.nix
  • ./rpi3 becomes ./rpi4
C:\Users\george>luarocks config
accept_unknown_fields = false
arch = "win32-x86_64"
cache = {
luajit_version_checked = true
}
cache_fail_timeout = 86400
cache_timeout = 60
check_certificates = false
cmake_generator = "MinGW Makefiles"
@mdolinin
mdolinin / github_bitbucket_multiple_ssh_keys.md
Last active January 26, 2022 15:07 — forked from yinzara/github_bitbucket_multiple_ssh_keys.md
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@shmup
shmup / nonymous-ix.vim
Last active September 8, 2021 01:30
nonymous-ix.vim uses .netrc for auth, and fucks with ix.io
" nonymous-ix.vim uses .netrc for auth, and fucks with ix.io
" insert :IX [optional visual selection] - copies url to system clipboard
" replace :RX <URL> [optional visual selection]
" delete :DX <URL>
if has('win64') || has('win32') || has('win16')
let s:env = 'WINDOWS'
else
let s:env = toupper(substitute(system('uname'), '\n', '', ''))
endif
@CausticD
CausticD / Readme.txt
Last active September 26, 2022 03:35
Wireguard Setup on Raspberry Pi 4
This installation guide assumes using Windows. It is mainly for me to document the process so that I can do it again when I break something!
Phase 1: Get a working copy of an up to date Rasbian on the Pi:
(Follow guide for basic Raspbian here: https://gist.github.com/CausticD/06e74f178e0772a1717a5d9a232d2bd9#file-basicraspbian-txt)
Phase 2: Install Wireguard
Links:
https://www.wireguard.com/install/
@davidlares
davidlares / clipboard.py
Created February 3, 2020 20:20
A Python 2.x script for demonstrating the Pyperclip package
#!/usr/bin/python
import pyperclip
import time
p_list = [] # list datatype for password clipboard selection
while True:
# evaluating existence
if pyperclip.paste() != 'None':
value = pyperclip.paste() # paste content
@wbthomason
wbthomason / help.vim
Last active January 29, 2025 08:43
Neovim: Open help in a floating window
scriptencoding utf-8
" This function originates from https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
@Meorawr
Meorawr / async.lua
Last active September 8, 2024 20:17
Lua 5.1 Async/Await
#!/usr/bin/lua5.1
--- Async/Await for Lua 5.1
-- This script implements async/await functions for Lua, allowing tasks to
-- be queued and scheduled independently.
--
-- This is just an example and has a bunch of issues, isn't tested, isn't
-- even actually used anywhere; I basically just got bored and had one of
-- those "what if?" type ideas 6 hours ago.
local co_create = coroutine.create