Skip to content

Instantly share code, notes, and snippets.

View llbbl's full-sized avatar

Logan Lindquist llbbl

View GitHub Profile
#!/usr/bin/env bash
sudo apt update
sudo apt -y install curl
# Set up PHP 8.0
sudo apt update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
@JonTheNiceGuy
JonTheNiceGuy / create_cert.yml
Last active January 9, 2022 18:31
A simple ansible playbook to create a new self-signed certificate
---
- hosts: localhost
vars:
- dnsname: your.dns.name
- tmppath: "./tmp/"
- crtpath: "{{ tmppath }}{{ dnsname }}.crt"
- pempath: "{{ tmppath }}{{ dnsname }}.pem"
- csrpath: "{{ tmppath }}{{ dnsname }}.csr"
- pfxpath: "{{ tmppath }}{{ dnsname }}.pfx"
- private_key_password: "password"
@andymotta
andymotta / boto3_iam_access_key_rotation.py
Last active November 24, 2021 10:04
Rotate AWS IAM access keys for every Boto profile on host (Compliance)
## Meant to be scheudled on a cron/timer of 90 days (CIS Benchmark)
## The target keys need permissions to rotate themselves
import boto3
from botocore.exceptions import ClientError
import os
from datetime import datetime
import shutil
from ConfigParser import SafeConfigParser
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@adamrunner
adamrunner / gen_cert.sh
Created March 31, 2016 18:26
bash script to generate a self signed certificate for development use
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@samatjain
samatjain / Meetup-past-events.py
Last active January 4, 2022 16:01
Dump all the previous events for a Meetup.com group. See http://blog.samat.org/2015/10/23/Getting-All-Past-Meetup-Events/
#!/usr/bin/env python3
import collections
import datetime
import pprint
import click
import jinja2
import requests
@anvaka
anvaka / 00.Intro.md
Last active May 28, 2024 17:41
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
# Before Script
before_script:
- composer self-update
- composer install --prefer-dist > /dev/null
- cp .env.example .env
- php artisan key:generate
- php artisan migrate:refresh
# Services
services:
@CatEntangler
CatEntangler / copy_db.sh
Last active August 29, 2015 14:19
Copy Live mysql DB To Dev mysql DB
#!/bin/bash
# Simple script to copy a MySQL to another
# Parent backup directory
backup_parent_dir="/path/to/tmp/backup/dir" #notice no ending slash
# MySQL settings
mysql_user="elevateduser"
mysql_password="elevateduserpassword"
@sarciszewski
sarciszewski / README.md
Last active February 16, 2016 22:49
PRNG Benchmarks

In response to some people claiming that using a CSPRNG is "going way overboard" and/or is "overkill", I've written this test to verify the performance impact of using a CSPRNG versus their insecure mt_rand() based hacks.

I think the results are conclusive (at least on my device): A 50% speed increase. In addition to less-predictable randomness.

If anyone would like to suggest a benchmark script (or conditions that lead to different results with mine), let me know and I will link to them here.