Skip to content

Instantly share code, notes, and snippets.

View mohammed90's full-sized avatar

Mohammed Al Sahaf mohammed90

View GitHub Profile

Signature Verification

Release assets/artifacts are not signed using project Sigstore technology, which issues certificates containing details about the subject to whom the certificate is issues amongst others. You can start by inspecting the certificate used to sign your artifact of choice. The certificates are base64 encoded, so you first have to base64 decode it to receive the pem file. In the example, we'll work with the caddy_2.6.0_checksums.txt artifact and assume *nix environemnt.

Start by downloading the the 3 files pertaining to your artifact of choice (i.e. <the artifact> which is the actual artifact whose companion signature and certs are to be verified, <the artifact>.sig which is the signature of the artifact, and <the artifact>.pem is the certificate descending from the root cert by Fulcio by Sigstore). Then base64 decode the downloaded .pem file to the armored version:

base64 -d < caddy_2.6.0_checksums.txt.pem > cert.pem
@mohammed90
mohammed90 / regex-howto.md
Created May 15, 2021 10:35 — forked from cat-lin-morgan/regex-howto.md
Regular Expressions - Regex: A How To For Dummies

Regular Expressions - Regex: A How To For Dummies

Ooohh, cryptic! Ahhh, strange!

confused math lady meme but instead of math its regex. meme by me

Today's Topic

/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
@mohammed90
mohammed90 / javapackager template.iss
Created February 5, 2020 18:11 — forked from TurekBot/javapackager template.iss
The Inno Setup template that the javapackager uses to create installers. If you use this template as a drop-in resource, the javapackager will still replace the variables for you. Found in the jar %JAVA_HOME%\lib\ant-javafx.jar under the com\oracle\tools\packager\windows\template.iss file.
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder APPLICATION_NAME with application files
[Setup]
AppId={{PRODUCT_APP_IDENTIFIER}}
AppName=APPLICATION_NAME
AppVersion=APPLICATION_VERSION
AppVerName=APPLICATION_NAME APPLICATION_VERSION
AppPublisher=APPLICATION_VENDOR
AppComments=APPLICATION_COMMENTS
AppCopyright=APPLICATION_COPYRIGHT
@mohammed90
mohammed90 / server.go
Created March 13, 2019 19:29 — forked from soheilhy/server.go
grpc route guide server + cmux
/*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
@mohammed90
mohammed90 / README.md
Created February 21, 2019 21:03 — forked from Luzifer/README.md
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
@mohammed90
mohammed90 / postgres-cheatsheet.md
Created September 7, 2018 20:41 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

Crash ID: 171ff3c94bb5dee26b78c3c766f32d0d3f28bb9d

Crash Content (Quoted):

    	"import\r\t/*/io8logmt"

@mohammed90
mohammed90 / crashers_2.md
Created March 30, 2018 18:46
Second patch of Caddy crashers

Crash ID: 5d2e733f56972cb95c184e9efab56c419cb4653a

Crash Content (Quoted):

    	"import /???/?*?o"

Crash ID: 08e4fc99dee43eb906c4caad5ff276bdff31489a

Crash Content (Quoted):

    	"import /*/*?8*????"

Crash Output: