Skip to content

Instantly share code, notes, and snippets.

View PhantomRay's full-sized avatar
😈
Incubation

Ray PhantomRay

😈
Incubation
  • Australia
  • 11:04 (UTC +10:00)
View GitHub Profile
@PhantomRay
PhantomRay / node_prune.sh
Last active March 10, 2021 13:17 — forked from gpittarelli/node_prune.sh
Prunes very-likely-uneeded files from node_modules directories
#!/usr/bin/env bash
# Port of https://github.com/tj/node-prune to bash
# Also,
# - fixed "*.ts" being overzealous and killing .d.ts files
# - added some more file types from https://github.com/npm/npm/issues/5264#issuecomment-259800486
#
# See also:
# - https://github.com/timoxley/cruft
# - https://yarnpkg.com/en/docs/cli/autoclean
# - https://github.com/ModClean/modclean
@PhantomRay
PhantomRay / app.js
Last active February 11, 2023 02:33
Read data from Dymo M10 scale using nodejs in Windows.
var HID = require('node-hid'),
usb = require('usb');
var reading = false,
interval,
vid = 0x922,
pid = 0x8003;
// try to connect to the scale if available
startReading();
@PhantomRay
PhantomRay / .goaccess
Last active July 22, 2019 14:44
goaccess log/time/date format for AWS S3
# AWS S3 Log Format
# config file
date-format %d/%b/%Y
time-format %T
log-format %^ %^ [%d:%t %^] %h %^ %^ %^ %^ "%^ %r %^" %s %^ %b %^ %^ %^ "%^" "%u" %^
# example log
#
1d82a3126606ef56450b5ea405d549ce4e5a5c29ccd240012c6032c9d7dc454f random [09/Aug/2015:06:20:46 +0000] 1.129.96.209 - 494F7E82C4F16813 REST.HEAD.OBJECT files/24/2015-08/e86c1ab2-563b-40f8-aa61-3eecefe30867_f.png "HEAD /app/files/24/2015-08/e86c1ab2-563b-40f8-aa61-3eecefe30867_f.png HTTP/1.1" 200 - - 8610 19 - "-" "someapp/3.0.0 (Windows_NT; x64 6.1.7601; Intel R Core TM i3-4160 CPU @ 3.60GHz) nodejs/v0.10.29 device/12345" -
@PhantomRay
PhantomRay / convert.sh
Created August 12, 2014 01:46
Convert pfx to cer with no pass phrase using openssl. cert/key PEM is inside this file.
openssl pkcs12 -in file.pfx -out certificate.cer -nodes