Skip to content

Instantly share code, notes, and snippets.

View koma-xrd's full-sized avatar
💭
I may be slow to respond.

komatz koma-xrd

💭
I may be slow to respond.
View GitHub Profile
#07072021: backups of the booted ssd to the non booted ssd
booteddisk=$(df /boot | grep -Eo '/dev/[a-z]*')
if [[ "$booteddisk"=="/dev/sdb" ]]
then
echo "booted from sdb - cloning to sda"
sudo rpi-clone sda -f -U
else
if [[ "$booteddisk"=="/dev/sda" ]]
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
@koma-xrd
koma-xrd / create_new_user.md
Created February 2, 2021 16:48 — forked from JeremyIglehart/create_new_user.md
How to create a new user and remove the `pi` user on a Raspberry Pi

How to create a new user and remove the pi user on a Raspberry Pi

Note: This has been tested in Rasbian Buster released on 2019-06-20

Important: replace jeremy below with whatever username you'd like as your new user.

  1. sudo adduser jeremy
    • You will be asked to enter a password
    • When filling out basic information about the user, you may leave it blank
@koma-xrd
koma-xrd / import_minimizer.rb
Created March 28, 2017 10:58 — forked from Orangenhain/import_minimizer.rb
Script that takes a ObjC .m file and tries to find unused (or duplicate) import statements by commenting out each #import line in turn and seeing if the project still compiles. You will have to change BUILD_DIR & BUILD_CMD.
#!/usr/bin/env ruby -w
class String
def starts_with?(prefix)
prefix.respond_to?(:to_str) && self[0, prefix.length] == prefix
end
end
HEADER_REGEX = /^#import\s+["<](.*)[">]/