Skip to content

Instantly share code, notes, and snippets.

View tpmccallum's full-sized avatar

Timothy McCallum tpmccallum

View GitHub Profile
@tpmccallum
tpmccallum / installing_dogecoin_on_ubuntu_20_04.md
Last active November 6, 2022 20:28
My personal experience; installing Dogecoin full node on Ubuntu 20.04

My personal experience of installing Dogecoin on Ubuntu 20.04

This is an account of the things that I had to do to set up a full node for Dogecoin. This Gist will remind future me how to perform this task :)

System requirements

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev

System variable

cd ~
@tpmccallum
tpmccallum / install_dogecoin.md
Last active April 26, 2025 17:18
How to install a Dogecoin Core Full Node and Dogecoin Core GUI wallet software on Ubuntu 20.04 LTS

Disclaimer: If you use the following, it is entirely at your own risk.

Install Dogecoin on Ubuntu 20

System requirements

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev

System variable

@tpmccallum
tpmccallum / Installing_tesseract_on_Centos7.md
Last active January 19, 2021 00:56
A guild to installing tesseract OCR on Centos7 and also configuring new languages

Installing Tesseract 4.0.0 on Centos7

The goal of this gist is to show how to use a CentOS7 system (with root access), to create a static compiled binary which can be copied over to, and used on, a CentOS7 system (with no root access).

Question: Why would we want to do this?

Answer: In some cases you might want to use tesseract on a machine via a cloud provider. For security reasons, specific machines on a specific cloud provider's infrastructure will not allow root access to the remove guest (you).

Solution: What we are about to do is log into a CentOS7 machine where we do have root access (this can be any machine i.e. a VM on your local machine etc.). We install all of the dependencies and create sufficuent executables on the machine with root access. We then copy just the tesseract executable over to the machine with no root access and make sure that the executables are in the no root access machine's path. Voilà!

The CentOS7 machine with root access

@tpmccallum
tpmccallum / image_processing_using_JAMStack.html
Last active December 29, 2020 04:52
An HTML page which accesses API endpoints for image processing
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Image processing</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
["tower", "towered", "towering", "towers", "towing", "towne", "townes", "townley", "townsend", "townsfolk", "townshend", "township", "townships", "townsman", "townsmen", "townspeople", "toxic", "toy", "toyed", "toying", "toys", "tra", "trabajo", "trabajos", "trac", "trace", "traceable", "traced", "tracer", "tracery", "traces", "tracht", "trachten", "trachtte", "tracing", "track", "tracked", "tracking", "trackless", "tracks", "tract", "tractable", "traction", "tracts", "tracy", "tracys", "trad", "traddles", "trade", "traded", "trademark", "trader", "trades", "tradesman", "tradesmans", "tradesmen", "tradesmens", "tradespeople", "trading", "tradition", "traditional", "traditionally", "traditionary", "traditions", "traduced", "traduction", "traduire", "traduit", "trae", "traegt", "traenen", "traer", "traf", "trafalgar", "trafen", "traffic", "trafficking", "trafford", "trage", "tragedian", "tragedians", "tragedies", "tragedy", "tragen", "tragic", "tragical", "tragically", "tragique", "tragischen", "tragoedie", "tr
@tpmccallum
tpmccallum / try_it_for_yourself.js
Last active December 13, 2020 03:22
Paste this into your chrome console
// Paste this into chrome console
var buffer_1 = new ArrayBuffer(50000);
var buffer_2 = new ArrayBuffer(1000000);
var needle = new Uint8Array(buffer_1);
var haystack = new Uint8Array(buffer_2);
needle.fill(111)
haystack.fill(222)
needle_length = needle.length;
haystack_length = haystack.length;
needle_length_string = needle_length.toString();
@tpmccallum
tpmccallum / rotate_an_image_cargo.toml
Created November 29, 2020 02:22
An example of rotating an image using Rust (the toml file)
[package]
name = "rotate_an_image"
version = "0.1.0"
authors = ["tpmccallum <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
image = { version = "0.23.0", default-features = false, features = ["jpeg", "png", "gif"] }
@tpmccallum
tpmccallum / rotate_an_image_main.rs
Created November 29, 2020 02:21
An example of rotating an image using Rust
use image::Rgba;
use image::ImageBuffer;
use image::DynamicImage;
use imageproc::geometric_transformations::Interpolation;
use image::{ImageOutputFormat, GenericImageView, ImageFormat};
use imageproc::geometric_transformations::rotate_about_center;
fn main() {
let dyn_img = image::open("/Users/tpmccallum/Documents/cat.png").unwrap();
let (w,h) = dyn_img.dimensions();
@tpmccallum
tpmccallum / wrapper_for_faas_call_example.js
Last active November 23, 2020 22:24
A wrapper which can internally call faas and return the result
function searchBytes(_haystack_array_buffer, _needle_array_buffer, _wasm_id, _function_name) {
return new Promise(function(resolve, reject) {
var needle = new Uint8Array(_needle_array_buffer);
var haystack = new Uint8Array(_haystack_array_buffer);
needle_length = needle.length;
haystack_length = haystack.length;
needle_length_string = needle_length.toString();
for (i = needle_length_string.length; i < 10; i++) {
needle_length_string = "0" + needle_length_string;
}
@tpmccallum
tpmccallum / gist:71ae0d99d84e2d63b44b8813fdab899a
Last active November 22, 2020 03:00
MaxGraey_search_bytes_solution_II
function isSubset(haystack, needle) {
return new Promise(function(resolve, reject) {
let n = needle.length,
m = haystack.length,
d = m - n;
outer: for (let i = 0; i <= d; ++i) {
for (let j = 0; j < n; ++j) {
if (needle[j] !== haystack[i + j]) {
continue outer
}