Skip to content

Instantly share code, notes, and snippets.

View wwalker's full-sized avatar

Wayne Walker wwalker

View GitHub Profile
@wwalker
wwalker / .gitattributes
Created October 11, 2019 16:31 — forked from marceloalmeida/.gitattributes
How to show diffs for gpg-encrypted files?
*.gpg filter=gpg diff=gpg
*.asc filter=gpg diff=gpg
include:
- git
{% if grains.get('os') == 'Ubuntu' %}
{% set grafana_version = salt['pillar.get']('grafana:version', '5.4.2') %}
grafana_dependencies:
pkg.installed:
- pkgs:
- apt-transport-https
@wwalker
wwalker / xmarks2git.py
Created February 2, 2018 00:52 — forked from eugeneius/xmarks2git.py
Downloads every revision of your Xmarks bookmarks and saves them in a git repository.
#!/usr/bin/env python
import argparse
import getpass
import json
import re
import requests
import subprocess
parser = argparse.ArgumentParser()
@wwalker
wwalker / code
Created January 22, 2018 21:47
irb broken
def lcd(a,b)
total = 0
if b.include?(a)
b_c = b.chars.uniq
for a_i in 0...(a.length) do
b_c.each do |e|
t_a = a
total += 1 if b.include?(t_a.insert(a_i, e))
end
end
@wwalker
wwalker / The Technical Interview Cheat Sheet.md
Created September 17, 2017 19:01 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
==> cberl (compile)
Compiling c_src/callbacks.c
c_src/callbacks.c:3:10: fatal error: 'libcouchbase/couchbase.h' file not found
#include <libcouchbase/couchbase.h>
^
1 error generated.
ERROR: compile failed while processing /Users/projects/foo/deps/cberl: rebar_abort
$ locate couchbase.h
/usr/local/Cellar/libcouchbase/2.5.0/include/libcouchbase/couchbase.h
#!/bin/bash
# version 0.0.1
LOCALHISTFILE=/tmp/$USER.history.$$;
read -d '' RUN << EOF
export HISTFILE=$LOCALHISTFILE;
export HISTTIMEFORMAT='%F %T - '
bash -i;
awk '{print \"HIST \"\$0}' \$HISTFILE;
EOF
#!/bin/bash
# version 0.0.1
read -d '' RUN << EOF
export HISTFILE=/tmp/\$USER.history.\$\$;
bash -i;
awk '{print \"HIST \"\$0}' \$HISTFILE;
EOF
ssh -t $1 "$RUN" | tee /tmp/$USER-remote-history
@wwalker
wwalker / missing-file
Created August 3, 2016 19:18
dpkg fails to install what it says it installs
root@ubu-01:~# dpkg -i /srv/salt/states/heka/files/heka_0.10.0_amd64.deb
(Reading database ... 39465 files and directories currently installed.)
Preparing to unpack .../files/heka_0.10.0_amd64.deb ...
Unpacking heka (0.10.0) over (0.10.0) ...
Setting up heka (0.10.0) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
root@ubu-01:~# ls -ld /etc/init.d
drwxr-xr-x 2 root root 4096 Aug 3 19:14 /etc/init.d
root@ubu-01:~# ls -l /etc/init.d/heka
[hekad]
maxprocs = 8
[TcpInput]
splitter = "HekaFramingSplitter"
decoder = "ProtobufDecoder"
address = ":5565"
# [StatAccumInput]