Skip to content

Instantly share code, notes, and snippets.

View floer32's full-sized avatar

Michael Floering floer32

  • 17:52 (UTC -07:00)
View GitHub Profile
@floer32
floer32 / HOWTO_install_xmobar_with_all_extensions.sh
Last active September 16, 2021 08:05
HOWTO xmobar with all extensions in Arch Linux
#!/bin/sh
# install cabal-install if necessary
sudo pacman -S cabal-install
# preparing to install xmobar with all extensions
sudo pacman -S alex
yaourt haskell-language-c-03
sudo cabal install --global c2hs
sudo cabal install --global alsa-mixer
@floer32
floer32 / prepareImageGallery
Last active December 16, 2015 13:38
A little script I used to take all images in a folder and generate two sizes of it - one thumbnail size, one large-but-not-too-large. For use in an online image gallery. This is still raw and could certainly be refactored a bit, but it gets the job done. This script generated the images for the gallery on FloeringPlastering.com. DEPENDS ON Image…
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# This script walks all images in current directory and all of its subdirectories
# (and so on). Two copies of each image are made, one of the size specified
# by --large and one of the size specified by --thumb. The copies are saved in
# a subdirectory named according to size, adjacent to the original file.
# For example, given the following structure:
#
# my_images/
@floer32
floer32 / centos_python_env_setup
Last active May 2, 2022 03:47 — forked from stantonk/doit
CentOS 6: Install Python 2.7.4, pip, virtualenv, and virtualenvwrapper on CentOS (plus some bonus items at the end if you want). You should probably run with `sudo`.
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
@floer32
floer32 / centos_cx_Oracle
Last active January 6, 2020 23:29
CentOS 6: Set up Oracle Instant Client and Python package cx_Oracle
#!/bin/bash
# INSTALL ORACLE INSTANT CLIENT #
#################################
# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there's a good chance that you don't have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space
@floer32
floer32 / tiny_colored_bash_prompt.sh
Created May 9, 2013 16:43
Tiny colored prompt. I don't love it, but I've been using it for a while anyways. Best feature is that it is colorized based on the exit status of the previous command.
#########################################
## Prompt stylization and history sync ##
#########################################
bash_prompt_command() {
# Grab exit status of previous command
RTN=$?
prevCmd=$(prevCmd $RTN)
# Save and reload the history after each command finishes
@floer32
floer32 / linux_mint_python_development_environment_setup.sh
Last active May 9, 2017 08:39
Linux Mint 14 Python development environment set up. Installs Python 2.7.4, pip, virtualenv, and virtualenvwrapper, and more. If you are executing this whole script, run with `sudo`.
sudo apt-get update
# General development essentials
sudo apt-get install -y build-essential ssh git gitk
# Databases: You may not need all of these;
# none are explicit dependencies of other items in this script.
# SQLite and MySQL are pretty generally used for web development,
# and ODBC is just something we use at work.
sudo apt-get install -y sqlite
@floer32
floer32 / linux_mint_cx_Oracle.sh
Last active June 4, 2018 08:07
Linux Mint 14 cx_Oracle and Oracle Instant Client setup.
#!/bin/bash
# SPECIFY THE VIRTUALENV YOU WANT TO INSTALL cx_Oracle TO #
###########################################################
# Change this to whatever you want, but note that this script isn't going to make the virtualenv for you.
# It assumes the environment already exists.
MY_VIRTUAL_ENV='dynamic'
# INSTALL ORACLE INSTANT CLIENT'S DEPENDENCIES #
@floer32
floer32 / tupperware.py
Last active September 26, 2022 12:13
recursively convert nested dicts to nested namedtuples, giving you something like immutable object literals
from UserDict import IterableUserDict
import collections
__author__ = 'github.com/hangtwenty'
def tupperware(mapping):
""" Convert mappings to 'tupperwares' recursively.
@floer32
floer32 / logging_subprocess.py
Last active December 22, 2015 00:39 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.

Written with StackEdit.

Scratch Programming Activities

For the Veracode HacKIDthon

Ordered by level of difficulty and probably age or experience of student, beginning with the easiest.