Skip to content

Instantly share code, notes, and snippets.

View razum2um's full-sized avatar

Vlad Bokov razum2um

View GitHub Profile
@razum2um
razum2um / zfs-veracrypt-failed-usb-cable.txt
Created May 10, 2023 16:51 — forked from mailinglists35/zfs-veracrypt-failed-usb-cable.txt
recover veracrypt zfs pool after failed usb cable, without reboot
dmsetup table | grep veracrypt
veracrypt2: 0 3904923136 crypt aes-xts-plain64 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 256 8:34 256
dmsetup reload veracrypt2 --table "0 3904923136 error"
dmsetup suspend --noflush veracrypt2
dmsetup resume veracrypt2
(?)zpool clear backup-usb
remove from veracrypt UI
echo "0 3904923136 zero" | dmsetup reload veracrypt2
dmsetup suspend --noflush veracrypt2
dmsetup resume veracrypt2
@razum2um
razum2um / broadcom-wl-fix-linux-5.10.patch
Created January 25, 2021 23:15 — forked from joanbm/broadcom-wl-fix-linux-5.10.patch
Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 5.10-rc1
From f3d652840f8dd959395065a1cf67ca40b04ec69b Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Tue, 13 Oct 2020 19:35:55 +0200
Subject: [PATCH] Get rid of get_fs/set_fs calls in Broadcom WL driver.
Tentative patch for broadcom-wl 6.30.223.271 driver for Linux 5.10 (tested -rc1 up to 5.10.1)
Applies on top of all the patches applied to broadcom-wl-dkms 6.30.223.271-23 on Arch Linux.
NB: Some checks in wlc_ioctl_internal are likely superfluous,
@razum2um
razum2um / MyResponsiveComponent.js
Created February 20, 2019 10:44 — forked from gaearon/MyResponsiveComponent.js
Examples from "Making Sense of React Hooks"
function MyResponsiveComponent() {
const width = useWindowWidth(); // Our custom Hook
return (
<p>Window width is {width}</p>
);
}

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

# Rails 3.2 support for HTTP PATCH.
if Rails::VERSION::MAJOR < 4
# see http://weblog.rubyonrails.org/2012/2/26/edge-rails-patch-is-the-new-primary-http-method-for-updates/
# https://github.com/rails/rails/pull/505
ActionDispatch::Routing::Mapper::HttpHelpers.module_eval do
# Define a route that only recognizes HTTP PATCH.
# For supported arguments, see <tt>Base#match</tt>.
#
# Example:
>> IF = -> b { b }
=> #<Proc:0x007fb4e4049cc8 (lambda)>
>> LEFT = -> p { p[-> x { -> y { x } } ] }
=> #<Proc:0x007fb4e403d680 (lambda)>
>> RIGHT = -> p { p[-> x { -> y { y } } ] }
=> #<Proc:0x007fb4e4028ff0 (lambda)>
>> IS_EMPTY = LEFT
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
(function (global) {
"use strict";
var $ = global.jQuery,
module = YOUR_NAMESPACE.namespace('other.module');
(function () {
function hidden_function() {
@razum2um
razum2um / 0-readme.md
Created June 7, 2012 05:05 — forked from olgen/0-readme.md
ruby-1.9.3-p0 cumulative performance + gcdata + debug patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84) as well as the gcdata-patch.

Huge thanks to funny-falcon for the performance patches.