This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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 <[email protected]> | |
% | |
% This code is in the public domain. | |
% | |
% Here is an example style. I like it for slides, but you might want |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\NeedsTeXFormat{LaTeX2e}[] | |
\ProvidesPackage{homework}[2017/03/07 Homework] | |
\RequirePackage{amsmath} | |
\RequirePackage{extramarks} | |
\RequirePackage{stackengine} | |
%% 'sans serif' option | |
\DeclareOption{sans}{ | |
\renewcommand{\familydefault}{\sfdefault} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Helpful math mode macros. | |
% | |
% (c) Cody Balos | |
\NeedsTeXFormat{LaTeX2e}[] | |
\ProvidesPackage{mathmacros}[2017/01/20 Math Macros] | |
\RequirePackage{amsmath} | |
\ProcessOptions\relax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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'}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DAY=`/bin/date +%Y%m%d` | |
PAST_DAY=`/bin/date -d '5 days ago' +%Y%m%d` | |
mysqldump DATABASE -u root -pPASSWORD > /path/to/it/DATABASE.$DAY.sql | |
rm -f /path/to/it/DATABASE.$PAST_DAY.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1"] | |
then | |
echo "./create.cert <name>" | |
echo "please provide name argument" | |
exit 1 | |
else | |
name=$1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run like so: | |
# docker-mongodump <mongo container name> <path to backups> | |
MONGO_CONTAINER=$1 | |
BACKUPS_PATH=$2 | |
DAY=`/bin/date +%Y%m%d` | |
PAST_DAY=`/bin/date -d '3 days ago' +%Y%m%d` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#docker stop all containers | |
function docker-stopall() { docker stop $(docker ps -a -q) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#docker remove all containers | |
function docker-rmall() { | |
printf "The operation will remove all of the following containers: \n" | |
printf '%s \n' $(docker ps -a -q) | |
printf '%s ' 'Continue? [Y/n]: ' | |
read response | |
# if yes then proceed | |
if [[ $response =~ ^[Yy]$ ]] | |
then |