Skip to content

Instantly share code, notes, and snippets.

View trepidity's full-sized avatar

Jared Jennings trepidity

View GitHub Profile
@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.
@renso3x
renso3x / Play.js
Last active September 21, 2017 06:57
import moment from 'moment';
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
StyleSheet,
Image,
ImageBackground
} from 'react-native';
//using DotNetOpenAuth and RestSharp
WebServerClient client = new WebServerClient(
new AuthorizationServerDescription
{
TokenEndpoint = new Uri("https://myurl/oauth"),
ProtocolVersion = ProtocolVersion.V20
}, "client", "secret");
var token = client.GetClientAccessToken();
@mixinmax
mixinmax / rsa-encrypt.js
Last active July 24, 2019 02:45
Uses 256-bit AES to encrypt a file which is signed using RSA. The ciphertext, RSA encrypted AES key and the signature are concatenated into a binary file to be used in rsa-decrypt.js
'use strict';
// set up required modules
var fs = require('fs');
var args = require('minimist')(process.argv.slice(2));
// the ursa module is imported to wrap OpenSSL and provide RSA encryption for
// the digital signing aswell as encrypting the symmetric key. URSA cannot do
// symmetric encryption natively, so we need another module for that
var ursa = require('ursa');
@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

@rtfpessoa
rtfpessoa / java-8-ami.md
Last active March 21, 2022 14:46
[Guide] Install Oracle Java (JDK) 8 on Amazon EC2 Ami
@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
@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 \
@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.
#
@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;