Skip to content

Instantly share code, notes, and snippets.

Ron Dahlgren influenza

Block or report user

Report or block influenza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@influenza
influenza / util.asm
Created Sep 21, 2017
Snippet from assembly project I'm working on
View util.asm
print_uint: ; Prints the unsigned 8 byte integer in rdi to stdout
mov rax, rdi ; Copy in provided value to the accumulator
mov r8, 10 ; Base to convert to for display - base 10
mov rcx, uint64_digits ; The 64-bit uint can require up to this many digits
.each_char_loop: ; print each character possible in an 8-byte unsigned integer
mov r9, 1 ; Calculate divisor, store in r9
push rcx
.calculate_divisor_loop:
@influenza
influenza / make-music-video.sh
Last active Dec 21, 2016
Share that music with the world!
View make-music-video.sh
#!/bin/sh
IMAGE=$1
AUDIO=$2
OUTPUT=${3:-"output.mkv"}
if [ $# -gt 3 -o $# -lt 2 ]; then
echo "Create a still-image music video"
echo "Usage: "
echo "$0 IMAGE_FILE AUDIO_FILE [OUTPUT_FILE]"
exit 1
@influenza
influenza / gist:e28ffc405f6a53f3689d5ce7c70bca91
Created Jul 12, 2016
ipython session demonstrating parameter evaluation
View gist:e28ffc405f6a53f3689d5ce7c70bca91
In [24]: logging.getLogger().isEnabledFor(logging.DEBUG)
Out[24]: False
In [25]: def str_with_side_effect(obj):
....: print('Hey, a side effect!')
....: return str(obj)
....:
In [26]: logging.debug('Message: %s', str_with_side_effect(42))
Hey, a side effect!
@influenza
influenza / rc.lua
Created Feb 1, 2016
Spawning on a particular screen with a particular tag
View rc.lua
-- Class is the second value of WM_CLASS (use `xprop WM_CLASS` to determine this value)
function spawn_it(cmd, class, screen, tag)
local sig_handler
sig_handler = function (c)
if c.class == class then
awful.client.movetoscreen(c, screen)
awful.client.movetotag(tag, c)
client.disconnect_signal("manage", sig_handler)
end
end
@influenza
influenza / Makefile
Created Mar 6, 2015
Simple backup strategy
View Makefile
all: transmit
clean:
-rm docs.tar.gz
-rm docs.tar.gz.enc
transmit: encrypted
scp docs.tar.gz.enc YOURHOSTHERE:backups/docs-`date +%d%b%Y-%H%M`.tar.gz.enc
encrypted: docs.tar.gz.enc
@influenza
influenza / Dockerfile
Last active Aug 29, 2015
Updated Petclinic Dockerfile
View Dockerfile
FROM rouge8/precise-openjdk-7-jdk
# Update the cache and our installed packages
RUN apt-get update && apt-get upgrade -y
# Install application requirements
RUN apt-get install -y git
# Retrieve the code
RUN mkdir /opt/petclinic
RUN git clone https://github.com/grails-samples/grails-petclinic.git /opt/petclinic/app
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64/
@influenza
influenza / Dockerfile
Last active Aug 29, 2015
Forked Petclinic Dockerfile
View Dockerfile
FROM rouge8/precise-openjdk-7-jdk
# Update the cache and our installed packages
RUN apt-get update && apt-get upgrade -y
# Install application requirements
RUN apt-get install -y git
# Retrieve the code
RUN mkdir /opt/petclinic
RUN git clone https://github.com/grails-samples/grails-petclinic.git /opt/petclinic/app
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64/
@influenza
influenza / Dockerfile
Created May 18, 2014
Dockerfile for Postgres
View Dockerfile
#
# Postgres Database Dockerfile for use by the forked petclinic application
# available here - https://github.com/influenza/grails-petclinic
FROM nornagon/postgres
# Create the grails user and petclinic database
RUN /etc/init.d/postgresql start; \
psql --command "CREATE USER grails WITH SUPERUSER PASSWORD 'super secure';";\
createdb --owner=grails petclinic "Pet clinic data storage"
@influenza
influenza / playbook.yml
Created May 18, 2014
Petclinic Forked Playbook
View playbook.yml
---
- hosts: vagrant
sudo: yes
handlers:
- name: restart pg
service: name=postgresql state=restarted
sudo: yes
tasks:
- name: update apt cache
apt: update_cache=yes cache_valid_time=3600
@influenza
influenza / Dockerfile
Last active Aug 29, 2015
Dockerfile for Grails Pet Clinic sample
View Dockerfile
# Start from an OpenJDK 7 image
FROM rouge8/precise-openjdk-7-jdk
# Update the cache and our installed packages
RUN apt-get update && apt-get upgrade -y
# Install git
RUN apt-get install -y git
# Retrieve the code from github
RUN mkdir /opt/petclinic
RUN git clone https://github.com/grails-samples/grails-petclinic.git /opt/petclinic/app
# Set the java home environment var (required for grails to run)
You can’t perform that action at this time.