Skip to content

Instantly share code, notes, and snippets.

View trombik's full-sized avatar

Tomoyuki Sakurai trombik

View GitHub Profile
@trombik
trombik / main.rs
Created June 16, 2024 13:46
A rust implementation of cat(1)
use std::io;
use std::io::prelude::*;
use std::io::BufReader;
use std::io::BufWriter;
use std::error::Error;
use std::fs::File;
use clap::Parser;
#[derive(Parser)]
@trombik
trombik / svgfluid.rb
Last active June 15, 2024 00:57
Remove width and height from a SVG file.
require "nokogiri"
# make a SVG image scalable, or fluid
@doc = Nokogiri::XML.parse(File.read(ARGV[0]))
@doc.at_css("svg").attributes.each_pair{ |k, _v| v.remove if k == "width" || k == "height" }
puts @doc.to_xml
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@trombik
trombik / main.ino
Last active June 10, 2022 03:53
A simple kitchen timer
/*
* SPDX-License-Identifier: ISC
*
* Copyright (c) 2022 Tomoyuki Sakurai <y@trombik.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@trombik
trombik / mifare-ultralight-ntag.js
Created March 8, 2022 08:17
enable write protection from memory 10, based on examples/mifare-ultralight-ntag.js
'use strict';
// #############
// Example: MIFARE Ultralight EV1 and NTAG 213/215/216 – implementation of card's specific commands
// - note: for instructions on reading and writing the data,
// please see read-write.js, which is common for all ISO/IEC 14443-3 tags
// - note: this guide applies to NTAG 213/215/216 cards as-well
// (the commands and configuration pages structure is same or very similar,
// the only difference is the location of the pages due to different user memory size)
// - docs (descriptions of the commands and data structure):
@trombik
trombik / traceroute-2022-02-14.txt
Last active February 14, 2022 09:12
traceroute results to facebook, he.net IPv6 broker gateway, and a.dns.jp
> host facebook.com
facebook.com name server d.ns.facebook.com.
facebook.com name server a.ns.facebook.com.
facebook.com name server b.ns.facebook.com.
facebook.com name server c.ns.facebook.com.
facebook.com descriptive text "google-site-verification=wdH5DTJTc9AYNwVunSVFeK0hYDGUIEOGb-RReU6pJlY"
facebook.com descriptive text "9v6vz6q1j6063bxtbrms7r9bd2cq1s29"
facebook.com descriptive text "v=spf1 redirect=_spf.facebook.com"
facebook.com descriptive text "google-site-verification=A2WZWCNQHrGV_TWwKh6KHY90tY0SHZo_RnyMJoDaG0s"
facebook.com mail is handled by 10 smtpin.vvv.facebook.com.
@trombik
trombik / ATmegaBOOT_168_atmega328.hex
Created September 26, 2020 04:29
ATmegaBOOT_168_atmega328.hex
:107800000C94343C0C94513C0C94513C0C94513CE1
:107810000C94513C0C94513C0C94513C0C94513CB4
:107820000C94513C0C94513C0C94513C0C94513CA4
:107830000C94513C0C94513C0C94513C0C94513C94
:107840000C94513C0C94513C0C94513C0C94513C84
:107850000C94513C0C94513C0C94513C0C94513C74
:107860000C94513C0C94513C11241FBECFEFD8E036
:10787000DEBFCDBF11E0A0E0B1E0ECE9FFE702C060
:1078800005900D92A230B107D9F712E0A2E0B1E065
:1078900001C01D92AD30B107E1F70E942D3D0C945F
:100000000C9468010C947A010C947A010C94663774
:100010000C942C370C947A010C947A010C947A018C
:100020000C947A010C947A010C947A010C94A937FF
:100030000C947A010C947A010C947A010C947A0154
:100040000C9495370C947A010C94E0390C945D3A39
:100050000C947A010C947A010C947A010C947A0134
:100060000C947A010C947A01084AD73B3BCE016E7E
:1000700084BCBFFDC12F3D6C74319ABD56833DDAFF
:100080003D00C77F11BED9E4BB4C3E916BAAAABE0E
:10009000000000803F05A84CCDB2D44EB93836A937
traceroute to pkgmir.geo.freebsd.org (149.20.1.201), 64 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 11.346 ms 18.034 ms 44.550 ms
2 172.20.32.1 (172.20.32.1) 36.033 ms 58.012 ms 35.301 ms
3 * * 145.64.9.96.sinet.com.kh (96.9.64.145) 20.418 ms
4 112.201.245.43.sinet.com.kh (43.245.201.112) 6.417 ms 6.938 ms 12.731 ms
5 109.201.245.43.sinet.com.kh (43.245.201.109) 13.588 ms
145.201.245.43.sinet.com.kh (43.245.201.145) 7.100 ms
109.201.245.43.sinet.com.kh (43.245.201.109) 10.916 ms
6 hurricaneelectric1-100g.hkix.net (123.255.91.158) 40.773 ms 41.278 ms 52.327 ms
7 100ge10-1.core1.tyo1.he.net (184.105.64.130) 88.464 ms 142.129 ms 155.777 ms
traceroute: Warning: travis-ci.com has multiple addresses; using 50.17.226.217
traceroute to travis-ci.com (50.17.226.217), 64 hops max, 40 byte packets
1 192.168.1.1 (192.168.1.1) 4.618 ms 2.164 ms 2.310 ms
2 36.37.211.1 (36.37.211.1) 9.136 ms 7.583 ms 7.561 ms
3 36.37.255.97 (36.37.255.97) 7.190 ms 11.776 ms 10.398 ms
4 36.37.255.41 (36.37.255.41) 9.851 ms 7.241 ms 8.597 ms
5 36.37.255.44 (36.37.255.44) 7.266 ms 6.924 ms 11.305 ms
6 te0-6-0-5.br03.sin02.pccwbtn.net (63.217.24.213) 76.085 ms 82.546 ms 78.003 ms
7 TenGE0-0-0-0.br05.chc01.pccwbtn.net (63.218.4.234) 245.429 ms 246.689 ms
TenGE0-0-0-2.br05.chc01.pccwbtn.net (63.218.4.242) 245.549 ms