Skip to content

Instantly share code, notes, and snippets.

@danielroe
danielroe / settings.json
Last active April 28, 2024 19:28
VScode settings for a minimal UI
{
// Disable telemetry
"telemetry.telemetryLevel": "off",
// Zen mode
"zenMode.fullScreen": false,
"zenMode.hideTabs": true,
"zenMode.centerLayout": false,
// Theming
"workbench.iconTheme": "city-lights-icons-vsc",
"editor.fontFamily": "Dank Mono",
@mattkingshott
mattkingshott / Aliases.sh
Created December 15, 2021 09:00
A handy list of terminal aliases for Laravel application development
# Define bash aliases to make vour Laravel workflow faster
# and more productive. Here are some to get you started.
# PHPUnit
alias p="./vendor/bin/phpunit -d memory_limit=2048M --do-not-cache-result"
alias pf="p --filter"
# Laravel Dusk
alias d="php artisan dusk -d memory_limit=2048M --do-not-cache-result"
alias df="d--filter"
@ryanburnette
ryanburnette / Caddyfile
Last active April 1, 2024 07:54
Caddy v2.1+ CORS whitelist
(cors) {
@cors_preflight{args.0} method OPTIONS
@cors{args.0} header Origin {args.0}
handle @cors_preflight{args.0} {
header {
Access-Control-Allow-Origin "{args.0}"
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Headers *
Access-Control-Max-Age "3600"
@ld100
ld100 / ArchLinuxWSL2.md
Last active April 27, 2024 18:05
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@lbrame
lbrame / podman_arch_rootless.md
Created February 11, 2020 17:47
Running rootless unprivileged Podman containers on Arch Linux

Setting up podman rootless containers on Arch Linux

Podman is a container engine that is similar to and fully compatible with Docker that has the peculiarity of not requiring a daemon to run and to allow for rootless containers, which are often deemed safer than privileged containers running as root. Podman is a drop-in replacement for Docker that even supports the same syntax and it has good support from Red Hat.

However, running podman rootless containers on Arch Linux may not be obvious, so I'm writing the instructions I have used to achieve that here.

Podman works using control groups and users from which said containers need to be launched need to be assigned an appropriate range of subordinate user and group IDs. On Arch Linux, these files are not present and they need to be created.

From a root shell:

@bmatthewshea
bmatthewshea / sa-testemail.bash
Last active August 25, 2022 18:33
Spamassassin - Command Line Test Email
#!/bin/bash
def_filename="test.eml"
tmp1="/tmp/emailresults.txt"
tmp2="/tmp/emailresults.log"
usage="
$(basename "$0") [-h] [mailmessage]
Send email through Spamassassin manually and view output
Flags:
@cerebrate
cerebrate / README.md
Last active December 2, 2023 08:17
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

WARNING

THIS GIST IS EXTREMELY OBSOLETE. DO NOT FOLLOW THESE INSTRUCTIONS. SERIOUSLY.

IF YOU IGNORE THE ABOVE WARNING, YOU AGREE IN ADVANCE THAT YOU DIDN'T GET THESE INSTRUCTIONS FROM ME, THAT I WARNED YOU, AND THAT I RESERVE THE RIGHT TO POINT AND LAUGH MOCKINGLY IF AND WHEN SOMETHING BREAKS HORRIBLY.

I'll do a write-up of current custom-kernel procedures over on Random Bytes ( https://randombytes.substack.com/ ) one day soon.

NOTE

@romkatv
romkatv / Pure style for Powerlevel10k.md
Last active December 21, 2023 00:27
Pure style for Powerlevel10k

Powerlevel10k can generate the same prompt as Pure.

pure

Installation

git clone https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
@calebporzio
calebporzio / error_blade_directive.php
Created March 28, 2019 20:34
A little Blade directive to make working with validation errors a bit nicer.
<?php
// Usage:
// Before
@if ($errors->has('email'))
<span>{{ $errors->first('email') }}</span>
@endif
// After:
@zouppen
zouppen / README.md
Last active October 13, 2018 07:44
Tool for checking SSL certificate expiration dates

SSL certificate expiration checker

Useful for Icinga or other alert tool. Checks certificates from service, not file. This detects cases where certificate is renewed but not updated.

Public domain.

HTTPS