Skip to content

Instantly share code, notes, and snippets.

View mindjiver's full-sized avatar
🐒
Working from home

Peter Jönsson mindjiver

🐒
Working from home
View GitHub Profile
@fluential
fluential / haproxy-json-log-format.txt
Created November 30, 2016 15:08
haproxy-json-log-format
log-format: '{"timestamp":%Ts,"frontend_name":"%f","remote_addr":"%ci","bytes_read":%B,"upstream_addr":"%si","backend_name":"%b","retries":%rc,"bytes_uploaded":%U,"upstream_connect_time":"%Tc","session_duration":"%Tt","termination_state":"%ts","srv_queue":%sq,"backend_queue":"%bq","frontend_concurrent_conns":%fc,"backend_concurrent_conns":%bc}'
@cocoalabs
cocoalabs / gist:2fb7dc2199b0d4bf160364b8e557eb66
Created August 15, 2016 21:50
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@chinshr
chinshr / Jenkinsfile
Last active October 24, 2024 17:13
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
anonymous
anonymous / gist:38c503a1046b2002230e
Created December 23, 2014 11:05
khn@zenbook:~$ cat .Xresources
URxvt.perl-ext-common: default,matcher
URxvt.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1
URxvt*font: xft:DejaVu Sans Mono:pixelsize=16:antialias=true:hinting=true
URxvt*boldFont: xft:DejaVu Sans Mono:bold:pixelsize=16:antialias=true:hinting=true
URxvt.scrollBar: false
@smagch
smagch / .dockerignore
Last active November 19, 2022 16:53
AWS: CloudFormation with Elastic Beanstalk, Docker Go web app.
.git
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active December 10, 2024 19:03
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

# install 7-zip, curl and vim
# (Windows 2012 comes with .NET 4.5 out-of-the-box)
# 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 2012 64bits AMIs provided by Amazon (eu-west-1 ami-a1867dd6)
#
# Inject this as user-data of a Windows 2012 AMI, like this (edit the adminPassword to your needs):
#
# <powershell>
# Set-ExecutionPolicy Unrestricted
@hh
hh / CreateUserOrgs.mkd
Created March 17, 2014 09:21
Creating Users / Orgs on EC11
echo postgres://opscode_chef@localhost/opscode_chef > /etc/opscode/DATABASE_URI
cd /opt/opscode/embedded/service/opscode-account
bundle exec ./bin/createobjecttool --object-type user -a http://127.0.0.1:9465 --user-password chris4321 --object-name chris4321  --displayname chris4321 --email [email protected] --firstname Chris --middlename M --lastname McClimans --key-path /tmp/chris4321-key.pem --opscode-private-key /etc/opscode/pivotal.pem --opscode-username pivotal
bundle exec ./bin/createorgtool -t Business -a http://127.0.0.1:9465   --org-name chris4321 --customer-org-fullname chris4321-fullname  --client-key-path /tmp/chris4321-validator.pem --username chris4321 --opscode-username pivotal --opscode-private-key /etc/opscode/pivotal.pem
@nogweii
nogweii / Test.java
Created October 1, 2013 23:39
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to http://stackoverflow.com/questions/11538746/check-for-jce-unlimited-strength-jurisdiction-policy-files
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
System.out.println(maxKeyLen);
} catch (Exception e){
System.out.println("Sad world :(");
# 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