Skip to content

Instantly share code, notes, and snippets.

@lrvick
lrvick / app.js
Last active April 26, 2024 13:06
AngularJS credit card form with validation
// MIT: http://opensource.org/licenses/MIT
angular.module('app', []);
angular.module('app').controller
( 'MainCtrl'
, function($scope,$locale) {
$scope.currentYear = new Date().getFullYear()
$scope.currentMonth = new Date().getMonth() + 1
$scope.months = $locale.DATETIME_FORMATS.MONTH
@lrvick
lrvick / github-troll.md
Last active April 22, 2024 09:12
Trolling Github's DMCA repo with their own security flaws.
@lrvick
lrvick / genpass.go
Created November 20, 2023 19:42
go pass
func generatePassword(length int) string {
const CharSetIAMPassword = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012346789!@#$%^&*()_+-=[]{}|'"
charSetLength := len(CharSetIAMPassword)
rand.Seed(time.Now().UTC().UnixNano())
result := make([]byte, length)
for i := 0; i < length; i++ {
result[i] = CharSetIAMPassword[rand.Intn(charSetLength)]
}
return string(result)
}
@lrvick
lrvick / signal_handle.rs
Last active September 1, 2023 03:11
rust stdlib signal handling in linux
fn handle_signals() -> c_int {
let mut mask: sigset_t = unsafe {
let mut masku = MaybeUninit::<sigset_t>::uninit();
sigemptyset(masku.as_mut_ptr());
masku.assume_init()
};
unsafe { sigaddset(&mut mask, SIGINT) };
unsafe { sigaddset(&mut mask, SIGTERM) };
unsafe { sigprocmask(SIG_BLOCK, &mask, ptr::null_mut()) };
let signal = unsafe { sigwaitinfo(&mask, ptr::null_mut()) } as i32;
@lrvick
lrvick / hashbang-todo.md
Last active August 28, 2023 16:47
Hashbang Todo

#! Todo List

Things we want to get done for the community along with bounties for each.

Notes

A project is done when a k8s kustomization is submitted to the gitops repo, and it is live and available for users to use. Also must have some kind of backup solution (hosted postgres with backup services is acceptable for a first pass)

@lrvick
lrvick / tasks.yml
Created May 18, 2021 22:40
Mac Ansible management example
---
- name: Check if Previously Run
stat:
path: /var/log/ansible.log
register: ansible_logfile
- name: Enable FileVault2
filevault: enabled=true
become_user: root
@lrvick
lrvick / share-recovery.md
Created July 19, 2023 16:59
Share Recovery

Share Recovery

Overview

This document outlines the creation of a "Share Recovery" (SR) system which functions as a one-way box that one can encrypt a partial secret to at any time, with decryption only possible by a share holder with access to an offline encryption key.

Such system offers high security, but low redundancy. It is suitable for

@lrvick
lrvick / disaster-recovery.md
Created July 17, 2023 18:16
Disaster Recovery

Disaster Recovery

Overview

This document outlines the creation of a "Disaster Recovery" (DR) system which functions as a one-way box that we can encrypt secrets to at any time, but only recover them with cooperation of a quorum of people with access to multiple offline HSM devices stored in a diversity of physical locations.

In short, it should be trivial to backup data, but very expensive to recover;

@lrvick
lrvick / sigv2.md
Last active April 11, 2023 06:53
Sig v2 Design
@lrvick
lrvick / gpdwinmax2-qubes.md
Last active April 5, 2023 05:02
GPD Win Max 2 - QubesOS

GPD Win Max 2 - QubesOS 4.1

Firmware Settings

  1. Get to firmware settings by tapping "Del" while booting
  2. Alt+F5 then reboot and return to firmware settings to get secondary "Advanced" menu
  3. Advanced -> CPU Configuration -> SVM Mode -> Enabled
  4. Advanced -> PCI Subsystem Settings -> SR-IOV Support -> Enabled
  5. Advanced -> AMD CBS -> NBIO Common Options -> IOMMU -> Enabled