Skip to content

Instantly share code, notes, and snippets.

@pgrm
pgrm / .zshrc
Last active February 11, 2019 11:00
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#!/bin/bash
# run sudo apt update or similar and feed the password for the rest to run smooth
# this is for the old bash based on ubuntu 14.04
sudo apt update && sudo apt dist-upgrade -y
# Instlall NodeJS, Yarn and npm related dependencies
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@pgrm
pgrm / strace.out
Created July 24, 2016 16:49
strace of ansible-playbook test.yaml
execve("/usr/bin/ansible-playbook", ["ansible-playbook", "test.yaml"], [/* 16 vars */]) = 0
brk(0) = 0x12cf000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd3291f0000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=24176, ...}) = 0
mmap(NULL, 24176, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fd3291f9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)

Keybase proof

I hereby claim:

  • I am pgrm on github.
  • I am pgrm (https://keybase.io/pgrm) on keybase.
  • I have a public key whose fingerprint is 8AC2 C7F7 9261 02B0 F02B 5C7C 6BA0 2D65 7EA8 466C

To claim this, I am signing this object:

@pgrm
pgrm / Vagrantfile
Created February 15, 2016 22:42
Vagrantfile for a simple VM running Elasticsearch in a docker container
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.provider "parallels"
config.vm.provider "virtualbox"
@pgrm
pgrm / leaflet-draw.d.ts
Last active July 11, 2018 15:21
You can read about the process, and how to create your own definition file on http://peter.grman.at/how-to-write-typescript-definition-files/
/// <reference path="../leaflet/leaflet.d.ts" />
declare module L {
export interface MapOptions {
drawControl?: boolean;
}
export interface ControlStatic {
Draw: Control.DrawStatic;
}
2014-06-21 10:24:03,729 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl: Stopping resource-monitoring for container_1403345039835_0001_01_000009
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.ContainerManagerImpl: Start request for container_1403345039835_0001_01_000010 by user ubuntu
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.NMAuditLogger: USER=ubuntu IP=10.216.60.23 OPERATION=Start Container Request TARGET=ContainerManageImpl RESULT=SUCCESS APPID=application_1403345039835_0001 CONTAINERID=container_1403345039835_0001_01_000010
2014-06-21 10:24:04,961 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.application.Application: Adding container_1403345039835_0001_01_000010 to application application_1403345039835_0001
2014-06-21 10:24:04,966 INFO org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container: Container container_1403345039835_0001
package org.apache.drill.exec.test.generated;
import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.expr.holders.BitHolder;
import org.apache.drill.exec.expr.holders.VarCharHolder;
import org.apache.drill.exec.ops.FragmentContext;
import org.apache.drill.exec.record.RecordBatch;
import org.apache.drill.exec.vector.RepeatedVarCharVector;
import org.apache.drill.exec.vector.VarCharVector;
import org.apache.drill.exec.vector.complex.impl.RepeatedVarCharReaderImpl;
2014-06-09T18:30:40,093Z ERROR o.a.d.e.p.i.p.ProjectRecordBatch [zk1] [37daf04b-7d82-4d2f-987c-59851f2aeafe:frag:0:0] AbstractSingleRecordBatch:next(AbstractSingleRecordBatch.java:60) - Failure during query
org.apache.drill.exec.exception.SchemaChangeException: Failure while attempting to load generated class
at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.setupNewSchema(ProjectRecordBatch.java:243)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:57)
at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.next(ProjectRecordBatch.java:83)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:45)
at org.apache.drill.exec.physical.impl.limit.LimitRecordBatch.next(LimitRecordBatch.java:99)
at org.apache.drill.exec.record.AbstractSingleRecordBatch.next(AbstractSingleRecordBatch.java:45)
at org.apache.drill.exec.physical.impl.svremover.RemovingRecordBatch.next(RemovingRecordBatch.java:94)
at org
@pgrm
pgrm / set_random_mac_address.sh
Created May 23, 2014 07:25
I'm having troubles with my internet connection and need to connect to my router with a different mac address every time. This script creates a random mac address and tries to set it, when the two mac-addresses displayed by this script are the same, it was set successfully.
macAddress=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`
sudo ifconfig en0 ether $macAddress
echo "new mac address:"
echo $macAddress
sudo ifconfig en0 ether