Skip to content

Instantly share code, notes, and snippets.

View benhoskings's full-sized avatar

Ben Hoskings benhoskings

View GitHub Profile

https://www.reddit.com/r/zfs/comments/1nkty6f/vestigial_pool_with_real_pools_device_as_a_member/

I've solved this and thought I'd leave my working here in case it's of use to anyone. It was with the help of ChatGPT which helped me with a crucial realisation. (That in itself was a learning experience - it appeared to show real understanding of zfs.)

As it turned out both disks had stale zfs labels on them from previous experiments I'd done, using the whole disk as the device. The reason they were left around is that the active pool is on the the first (and only) partition, which is aligned differently.

  • The partition starts at sector 2048 (1MB into the device) - as is standard.
  • It ends at the 12TB boundary, ~130MB before the end of these particular devices (WD Red). I sized it that way so that other 12TB disks would be attachable to the vdev in the future even if their exact size varied slightly.

Here's the partition layout:

@benhoskings
benhoskings / gist:3f9062dc20961291a230
Created October 6, 2014 07:59
英語の練習のオススメ
いい練習の番組:
Seinfeld (アメリカ、コメディー) 話が本当にアメリカの形。ユーモアが最高。一番有名なので英語が話せる人とたしかにしゃべれる。
Frasier (アメリカ、コメディー) 一杯あるし、Kelsey GrammerとDavid Hyde Pierceの英語がうまい。
The Office (UKとUSの番組だって、両方ある。とてもいいイギリスとアメリカの比べる事。)
Sherlock (イギリス、) 話がとても速いけど、いいイギリスの英語だと思う。
その他:(これは、僕がちょっとだけ見ましたけど、いい練習だと思う。)
Futurama
House
def self.cumulative_by_month model, column
tally = 0
count_by_month(model, column).map do |(month, count)|
[month, tally += count]
end
end
def self.cumulative_by_month_inject model, column
count_by_month(model, column).tap {|pairs|
pairs.inject(0) do |tally,pair|

For the package management you're talking about, it sounds like there are two cases:

  • Accept any version (1)
  • Require a specific version (2)
  • Require the latest version (3)

Babushka can already do (1) and (2). The third is fairly easy to add, but to do so in babushka core isn't really feasible until I refactor Babushka::BrewHelper.

For (1), you don't need to do anything: that's the standard behaviour. For example:

@benhoskings
benhoskings / gist:8344953
Created January 10, 2014 00:46
Ben's guide to painless ruby switching with chruby
1) Latest brews.
$ brew update
2) Install packages.
$ brew install chruby ruby-install selecta
3) Load chruby when the shell inits.
echo >> ~/.zshrc
if [ -d /usr/local/opt/chruby ]; then
. /usr/local/opt/chruby/share/chruby/chruby.sh
class String
def normalize
mb_chars.normalize(:kd).gsub(/[^\x00-\x7f]/n, '').to_s
end
def normalize_for_display
mb_chars.normalize(:kd).
gsub('æ', 'ae').
gsub('ð', 'd').
gsub(/[^\x00-\x7f]/n, '').to_s
@benhoskings
benhoskings / gist:7192000
Created October 28, 2013 05:59
sublime config.py
{
"auto_complete_commit_on_tab": true,
"auto_complete_delay": 30,
"bold_folder_labels": true,
"caret_style": "wide",
"color_scheme": "Packages/User/Ben's Solarized (light).tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"drag_text": false,
SELECT DISTINCT comments.id, comments.content_id, comments.created_at -- whatever fields you like
FROM comments
INNER JOIN (
SELECT comments.id, first_value(comments.id)
OVER (PARTITION BY content_id ORDER BY created_at DESC) comment_id
FROM comments
) chosen
ON chosen.comment_id = comments.id
> cabal install --only-dependencies && cabal build
Resolving dependencies...
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
setup: Run the 'configure' command first.
1 > ./dist/setup/setup configure
Configuring Presenter-1.0...
setup: At least the following dependencies are missing:
FindBin >=0.0.5,
class BabushkaProvisioner < Vagrant::Provisioners::Base
class Config < Vagrant::Config::Base
attr_accessor :args
attr_accessor :deps
def initialize
@deps = []
end
def dep(dep_spec, args = {})