Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Schlegel samschlegel

View GitHub Profile
@samschlegel
samschlegel / lvm_on_luks_chroot.sh
Last active Jul 19, 2018
chrooting on LVM-on-LUKS
View lvm_on_luks_chroot.sh
#!/usr/bin/env bash
# Enter chroot
cryptsetup luksOpen /dev/nvme0n1p5 system
mkdir -p /mnt/root
mount /dev/mapper/system-root /mnt/root
mount /dev/mapper/system-boot /mnt/root/boot
mount /dev/mapper/system-home /mnt/root/home
mount /dev/nvme0n1p2 /mnt/root/boot/efi
mount --bind /dev /mnt/root/dev
View SlowFanOutThenCombine.scala
import com.spotify.scio._
import org.slf4j.Logger
import org.slf4j.LoggerFactory
object SlowFanOutThenCombine {
val LOG: Logger = LoggerFactory.getLogger(this.getClass)
def slowFanOut(n: Int): Iterator[(Int, (Int, Int))] = new Iterator[(Int, (Int, Int))] {
var i: Int = 0
@samschlegel
samschlegel / 01-noto.conf
Last active May 3, 2017
Fontconfig for Noto Color Emoji fallback
View 01-noto.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Emoji -->
<match target="scan">
<test name="family">
<string>Noto Color Emoji</string>
</test>
<edit name="scalable" mode="assign"><bool>true</bool></edit>
<edit name="embeddedbitmap" mode="assign"><bool>true</bool></edit>
View JMapWrapper.scala
package com.spotify.scio.util
import java.lang.{Iterable => JIterable}
import java.util.{Map => JMap}
import scala.collection.JavaConverters._
private[scio] object JMapWrapper {
def of[A, B](j: JMap[A, JIterable[B]]): Map[A, Iterable[B]] = {
new Map[A, Iterable[B]] {
// scalastyle:off method.name
View JImmutableMapWrapper.scala
class JImmutableMapWrapper[K, V](val self: JMap[K, V])
extends Map[K, V] {
// scalastyle:off method.name
override def +[B1 >: V](kv: (K, B1)): Map[K, B1] = self.asScala.toMap + kv
override def -(key: K): Map[K, V] = self.asScala.toMap - key
// scalastyle:on method.name
override def get(key: K): Option[V] = Option(self.get(key))
override def iterator: Iterator[(K, V)] = self.asScala.iterator
View keybase.md

Keybase proof

I hereby claim:

  • I am SamSchlegel on github.
  • I am schlegel (https://keybase.io/schlegel) on keybase.
  • I have a public key whose fingerprint is D682 44DE 8F69 8EDF 4727 152B 4CC0 B7E6 112E DEE5

To claim this, I am signing this object:

View edelib-PKGBUILD
pkgname=edelib
pkgver=2.1
pkgrel=1
pkgdesc="Component construction library for Equinox Desktop Environment"
arch=('i686' 'x86_64')
url="http://equinox-project.org/"
_watch="http://equinox-project.org/wiki/Download"
license=('LGPL')
depends=('fltk' 'python' 'libdbus')
makedepends=('ftjam')
View keybase.md

Keybase proof

I hereby claim:

  • I am samschlegel on github.
  • I am schlegel (https://keybase.io/schlegel) on keybase.
  • I have a public key whose fingerprint is 8E41 6F28 D858 517F 1FFB A037 DE14 4399 5FA0 C571

To claim this, I am signing this object: