Skip to content

Instantly share code, notes, and snippets.

@lizthegrey
lizthegrey / attributes.rb
Last active August 29, 2025 15:40
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'
@adeekshith
adeekshith / .git-commit-template.txt
Last active September 19, 2025 10:32 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@conorgil
conorgil / module_publish_to_aws_cloudwatch_logs.tf
Created January 13, 2016 21:36
Sharing IAM Role Policies between multiple IAM Roles
# AWS Cloudwatch Logs install documentation:
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/QuickStartEC2Instance.html
# By defining this IAM Role Policy in a module, it can be referenced anywhere it is required
# for an IAM Role. This is preferrable to copy/pasting the IAM Policy statement because changes
# made to this role will automatically apply to all IAM Roles referencing this module.
###
# Variables
###
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active October 24, 2025 08:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@mikeobrien
mikeobrien / dashboard_show.html.haml
Last active August 29, 2015 14:22
Getting rid of the obnoxious GitLab activity sections (7.10.4 omnibus)
-# /opt/gitlab/embedded/service/gitlab-rails/app/views/dashboard/show.html.haml
- if @projects.any?
= render 'sidebar'
= link_to '#aside', class: 'show-aside' do
%i.fa.fa-angle-left
- else
= render "zero_authorized_projects"
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active May 21, 2025 00:30
jenkins groovy scripts collection.
@dixson3
dixson3 / workspace.sh
Created January 10, 2014 19:11
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# where to store the sparse-image
WORKSPACE=~/Documents/workspace.dmg.sparseimage
create() {
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 60g -volname workspace ${WORKSPACE}
}
detach() {
@hameno
hameno / java.pp
Created January 2, 2014 13:29
Dependencies: puppetlabs/apt
class java {
class { 'apt': }
# Add PPA
apt::ppa { 'ppa:webupd8team/java': } ->
# Prepare response file
file { "/tmp/oracle-java7-installer.preseed":
source => 'puppet:///modules/java/java.response',
mode => 600,
backup => false,
} ->
# Windows AMIs don't have WinRM enabled by default -- this script will enable WinRM
# AND install 7-zip, curl and .NET 4 if its missing.
# Then use the EC2 tools to create a new AMI from the result, and you have a system
# that will execute user-data as a PowerShell script after the instance fires up!
# This has been tested on Windows 2008 SP2 64bits AMIs provided by Amazon
#
# Inject this as user-data of a Windows 2008 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@ehlertij
ehlertij / windows_ec2_snapshot.bat
Last active August 11, 2017 01:24
Windows batch script for creating daily EC2 snapshots for a volume and deleting old ones.
set AWS_HOME=C:\AWS
set AWS_VOLUME=vol-12345678
set AWS_SNAPSHOT_KEEP=10
:: Create snapshot for this volume
CMD /C ec2-create-snapshot %AWS_VOLUME% -d "Daily Snapshot"
:: Find old snapshots for this volume, sort them by date desc
ec2-describe-snapshots -F "volume-id=%AWS_VOLUME%" -F "status=completed"|find /I "Daily Snapshot"|sort /R /+49>%AWS_HOME%\snapshots.txt