Skip to content

Instantly share code, notes, and snippets.

@csexton
csexton / compressed_public_key.rb
Created April 10, 2019 16:45
Attempt to generate a compressed public key from EC private key
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
gem "openssl"
end
# See https://github.com/ruby/openssl/issues/29
def real_public_key(k)
# TODO? .point_conversion_form = :compressed
point = k.public_key
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@csexton
csexton / get_pr_from_branch.rb
Created October 22, 2018 15:35
Get the Pull Request number from a git branch
# frozen_string_literal: true
require "net/https"
require "uri"
require "json"
def find_pr(org, repo, branch)
uri = URI("https://api.github.com/repos/#{org}/#{repo}/pulls?head=#{org}:#{branch}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
https://chrome.google.com/webstore/detail/display-kit/bcdedldcbikpjmjbllhobfaohpajojli
2017-12-28T23:02:53.697421+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.232Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697436+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.233Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697437+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.233Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697438+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.238Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697439+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.239Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697439+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.239Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697440+00:00 app[web.2]: [remote] player_773 2017-12-28T22:55:57.243Z [Rotator Main] Current content is complete, rotating
2017-12-28T23:02:53.697
(function() {
(function() {
(function() {
var slice = [].slice;
this.ActionCable = {
INTERNAL: {
"message_types": {
"welcome": "welcome",
"ping": "ping",
@csexton
csexton / index-files.log
Last active August 17, 2017 16:01
ChromeOS Issue 756193
localhost 5aa019f5-27e0-418e-9a62-2bb1a8d207c2 # pwd
/home/chronos/u-1134631a3449ab75f309eabbd2a6c84545e065f4/Storage/ext/bcdedldcbikpjmjbllhobfaohpajojli/def/Service Worker/CacheStorage/9a2b2fcfe89d2acf3d92909929566b9a51c251b1/5aa019f5-27e0-418e-9a62-2bb1a8d207c2
localhost 5aa019f5-27e0-418e-9a62-2bb1a8d207c2 # ls -al ./**
-rw-r--r--. 1 chronos chronos 0 Aug 9 13:33 ./d70841621db5d4b7_0
-rw-r--r--. 1 chronos chronos 0 Aug 9 13:33 ./fa5e53aa798c61ca_0
-rw-r--r--. 1 chronos chronos 0 Aug 9 13:33 ./index
./index-dir:
total 16
get_tz = ()->
lat = $('input[name=lat]').val()
lng = $('input[name=lng]').val()
time = Math.round((new Date().getTime())/1000)
$.ajax(
url:"https://maps.googleapis.com/maps/api/timezone/json?location=#{lat},#{lng}&timestamp=#{time}&sensor=false",
).done((response) ->
if(response.timeZoneId != null)
console.log(response)
alert(response.timeZoneId)
@csexton
csexton / devtools.sh
Last active August 9, 2017 16:37
Script to enable remote chrome devtools
#!/bin/bash
#
# Remote devtools debugging - allows remote connectivity to Chrome dev tools for debugging kiosk session / etc.
#
# Originally from https://github.com/jay0lee/cros-scripts
#
# Run this script on a Chromebook:
# 1. Put Chromebook in developer mode - https://www.chromium.org/chromium-os/poking-around-your-chrome-os-device
# 2. Log into device. Press CTRL+ALT+T to open crosh shell.
# 3. Type "shell" to enter Bash shell.
@csexton
csexton / README.md
Created August 9, 2017 14:36
Setup Chrome Devtools

Debugging a Kiosk App

In "Device Management > Chrome Management > Device Settings" under "Enrollment and Access" set "Forced Re-enrollment" to "Device is not forced to re-enroll after wiping".

Reboot device into Developer Mode (See device specific instructions here).

Normally this is done by holding the recovery button down during a reboot, and at the Recovery screen press Ctrl-D (there's no prompt - you have to know to do it). It will ask you to confirm, then reboot into dev-mode.

Configure the networking details and accepts terms, but DON'T LOG IN YET.