Skip to content

Instantly share code, notes, and snippets.

@firstrow
firstrow / sign.md
Created Oct 4, 2019
MacOS Mojave GDB cosign
View sign.md
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.security.cs.allow-jit</key>
    <true/>
    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
    <true/>
@firstrow
firstrow / arch-linux-install
Created Jan 28, 2019 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
View install protoc compiler
mkdir /tmp/protoc && cd "$_"
wget https://github.com/google/protobuf/releases/download/v3.5.1/protoc-3.5.1-linux-x86_64.zip
unzip protoc-3.5.1-linux-x86_64.zip
sudo cp bin/protoc /usr/local/bin/protoc
View keybase.md

Keybase proof

I hereby claim:

  • I am firstrow on github.
  • I am firstrow (https://keybase.io/firstrow) on keybase.
  • I have a public key ASCO_4vb5x_A7wd5exCo8Po2ajjKWEvMnqVNG3Me_22Ilgo

To claim this, I am signing this object:

@firstrow
firstrow / gist:392bce9ea8c00d3634479f5798ed958b
Last active Jun 10, 2017 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest
View gist:392bce9ea8c00d3634479f5798ed958b

On Mac OS (host):

Shutdown your VM and do:

VirtualBox > Settings > Network > Add (you will get vboxnet0)

On a terminal ifconfig will show you new interface vboxnet0

VM's Settings > System > check "Enable I/O APIC." VM's Settings > Network > Adapter 1 > Bridged Adapter

@firstrow
firstrow / rabbitmq_reconnect.go
Created Apr 24, 2017 — forked from svcavallar/rabbitmq_reconnect.go
Golang example to reconnect to RabbitMQ on a connection closed event
View rabbitmq_reconnect.go
package main
import (
"flag"
"github.com/streadway/amqp"
"log"
"time"
)
var amqpUri = flag.String("r", "amqp://guest:guest@127.0.0.1/", "RabbitMQ URI")
@firstrow
firstrow / sql_logger.rb
Created Jan 5, 2017
Log active record SQL call line
View sql_logger.rb
module LogQuerySource
def debug(*args, &block)
return unless super
backtrace = Rails.backtrace_cleaner.clean caller
# logger.debug(backtrace)
relevant_caller_line = backtrace.detect do |caller_line|
!caller_line.include?('/initializers/')
end
@firstrow
firstrow / count.rb
Created Dec 16, 2016
active record count queries
View count.rb
def count_queries(&block)
p "--------- Start Count SQL -----------"
count = 0
counter_f = ->(name, started, finished, unique_id, payload) {
unless payload[:name].in? %w[ CACHE SCHEMA ]
count += 1
end
}
ActiveSupport::Notifications.subscribed(counter_f, "sql.active_record", &block)
count
@firstrow
firstrow / .vimperatorrc.local.vim
Created Sep 27, 2016 — forked from igal/.vimperatorrc.local.vim
My Vimperator configuration
View .vimperatorrc.local.vim
"===[ Settings ]========================================================
" Autocomplete using Firefox Awesomebar subsystem
set complete=l
" Show completions as you type? '' waits for tab, 'auto' shows them immediately
set wildoptions=''
" Select the longest autocomplete match
set wildmode='list:full'
View macos -> linux
http://loicpefferkorn.net/2015/01/arch-linux-on-macbook-pro-retina-2014-with-dm-crypt-lvm-and-suspend-to-disk/
http://codylittlewood.com/setting-up-an-external-monitor-on-macbook-pro-running-arch-linux-and-awesomewm/
http://vincent.jousse.org/en/tech/archlinux-retina-hidpi-macbookpro-xmonad/
http://snakeccnote.blogspot.com/2016/02/hidpi-arch-linux-macbook-pro-awesome-wm.html
http://pedronveloso.com/running-arch-linux-on-macbook-13-2015/
https://mchladek.me/post/arch-mbp/
https://vec.io/posts/use-arch-linux-and-xmonad-on-macbook-pro-with-retina-display