Skip to content

Instantly share code, notes, and snippets.

View abrkn's full-sized avatar

Andreas Brekken abrkn

View GitHub Profile
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active February 29, 2024 16:29
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@bmhatfield
bmhatfield / .profile
Last active March 18, 2024 07:43
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@Avaq
Avaq / combinators.js
Last active March 18, 2024 20:49
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@ostinelli
ostinelli / logentries_manual_setup.md
Last active August 11, 2022 21:37
How to use a single Logentries account on Heroku.

If you have multiple applications on Heroku and would like to use a single Logentries account for all of them, this is how you do it. Basically, do not use add-ons, and send all drains to your account.

  • In your Logentries account, click on Add Log
  • Select Manual
  • In the form that appears, input the following:
    • Log Name: access.log
    • Select Set: new set named myapp-{environment}, for instance myapp-staging (at least, this is how I like to name my entries)
    • Select the Plain TCP, UDP - logs are sent via syslog option
  • Click on Create Log Token
@tlrobinson
tlrobinson / redux-devtools-separate-window.js
Last active August 20, 2019 23:54
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
// give it a name so it reuses the same window
var win = window.open(null, "redux-devtools", "menubar=no,location=no,resizable=yes,scrollbars=no,status=no");
// reload in case it's reusing the same window with the old content
win.location.reload();
// wait a little bit for it to reload, then render
setTimeout(function() {
React.render(
<DebugPanel top right bottom left >
@weavenet
weavenet / delete_all_object_versions.sh
Created May 4, 2015 05:21
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`
/**
* FOR COPAY WALLET
* Converts multisig xpubs into addresses
*
* Dependencies:
* npm install bitcore
*
* NOTE: You can retrieve xpubs from copay using JSON backup
* Decrypt json backup using sjcl @ https://github.com/bitwiseshiftleft/sjcl
*/
@simenbrekken
simenbrekken / CategoryStore.js
Last active August 29, 2015 14:19
Relay-style higher-order React components backed by Reflux
var Reflux = require('reflux')
var axios = require('axios')
var CategoryStore = Reflux.createStore({
init: function() {
this.items = null
},
list: function() {
var items = this.items
@zelig
zelig / gist:adcbb8cd4e9c8259327c
Last active August 29, 2015 14:18
local ethereum cluster
# !/bin/bash
# bash cluster <cluster_root> <number_of_clusters> <network_id> <runid> <local_IP> [[params]...]
# sets up a local ethereum network cluster of nodes
# - <n> is the number of clusters
# - <root> is the root directory for the cluster, the nodes are set up
# with datadir `<root>/00`, `<root>/01`, ...
# - new accounts are created for each node
# - they launch on port 30300, 30301, ...
# - they star rpc on port 8100, 8101, ...
@jbergstroem
jbergstroem / iojs-1.0.4.ebuild
Last active August 29, 2015 14:14
io.js ebuild
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_COMPAT=( python2_{6,7} )
MY_PV="v${PV}"
MY_P="${PN}-${MY_PV}"