Skip to content

Instantly share code, notes, and snippets.

View ncw's full-sized avatar
429 Too Many Requests

Nick Craig-Wood ncw

429 Too Many Requests
View GitHub Profile
ncw / M5NCW.cbr
Created August 1, 2022 09:57
tlf log truncation
CREATED-BY: tlf-1.5~git
X-CREATED-ON: 01-Aug-22 at 09:43z
go 1.18
replace => /opt/go/x/net
require ( v0.0.0-20220607020251-c690dde0001d // indirect v0.3.6 // indirect
ncw /
Created July 21, 2020 20:45
Response to File System Interfaces for Go proposal

This is going to be a long reply based in my experiences with rclone: Rclone interfaces with 30ish different cloud providers and has some very similar interfaces so I feel like I might have something to contribute!

As part of rclone I have made very similar interfaces. In fact there are two, one lower level more matched to the typical things cloud storage systems can do (eg read as streams, use Range requests, not seek in writes) and one which is more general purpose which can do everything a normal file system can (eg seek while writing, ReadAt,

ncw /
Created June 12, 2017 20:56
ARM assembler converter, ARM style to Go style
#!/usr/bin/perl -w
use strict;
# Rough and ready conversion of arm style assembler to go style
# assembler. Note input is expected to be in lower case whereas
# output is in upper case.
while (<>) {
ncw /
Last active March 25, 2016 16:56
Reproduction for OneDrive file corruption

File corruption bug on onedrive

To reproduce, run the python program This needs the python onedrivesdk. This uploades the file goof.png repeatedly, to the root of your onedrive as 1.png, 2.png, etc.

If you run it after a while you'll see a size mis-match.

This means that the 97k file is apparently 200k. If you look in the web interface it also appears as 200k, however if you download it is

ncw /
Last active March 22, 2016 15:37
Notes on Backblaze B2 API after rclone integration

Notes on Backblaze B2 API after rclone integration

I've finished the first version of rclone integration (see and ).

rclone aims to be "rsync for cloud storage" - a command line tool just aimed at the mechanics of transporting files between cloud storage systems and the local disk.

Here are some notes on where I found parts of the API which could be

ncw /
Created May 28, 2015 15:00
Go compiler bug demo

Go compiler bug demo

Compiling this directory with go build you get

./e.go:4: TypeType.New undefined (type *Type has no field or method New)

Where if you look in t.go you can see that method is defined.

ncw / sort.go
Created March 10, 2015 09:38
A channel based quicksort.
// Channel based quicksort
// Just for fun!
// Interesting that you can make a quicksort without being able to
// index your input. It may be O(n log n) for comparisons but it is
// O(n) for channels and go routines so perhaps not the most efficient
// quicksort ever ;-)
// It also has the worst case complexity O(n²) if you feed it sorted
ncw / README.txt
Last active February 20, 2024 19:30 — forked from spikebike/client output
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
Run the server in one terminal
go run server.go
ncw / cumul.go
Created July 24, 2012 20:46
Conversion of to Go
// Code from
// Converted to Go by Nick Craig-Wood
// Runs in pretty much identical time to the "basic sum (C++-like)" code
package main
import (