Skip to content

Instantly share code, notes, and snippets.

View kisoku's full-sized avatar

Mathieu Sauve-Frankel kisoku

View GitHub Profile
@b0o
b0o / update
Last active February 7, 2024 07:19
Arch Linux update script which checks for Arch news, then updates the system via Yay or Pacman, plus support for updating user-space utilities such as NPM, Yarn, RubyGems, Cargo, and more.
#!/bin/bash
#
# Copyright (c) 2018 Maddison Hellstrom (github.com/b0o)
# Released under the MIT License
#
# Arch Linux update script which checks for Arch news, then updates the system
# via Yay or Pacman, with seamless support for updating user-space utilities
# such as NPM, Yarn, RubyGems, Cargo, and more. Plus it has pretty colors :)
#
# Screencast:
#!/usr/bin/env ruby
#
# Wrap thor-scmver to build metadata
#
require 'thor-scmversion'
module ThorSCMVersion
class Tasks < Thor
namespace "version"
@jtimberman
jtimberman / tk-jamie.rb
Created January 28, 2013 06:57
Simple converter for Kitchenfile -> .jamie.yml. See comments. May open a rift in the space-time continuum.
#!/usr/bin/env ruby
#
# Converts a test-kitchen Kitchenfile to a jamie-ci .jamie.yml. Writes
# out the .jamie.yml file. Once Test Kitchen 1.0 is ready, this file
# will be renamed to .kitchen.yml.
#
# Must be run from a cookbook directory that has been setup with Test
# Kitchen (./test/kitchen/Kitchenfile exists).
#
# Bugs:
class Chef
class SubResourceCollection < ResourceCollection
def initialize(parent)
@parent = parent
super()
end
def lookup(resource)
super
rescue Chef::Exceptions::ResourceNotFound
@jbgo
jbgo / debug_system_stack_error.md
Created January 9, 2013 15:08
debug SystemStackError in ruby 1.9

This is how I debug SystemStackError when there is no stack trace.

My first attempt was:

begin
  a_method_that_causes_infinite_recursion_in_a_not_obvious_way
rescue SystemStackError
  puts caller
end
class BackTicks
def run
`pwd`
end
end
describe BackTicks do
subject { BackTicks.new }
it "should execute run" do
@kreeger
kreeger / mw2md.rb
Created March 5, 2012 22:43
Ruby: Convert MediaWiki to Markdown
#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
require 'maruku'
require 'wikicloth'
require 'tidy_ffi'
require 'pandoc-ruby'
opts = {}
OptionParser.new do |o|
@AnsonT
AnsonT / gist:1115264
Created July 30, 2011 06:32
CoffeeScript debugging with node-inspector
node-inspector &
coffee --nodejs --debug app.coffee &
google-chrome http://127.0.0.1:8080/debug?port=5858 &
google-chrome http://127.0.0.1:3000 &
Dec 9 14:27:03 acc-db-01 [248740.420900] divide error: 0000 [#1] SMP
Dec 9 14:27:03 acc-db-01 [248740.428791] last sysfs file: /sys/devices/system/cpu/cpu15/cache/index2/shared_cpu_map
Dec 9 14:27:03 acc-db-01 [248740.444194] CPU 6
Dec 9 14:27:03 acc-db-01 [248740.450660] Modules linked in: btrfs zlib_deflate crc32c libcrc32c ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs reiserfs xfs exportfs nfs lockd nfs_acl auth_rpcgss sunrpc ipmi_devintf ipmi_si ipmi_msghandler autofs4 bonding fbcon tileblit font bitblit softcursor vga16fb vgastate bnx2 psmouse dell_wmi serio_raw joydev power_meter dcdbas lp parport ses enclosure usbhid hid megaraid_sas
Dec 9 14:27:03 acc-db-01 [248740.516499] Pid: 17864, comm: dsm_sa_snmp32d Not tainted 2.6.32-22-generic #33-Ubuntu PowerEdge R710
Dec 9 14:27:03 acc-db-01 [248740.538698] RIP: 0010:[<ffffffff8105621c>] [<ffffffff8105621c>] find_busiest_group+0x63c/0x900
Dec 9 14:27:03 acc-db-01 [248740.561223] RSP: 0018:ffff880604711b88 EFLAGS: 00010046
Dec 9 14:27:03 acc-