Skip to content

Instantly share code, notes, and snippets.

View englishm's full-sized avatar
🦀
Media over QUIC enthusiast, Rustacean

Mike English englishm

🦀
Media over QUIC enthusiast, Rustacean
View GitHub Profile
@JosephPecoraro
JosephPecoraro / shell-execution.rb
Last active September 10, 2023 10:12
Shell Execution in Ruby
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Synchronous (blocking)
# Returns the output of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@lsegal
lsegal / yumler.rb
Created December 1, 2009 03:06
Auto generate ER diagrams using yUML
require 'yard'
require 'active_support'
require 'set'
class ModelHandler < YARD::Handlers::Ruby::Base
handles :class
def process
return unless statement[1]
sclass = statement[1].source
@snb
snb / virtualbox_ports.png
Created January 24, 2010 01:46
virtualbox serial console
virtualbox_ports.png
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

def ears
yield self
end
@jtimberman
jtimberman / gist:639638
Created October 21, 2010 23:56 — forked from btm/gist:639581
different ways to get interface IPs
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses]
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses]
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ?
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ?
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file.
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0]
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo
20:29 < kallistec> pp node[:network][:interfaces].current_attribute
@devrandom
devrandom / 00README.md
Last active December 27, 2022 15:49
Building bitcoin with gitian-builder

This is obsolete, since Bitcoin Core has moved to a more modern build system.

@cdata
cdata / xcodeinstaller.sh
Created February 9, 2011 01:02
Snippet for unattended installation of XCode
#!/bin/bash
# This snippet should hypothetically allow a totally unattended
# installation of Apple's XCode. After prompting for credentials,
# the script simulates a login, begins a download and subsequently
# mounts the disk image and installs XCode to the default location.
echo -n "ADC login: "
read login
echo -n "ADC password: "
#
# Cookbook Name:: yumrepo
# Definition:: yumrepo
#
# Copyright 2010, Tippr Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@denisbr
denisbr / Vagrantfile
Created May 12, 2011 11:29
Puppetmaster / Client vagrantfile
Vagrant::Config.run do |config|
config.vm.define :puppetserver do |puppetserver_config|
puppetserver_config.vm.box = "lucid64_local"
puppetserver_config.vm.host_name = "puppetmaster"
puppetserver_config.vm.forward_port("ssh", 22, 2222, :auto => true)
#puppetserver_config.vm.forward_port("http", 80, 8080)
puppetserver_config.vm.network "192.168.10.10"
# puppetserver_config.vm.boot_mode = :gui
puppetserver_config.vm.provision :shell, :path => "shellprovision/prepuppet.sh"
puppetserver_config.vm.provision :puppet do |puppet|