Skip to content

Instantly share code, notes, and snippets.

View brycepg's full-sized avatar

Bryce Guinta brycepg

View GitHub Profile
#!/bin/bash
foobar=$(echo -e "coding\nbrowsing\npron" | dmenu)
workspace.rb "$foobar"
@brycepg
brycepg / gist:a36cb6ae5c94783c4567
Last active August 10, 2016 23:32
Scaling Noise
{
"cells": [
{
"cell_type": "code",
"execution_count": 49,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@brycepg
brycepg / yield_from.ipynb
Created August 10, 2016 06:40 — forked from anonymous/yield_from.ipynb
Why Python's 3.x's "yield from" is useful
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brycepg
brycepg / exc_report.ipynb
Last active August 12, 2016 06:24
Return Report of Procedural Functions using Decorators in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brycepg
brycepg / main.py
Last active October 5, 2016 03:55
Generate List Combinations Using Bitwise Arithmetic
def combinate(list_):
"""Generate all combinations of a list(unordered)"""
combinations = []
for count in range(1, 2**len(list_)):
combinations.append(
[elem for cur_index, elem in enumerate(list_)
if (count >> cur_index) & 1]
)
return combinations
<title>Vdbench henkdebug2-fix/localhost-0.stdout.html</title><pre>
stdout/stderr for slave=localhost-0
12:15:51.782 12:15:51.781 SlaveJvm execution parameter: '-m localhost'
12:15:51.782 12:15:51.781 SlaveJvm execution parameter: '-n localhost-10-170327-12.15.51.514'
12:15:51.782 12:15:51.781 SlaveJvm execution parameter: '-l localhost-0'
12:15:51.782 12:15:51.781 SlaveJvm execution parameter: '-p 5570'
12:15:51.782 12:15:51.781 SlaveJvm execution parameter: '-d 48'
12:15:51.782 12:15:51.781 SlaveJvm positional parameter: 'SlaveJvm'
12:15:51.793 12:15:51.792 successfully connected to master localhost
<title>Vdbench henkdebug4-curved/localhost-0.stdout.html</title><pre>
stdout/stderr for slave=localhost-0
14:42:39.311 14:42:39.310 SlaveJvm execution parameter: '-m localhost'
14:42:39.311 14:42:39.311 SlaveJvm execution parameter: '-n localhost-10-170327-14.42.39.017'
14:42:39.311 14:42:39.311 SlaveJvm execution parameter: '-l localhost-0'
14:42:39.311 14:42:39.311 SlaveJvm execution parameter: '-p 5570'
14:42:39.312 14:42:39.311 SlaveJvm positional parameter: 'SlaveJvm'
14:42:39.321 14:42:39.320 successfully connected to master localhost
14:42:39.321 14:42:39.321 Connection to localhost using port 5570 successful
@brycepg
brycepg / 1. logfile.html
Last active July 31, 2020 19:49
vdbench failure due to network switch failure
<title>Vdbench R4K0R_1QD/logfile.html</title><pre>
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Vdbench distribution: vdbench50406
22:04:51.166 input argument scanned: '-o/home/bguinta/data/R4K0R_1QD'
22:04:51.168 input argument scanned: '-d12'
22:04:51.168 input argument scanned: '-f/home/bguinta/data/R4K0R_1QD/parm.txt'
22:04:51.168 input argument scanned: '-m1'
22:04:51.169 java.vendor Oracle Corporation
22:04:51.169 java.home /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/jre
@brycepg
brycepg / ip.sh
Last active July 10, 2021 01:26
Get IP Address from hostname bash function
# Get IP address from hostname using Python
# Args:
# $1 - hostname
# Returns:
# The ip address
ipfromhostname() {
local hostname="$1"
if [ -z "$hostname" ]; then
>&2 echo 'Must supply hostname as an argument'
return 1
@brycepg
brycepg / centos7-sphinx-latex.sh
Last active December 1, 2022 09:28
Install Sphinx latexpdf Dependencies for Centos 7
#!/bin/bash
# source: https://cbs.centos.org/koji/rpminfo?rpmID=45050
set -xeuo pipefail
sudo yum install -y "tex(cmap.sty)" "tex(ecrm1000.tfm)" "tex(fancybox.sty)" "tex(footnote.sty)" "tex(framed.sty)" "tex(multirow.sty)" "tex(parskip.sty)" "tex(threeparttable.sty)" "tex(titlesec.sty)" "tex(upquote.sty)" "tex(wrapfig.sty)" "texlive-collection-fontsrecommended" "texlive-collection-latex" "tex(fncychap.sty)" python-sphinx > /dev/null
# Determine latex search directory
SEARCH_DIRECTORY="$(kpsewhich -var-value=TEXMFHOME)/tex/latex/local"
mkdir -p "$SEARCH_DIRECTORY"
# capt-of.sty has no Centos 7 package