Skip to content

Instantly share code, notes, and snippets.

View balos1's full-sized avatar

Cody Balos balos1

View GitHub Profile
@balos1
balos1 / docker-cleanup
Created January 12, 2017 06:56 — forked from wdullaer/docker-cleanup
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
@balos1
balos1 / remote_modelsim.sh
Created February 5, 2017 08:57
Remotely use modelsim.
#!/bin/sh
#configuration
REMOTE_USER=john.doe
REMOTE_HOST=122.22.22.221
REMOTE_HOME='/home/john.doe'
REMOTE_MODELSIM_DIR='/opt/altera/10.0/modelsim_ase/bin'
COMMAND=`basename $0`
# calculate the arguments, with proper quotes around each argument
@balos1
balos1 / mathmacros.sty
Last active July 25, 2017 01:48
Macros for writing mathematical documents in LaTex.
% Helpful math mode macros.
%
% (c) Cody Balos
\NeedsTeXFormat{LaTeX2e}[]
\ProvidesPackage{mathmacros}[2017/01/20 Math Macros]
\RequirePackage{amsmath}
\ProcessOptions\relax
@balos1
balos1 / homework.sty
Last active July 25, 2017 01:49
LaTex package for creating beautiful homework.
\NeedsTeXFormat{LaTeX2e}[]
\ProvidesPackage{homework}[2017/03/07 Homework]
\RequirePackage{amsmath}
\RequirePackage{extramarks}
\RequirePackage{stackengine}
%% 'sans serif' option
\DeclareOption{sans}{
\renewcommand{\familydefault}{\sfdefault}
@balos1
balos1 / mips.sty
Created February 7, 2017 02:33
Package for mips highlighting in LaTex.
% MIPS Assembly language definition for the LaTeX `listings' package
%
% The list of instructions and directives are those understood by the
% MARS MIPS Simulator [http://courses.missouristate.edu/KenVollmar/MARS/]
%
% Author: Eric Walkingshaw <eric@walkingshaw.net>
%
% This code is in the public domain.
%
% Here is an example style. I like it for slides, but you might want
@balos1
balos1 / lab_report.tex
Last active May 25, 2023 09:11
A Lab Report LaTex Template
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% University/School Laboratory Report
% LaTeX Template
% Version 3.1 (25/3/14)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Linux and Unix Users Group at Virginia Tech Wiki

Keybase proof

I hereby claim:

  • I am cojomojo on github.
  • I am cojomojo (https://keybase.io/cojomojo) on keybase.
  • I have a public key ASBqujW0BwmCbhK4KbJqvLkybXQ8NAPOJxkOFHg9tH1eJAo

To claim this, I am signing this object:

@balos1
balos1 / timing.h
Last active March 7, 2023 13:14
C/C++ macro for timing blocks of code
/*
File: timing.h
Author(s):
Cody Balos
Description:
Useful stuff for timing programs.
MIT License
Copyright (c) [2017] [Cody Balos]
#!/bin/zsh
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /media/cody/Backup/cbalos-nixtop
# Created by https://www.gitignore.io/api/latex
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls