Skip to content

Instantly share code, notes, and snippets.

View ianloic's full-sized avatar

Ian McKellar ianloic

View GitHub Profile
import 'dart:async';
class AsyncProxyController<T> {
}
class AsyncProxy<T> {
AsyncProxyController<T> ctrl;
}
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WARNING: This file is machine generated by fidlgen.
library fidl_fidl_examples_events$async;
import 'dart:async';
import 'dart:typed_data';
import 'dart:async';
import 'other.dart' show Error;
abstract class Wlan {
Future<Error> method();
}
class WlanFuturize {
final Wlan _inner;
@ianloic
ianloic / NUCReset.ino
Created November 13, 2017 18:50
Adafruit Feather Sketch for sending a reset signal to an Intel NUC using a Non-Latching Relay Featherwing with signal on A2
int SIGNAL = A2;
void setup() {
// start serial port at 9600 bps and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("hello.");
@ianloic
ianloic / make-test-files.sh
Last active May 19, 2017 04:21
Comparing scp and netcp, nuc ethernet and USB ethernet
#!/bin/bash
set -eu
# gzip a user.bootfs to make a high-entropy test files
# make 10M, 1M, 100K, 10K test files
gzip -c < $FUCHSIA_BUILD_DIR/user.bootfs | dd of=test-file-10M bs=1M count=10 iflag=fullblock
dd if=test-file-10M of=test-file-1M bs=1M count=1
dd if=test-file-10M of=test-file-100K bs=10K count=10
dd if=test-file-10M of=test-file-10K bs=10K count=1
@ianloic
ianloic / gist:38b267c05d49b6a71a80f65b75b089d1
Created March 29, 2017 04:17
cowsay as a service over ssh
% ssh -o RequestTTY=no fuchsia@192.168.3.53 hello world
______________
| hello world |
--------------
\ ^__^
\ (oo)\_____
(__)\ )\/\
||----w |
|| ||
#include <utility>
#include <iostream>
#include <atomic>
#include <set>
class OnceWatcher {
public:
virtual void Called() = 0;
};
#autoload
# Hack to replace _path_files with one that expands // and then calls the
# original.
local fdir ffile original found_one
# Look for the second _path_files in the $fpath
for fdir in $fpath; do
ffile=$fdir/$0
Trying 192.168.3.53...
Connected to 192.168.3.53.
Escape character is '^]'.
^[[68;1R
$
^[[68;1R
$
^[[68;1Rls
$ ls
d 0 .
MAGENTA KERNEL PANIC
GIT REVISION 6082d6775a873f1e91fbf4568b12b386b96e0e08
panic (caller 0xffffffff80134da1 frame 0xffffff804da13420): DEBUG ASSERT FAILED at (kernel/lib/magenta/process_dispatcher.cpp:1
82): state_ == State::RUNNING
platform_halt suggested_action 0 reason 9
Halting...
bt#00: 0xffffffff801522b8