Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
@threez
threez / update_keystore_ldap.sh
Created March 3, 2014 10:20
Extract and update a ldap certificate in a java keystore (jenkins)
#!/bin/bash
LDAP_SERVER=example.com:636
ALIAS=LDAP_SERVER
KEYSTORE=/usr/lib/jvm/java-1.6.0-openjdk-amd64/jre/lib/security/cacerts
PASSWD=changeit
# grep the certificate
echo -n | openssl s_client -connect $LDAP_SERVER | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ldaps.crt
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@timhwang21
timhwang21 / gist:e6a2b24e064182dd9099ad00e4f4f9a6
Created March 19, 2022 03:50 — forked from bluechoochoo/gist:a034da52c64ac6fcb637
text transcription of Stanley Druckenmiller talk at Lost Tree Club, including Q&A w/Ken Langone
Last week the transcript of a talk Stanley Druckenmiller gave went a little viral on #financetwitter.
(http://covestreetcapital.com/Blog/wp-content/uploads/2015/03/Druckenmiller-_Speech.pdf)
Only problem- it's been traveling around in the form of an image PDF,
making it hard to cut + paste or search for your favorite quotes.
So I ran it through a couple programs, and bleepblorp, a text transcript is below.
If you want *just the text,* and not this surrounding web page, click "Raw" in the corner above.
@sumardi
sumardi / nginx.default.conf
Last active November 3, 2023 18:49
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@chsh
chsh / orders_controller_spec.rb
Created April 30, 2013 13:35
RSpec controller example
require 'spec_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
@rtfpessoa
rtfpessoa / java-8-ami.md
Last active March 21, 2022 14:46
[Guide] Install Oracle Java (JDK) 8 on Amazon EC2 Ami
@nateware
nateware / nginx.conf
Last active November 23, 2021 10:54
Nginx sample config for EC2
#
# Sample nginx.conf optimized for EC2 c1.medium to xlarge instances.
# Also look at the haproxy.conf file for how the backend is balanced.
#
user "nginx" "nginx";
worker_processes 10;
error_log /var/log/nginx_error.log info;
@jareware
jareware / s3-curl-backups.md
Last active August 29, 2021 00:56
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@craigmdennis
craigmdennis / spinSubmit.js
Created December 7, 2011 16:02
Add a loading animation to a submit <button> or <a> before submitting a form
/**
Requires:
Spin.js (http://fgnass.github.com/spin.js/)
Spin.js jQuery plugin (https://gist.github.com/1290439)
Usage: $(#your-id).spinSubmit();
For best results, change the 'small' to - small:{lines:12,length:3,width:2,radius:4} in the jQuery plugin