Skip to content

Instantly share code, notes, and snippets.

View TooDumbForAName's full-sized avatar

I am not me TooDumbForAName

  • Pennsylvania, United States
View GitHub Profile
This file has been truncated, but you can view the full file.
#!/bin/bash
whoami=$(whoami)
setroot=$1
if [ "$whoami" != "root" ]
then
printf "%s\n" "This script needs to be run as root or with sudo."
exit 1
fi

Commands to create blank floppies

  • fallocate -l 1440k blank144.img (creates common 1.44 MB floppy image)
  • fallocate -l 1200k blank12.img (creates 1.2 MB floppy image)
  • fallocate -l 2880k blank288.img (creates 2.88 MB floppy image)
  • fallocate -l 720k blank720.img (creates 720k floppy image)
  • fallocate -l 360k blank360.img (creates 360k floppy image)

Commands to format floppies

  • mkfs.fat -I -F 12 -n LABEL fat.img (Standard FAT12 format)
  • mkfs.minix minix.img (Minix)
#!/bin/bash
#Common function
createpopulatedir () {
mkdir "$DIRECTORY"
printf "%s\n" "Copying contents from $PWD to $DIRECTORY."
cp -r . "$DIRECTORY"
printf "%s\n" "Copying complete!"
}
@TooDumbForAName
TooDumbForAName / IncrementInteger.py
Last active July 7, 2019 23:31
Increment Integer Evenly 'N' Times Starting At Zero
#!/usr/bin/env python
import sys
N = int(input("Enter an integer: "))
if N == 0:
sys.exit()
@TooDumbForAName
TooDumbForAName / csvtohtml.sh
Last active June 8, 2017 11:36
Basic CSV to HTML converter
#!/bin/bash
FILENAME=$1
if [ "$FILENAME" == "" ];
then
printf "%s\n" "Please specify the name of the CSV file to convert:"
read FILENAME
fi