Skip to content

Instantly share code, notes, and snippets.

@captn3m0
captn3m0 / hsl-jekyll.rb
Created February 1, 2024 07:04
A HSL to Hex Jekyll Filter
require 'color'
module Jekyll
module HSLToHexFilter
def hsl_to_hex(input)
# Extract HSL components from the input string
hsl_match = input.match(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/)
hue, saturation, lightness = hsl_match.captures.map(&:to_f)
# Create HSL object
@captn3m0
captn3m0 / jekyll-sqlite.rb
Created May 8, 2023 07:23
Jekyll Sqlite Plugin
require 'sqlite3'
module SQLiteGenerator
class Generator < Jekyll::Generator
priority :high
def generate(site)
site.config['sqlite'].each do |name, config|
require 'pp'
SQLite3::Database.new config['file'] do |db|
Jekyll.logger.info "Jekyll SQLite:", "Starting to load #{name}"
@captn3m0
captn3m0 / PKGBUILD.diff
Created May 7, 2023 10:13
openscap-1.3.7 clean install
diff --git a/PKGBUILD b/PKGBUILD
index 2786452..150320b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
# Maintainer: Quey-Liang Kao <s101062801@m101.nthu.edu.tw>
pkgname=openscap
-pkgver=1.3.6
+pkgver=1.3.7
@captn3m0
captn3m0 / 01-README.md
Created November 22, 2022 06:55
AWS Hyderabad

List of missing services on AWS Hyderbad region (at launch) is in missing-services.txt

Announcement text:


Hello Everyone,

We are excited to announce that the AWS Asia Pacific (Hyderabad) Region is now available.

@captn3m0
captn3m0 / _headers
Created November 22, 2022 05:23
endoflife.date sample rendered files
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
# Generated using https://www.permissionspolicy.com/
Permissions-Policy: accelerometer=(), ambient-light-sensor=(), autoplay=(), battery=(), camera=(), cross-origin-isolated=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), navigation-override=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), web-share=(), xr-spatial-tracking=() interest-cohort=()
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
/api*
Access-Control-Allow-Origin: *
@captn3m0
captn3m0 / apple.txt
Created November 8, 2022 10:50
list of apple releases
macOS Catalina 10.15.3, Security Update 2020-001 Mojave, Security Update 2020-001 High Sierra
macOS Catalina 10.15.3, Security Update 2020-001 Mojave, Security Update 2020-001 High Sierra
watchOS 6.1.2
watchOS 6.1.2
iOS 13.3.1 and iPadOS 13.3.1
iOS 13.3.1 and iPadOS 13.3.1
iOS 13.3.1 and iPadOS 13.3.1
iOS 13.3.1 and iPadOS 13.3.1
iOS 12.4.5
iOS 12.4.5
@captn3m0
captn3m0 / 01.md
Last active October 17, 2022 15:58
Motorala Supproted Devices

moto g pro

  • Currently receiving monthly security updates.
  • Device launched on June, 2020
  • Security updates will stop on June, 2023

moto g stylus 5g (2022)

  • Currently receiving regular security updates.
  • Device launched on April, 2022
  • Security updates will stop on April, 2025
  • Launched On: Android 12
@captn3m0
captn3m0 / .gitignore
Last active April 8, 2022 08:48
pupeteer with log
node_modules
@captn3m0
captn3m0 / 01-README.md
Created July 15, 2021 20:23
ikea-check-script

Run using something like:

while sleep 300; do ikeacheck.sh;done

to run a check every 5 minutes. The script notifies you via notify-send. and puts a timestamp in ~/tmp/ikea.txt.

The curl command is stripped for reference here. To get the exact command, fill the PIN code form at the bottom of your shopping bag, open network tools, and capture the request made to /clickandcollect/in/receive/. Right click and "Copy-to-curl" on that request.

Once this succeeds, your account is added to the list, and if you open your browser sesssion again, you should'nt get the 818 error.

@captn3m0
captn3m0 / video.txt
Last active July 12, 2021 06:25
Video Speed Bookmarklet
The first reduces speed to 0.75x of current:
javascript:(function()%7BArray.from(document.getElementsByTagName('video')).forEach(vid%20%3D%3E%20vid.playbackRate%20*%3D0.75)%3B%7D())
The second increases speed to 1.25x of current:
javascript:(function()%7BArray.from(document.getElementsByTagName('video')).forEach(vid%20%3D%3E%20vid.playbackRate%20*%3D%201.25)%3B%7D())
You can press multiple times to get where you want.