Skip to content

Instantly share code, notes, and snippets.

View gautamk's full-sized avatar

Gautam gautamk

  • Block | Meta | Appdynamics | Cisco | Amazon | University of Washington
  • Seattle
View GitHub Profile
@shawwn
shawwn / since2010.md
Created May 11, 2021 09:46
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?

@stecman
stecman / _readme.md
Last active October 6, 2024 17:31
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@mjul
mjul / aws_env
Created July 8, 2016 13:32
Get environment variables from AWS profile (for use with docker-machine)
#!/bin/sh
# Set the AWS environment variables for an AWS profile
# Useful for docker-machine
#
# Example:
#
# aws_env profile-for-testing
#
# Further information:
# See the AWS CLI `aws configure`
@nicwolff
nicwolff / .bashrc
Created February 9, 2016 22:29
Pass password and command to PSSH sudo
( echo "PASSWORD" ; echo "COMMAND" ) | pssh -t 1 -h ~/host_list -P -I "sudo -S su -"
@vasanthk
vasanthk / System Design.md
Last active November 28, 2024 08:54
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@domenic
domenic / 0-github-actions.md
Last active May 26, 2024 07:43
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@john2x
john2x / 00_destructuring.md
Last active August 23, 2024 07:45
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@djangofan
djangofan / gist:2939268
Created June 15, 2012 23:56
Groovy script to watch a directory for changes in JDK1.7
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.*;
// requires JDK 1.7.0+
Path tmpPath = Paths.get( args[0])
WatchService watchService = FileSystems.getDefault().newWatchService()
@gautamk
gautamk / eclipse
Created April 27, 2012 12:08
Various Command and Scripts to remember
#!/bin/bash
/path/to/eclipse &
P=`which eclipse`
disown `pidof ${P}`
@paul-matthews
paul-matthews / sumodule-slides.md
Created March 8, 2012 10:31
Git Submodule Slides - From PHPUK 2012

% Git Submodules - The Good + The Bad % Paul Matthews % March 2012

This talk

  • Submodules
  • Essentials
  • Using submodules
  • Using distributed submodules