Skip to content

Instantly share code, notes, and snippets.

View leoj3n's full-sized avatar
:octocat:
Edit status

Joel Kuzmarski leoj3n

:octocat:
Edit status
  • Drinking coffee somewhere.
View GitHub Profile
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active April 19, 2024 12:30
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ctechols
ctechols / compinit.zsh
Last active April 19, 2024 23:44
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@mfarrugi
mfarrugi / benchmark-sort.py
Last active October 22, 2018 12:26
Benchmark shell scripts!
#/usr/bin/python
import sys
import re
lines = sys.argv[1]
ms_thresh = int(sys.argv[2])
lines = lines.split("\n")
lines = map(str.strip, lines)
@spcmd
spcmd / ASCII - Delorean
Last active February 1, 2023 10:53
#ascii
__---~~~~--__ __--~~~~---__
`\---~~~~~~~~\\ //~~~~~~~~---/'
\/~~~~~~~~~\|| ||/~~~~~~~~~\/
`\\ //'
`\\ //'
|| || Hey Doc!
______--~~~~~~~~~~~~~~~~~~--______
___ // _-~ ~-_ \\ ___
`\__)\/~ ~\/(__/'
_--`-___ ___-'--_
@izabera
izabera / try-catch.sh
Last active March 5, 2017 01:56
silly try/catch
# try catch for bash/mksh/zsh/dash/busybox
[ "$BASH_VERSION" ] && shopt -s expand_aliases
alias try='tryblock ()'
alias throw='return'
alias catch='if tryblock; then :; else '
alias end_try='fi'
alias exceptions:='case $? in x) '
alias except=';;'
alias end_exceptions='esac'
alias always=' '
set :application, 'my_app_name'
set :repo_url, 'git@example.com:me/my_repo.git'
set :branch, :master
set :deploy_to, -> { "/srv/www/#{fetch(:application)}" }
set :log_level, :info
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
namespace :deploy do
desc 'Restart application'
@Explorer09
Explorer09 / ntfs_attr.sh
Last active January 4, 2024 05:24
Display or change attributes on an NTFS filesystem
#!/bin/sh
# ntfs_attr.sh - Display or change attributes on an NTFS filesystem
# Tools required:
# getfattr(1) and setfattr(1)
# http://savannah.nongnu.org/projects/attr/
# (In Debian/Ubuntu: sudo apt-get install attr)
# ntfs-3g (pre-installed in most Linux distros)
# http://www.tuxera.com/community/ntfs-3g-download/

Start weechat if you haven't already:

$ weechat

open up browser and go to: https://irc.gitter.im/ retrieve your /PASS

In weecaht run (thanks to raine):

@sjorge
sjorge / persist-syscfg
Created December 1, 2014 16:38
SmartOS File Server
#!/usr/bin/bash
# Originally based on http://wiki.smartos.org/display/DOC/Allowing+user+CRUD+in+the+global+zone
# Author: hugo@freenode
enable_stmf=1
enable_smb=1
enable_nfs=1
save_us=( /etc/passwd /etc/shadow /etc/group /etc/ouser_attr /etc/user_attr \
/etc/security/policy.conf /etc/security/auth_attr /etc/security/exec_attr \
@jarthod
jarthod / browser-mockup.png
Last active October 31, 2022 09:23
Pure CSS browser mockups
browser-mockup.png