Skip to content

Instantly share code, notes, and snippets.

View seancallaway's full-sized avatar

Sean Callaway seancallaway

View GitHub Profile
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
/opt/cni \
@seancallaway
seancallaway / generate_secret_key.py
Created September 30, 2019 01:20
Generate a SECRET_KEY for Django
import random
charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*(-_=+)'
secure_random = random.SystemRandom()
print(''.join(secure_random.sample(charset, 50)))
@seancallaway
seancallaway / install_jenkins.yml
Created March 3, 2018 18:45
Ansible Playbook for Installing Jenkins on Centos 7
---
- hosts: jenkins
roles:
- role: ansiblebit.oracle-java
oracle_java_set_as_default: yes
tasks:
- name: Ensure Jenkins Repository is Installed
yum_repository:
name: jenkins
state: present
@seancallaway
seancallaway / site.conf
Created November 30, 2017 20:09
Nginx HTTPS Virtual Host file
server {
listen 80;
server_name <hostname>;
return 301 https://$server_name$request_uri;
}
server {
listen 443;
server_name <hostname>;
@seancallaway
seancallaway / jar-launcher.desktop
Created May 24, 2017 19:51
Desktop entry for launching JAR files.
# /usr/share/applications/jar-launcher.desktop
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=java -jar %f
Icon=java
Name=jar-launcher
Comment=Launch a jar file
@seancallaway
seancallaway / mergetiff.cs
Created April 30, 2016 13:30
Code For Merging TIFFs in C#
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
private static void MergeTiffs(List<Bitmap> bmps, string filename)
{
// Save first bitmap to memory as TIFF
@seancallaway
seancallaway / convert.py
Created February 4, 2016 17:18
Converts a string into it's hexadecimal representation. Intended for BGP TCP MD5 passwords in BIRD on OpenBSD.
#!/usr/bin/env python
import sys, binascii
y = "your_password";
# If they didn't provide a password on the command-line, use the hard coded one.
if len(sys.argv) > 1:
y = str(sys.argv[1])
server {
listen 80;
listen [::]:80;
root <PATH_TO_DOCUMENT_ROOT>/html;
index index.php index.html index.htm;
server_name www.<DOMAIN_NAME> <DOMAIN_NAME>;
location / {
server {
listen 80 ;
listen [::]:80;
server_name <HOSTNAME>.<DOMAINNAME>;
# Force redirection to secure site
return 301 https://$server_name$request_uri;
}
server {
listen 80;
listen [::]:80;
root <PATH_TO_DOCUMENT_ROOL>/html;
index index.php index.html index.htm;
server_name <HOSTNAME>.<DOMAIN_NAME>;
location / {