Skip to content

Instantly share code, notes, and snippets.

View dezren39's full-sized avatar
πŸ•΅οΈβ€β™‚οΈ
Processing..

Drewry Pope dezren39

πŸ•΅οΈβ€β™‚οΈ
Processing..
View GitHub Profile
{{--
Icon view component for Laravel 7.
@disclaimer The icons used in this component are taken from "Refactoring UI Heroicons" (md-outline collection).
For more info https://github.com/refactoringui/heroicons by Steve Schoger & Adam Wathan.
@copyright MIT
@author Maurizio <https://twitter.com/mauriziolepora>
@adisbladis
adisbladis / env1-shell.nix
Created July 17, 2019 11:53
Merge multilple shell.nix files using mkShell
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
buildInputs = [
pkgs.hello
];
shellHook = ''
echo env1
'';
@milesgratz
milesgratz / Update-machine-certificate-private-key-permissions.ps1
Created May 31, 2019 17:40
PowerShell example of updating machine certificate private key permissions (CAPI vs CNG)
# Get cert on local computer by thumbprint
$thumbprint = '89D3FC64B6405E161EDC7A4CF14E111F5F6895AA'
$Cert = Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.Thumbprint -eq $thumbprint }
###################################################
# Manage private key of CAPI cert
###################################################
# Find private key
$privKey = $Cert.PrivateKey.CspKeyContainerInfo.UniqueKeyContainerName
@bernardomig
bernardomig / README.md
Last active October 29, 2023 15:32
Setup podman and nvidia-container-runtime

How to setup nvidia-container-runtime and podman/runc

Podman is such a cool project! However, there is no easy way to setup the nvidia-container-runtime and podman so that we can run unprivileged container in a gpu host. This is specially interesting in environments with multiple people accessing the same host (strong isolation between containers!!!).

Steps to setup the whole system

  1. Install podman and friends (buildah and skopeo)

Ubuntu: add-apt-repository -y ppa:projectatomic/ppa &amp;&amp; apt install podman buildah skopeo

@wi7a1ian
wi7a1ian / oop-design-patterns.md
Last active February 1, 2024 18:06
Design patterns in object-oriented programming

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler

Legend:

  • πŸ”Œ promotes decoupled architecture
  • πŸŽ“ synergy with SOLID principles (ocp, srp, dip...)
  • ▢️ runtime focused (i.e: promotes reconfiguration)
  • πŸ›  compiletime focused
  • πŸ“ configurable once (during initialization, usually from a config file)
  • πŸ†• creational pattern
  • β›“ structural pattern
@wybiral
wybiral / noscript-tracking.go
Last active October 28, 2024 23:01
Tracking cursor position in real-time with remote monitoring (without JavaScript)
// Tracking cursor position in real-time without JavaScript
// Demo: https://twitter.com/davywtf/status/1124146339259002881
package main
import (
"fmt"
"net/http"
"strings"
)
@lizthegrey
lizthegrey / attributes.rb
Last active March 27, 2025 02:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@shaneutt
shaneutt / LICENSE
Last active March 17, 2025 17:53
Golang: Demonstrate creating a CA Certificate, and Creating and Signing Certs with the CA
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@npearce
npearce / install-docker.md
Last active April 9, 2025 22:24
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
{ pkgs, ... }:
let
# This is a neat trick that clever taught me on #nixos. Here we
# re-import nixpkgs (using our fixed nixpkgs via pkgs.path) and
# force the system to be x86_64-linux, which in turn causes this
# derivation always to be built on x86_64-linux, regardless of the
# system it was intended to be built for (as long as we use
# nixpkgs.x instead of pkgs.x in the derivation!).