Skip to content

Instantly share code, notes, and snippets.

View stringsn88keys's full-sized avatar

Thomas Powell stringsn88keys

View GitHub Profile
@stringsn88keys
stringsn88keys / bundle_info_all
Last active August 31, 2022 13:26
bundle info for all gems
bundle list 2>&1 | sed 's/^ \* \(.*\) (.*)/\1/' | grep -v 'bundle info' | grep -v 'bundle:' | xargs -I {} bundle info {}
@stringsn88keys
stringsn88keys / send_message.applescript
Created September 16, 2022 16:30
Send an iMessage from the command line (one arg at a time)
#!/usr/bin/env osascript
# https://chrispennington.blog/blog/send-imessage-with-applescript/
on run parameters
# the number here is the number of seconds
set theDelay to 3
# Verify if this can use display names
set phoneNumber to "+1 (555) 555-1212"
tell application "Messages"
set targetBuddy to phoneNumber
@stringsn88keys
stringsn88keys / generate_key_check.rb
Created November 28, 2022 21:57
Test generate_key
require 'openssl'
curve='prime256v1'
p ::OpenSSL::PKey::EC.new(curve).generate_key
// Inspired by https://www.youtube.com/watch?v=MHBG_R_dhwk
#include <stdio.h>
int main() {
char input_line[80];
long line_count = 0;
while(!feof(stdin)) {
fgets(input_line, 80, stdin);
if(!feof(stdin)) line_count++;
@stringsn88keys
stringsn88keys / openssl_stats.rb
Last active April 17, 2024 16:44
OpenSSL ruby constants and settings dump
require 'openssl'
# https://ruby.github.io/openssl/OpenSSL.html
puts "OpenSSL::OPENSSL_FIPS = #{OpenSSL::OPENSSL_FIPS}"
puts "\t-> Boolean indicating whether OpenSSL is FIPS-capable or not"
# try to turn on fips_mode if it is marked as true
if OpenSSL::OPENSSL_FIPS
puts "-> Setting fips_mode to true"
@stringsn88keys
stringsn88keys / to_powershell.md
Last active May 15, 2024 12:03
convert cmd or bash to powershell
command from powershell powershell abbreviated
rmdir /q /s c:\folder cmd.exe Remove-Item -Recurse -Force c:\folder rm -r -fo c:\folder
find . -name '*wildcard*' bash Get-ChildItem -Path . -Include '*wildcard*' gci . -inc '*wildcard*'
ls -lart bash Get-ChildItem | Sort-Object LastWriteTime ls | sort LastWriteTime
dir /o:d cmd.exe Get-ChildItem | Sort-Object LastWriteTime ls | sort LastWriteTime
ls -larS bash Get-ChildItem | Sort-Object Length ls | sort Length
dir /o:s cmd.exe Get-ChildItem | Sort-Object Length ls | sort Length
find . -name '*wildcard*' | xargs -I {} xxd {} bash Get-ChildItem -Path . -Include '*wildcard*' -Recurse | ForEach-Object { Format-Hex $_ } gci '*wildcard*' -R | foreach { fhx $_ }