Skip to content

Instantly share code, notes, and snippets.

Dario Duvnjak dduvnjak

Block or report user

Report or block dduvnjak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View awssecretscan
#!/bin/bash
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
# --- Safety check
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
@dduvnjak
dduvnjak / .ronquotes.sh
Last active Apr 18, 2018
Ron Swanson quote generator in Bash. Source it in your ~/.bash_profile for a steady supply of wisdom and small government advocacy.
View .ronquotes.sh
#!/usr/bin/env bash
# set the quotes
quotes=$(cat <<-END
"Clear alcohols are for rich women on diets."
"Crying: acceptable at funerals and the Grand Canyon."
"I call this turf ‘n’ turf. It's a 16 oz T-bone and a 24 oz porterhouse. Also, whiskey and a cigar. I am going to consume all of this at the same time because I am a free American."
"Under my tutelage, you will grow from boys to men. From men into gladiators. And from gladiators into Swansons."
"I'm a simple man. I like pretty, dark-haired women, and breakfast food."
"Never half-ass two things. Whole-ass one thing."
@dduvnjak
dduvnjak / add_cloudflare_ips.sh
Created May 25, 2016
Add CloudFlare IP addresses to an EC2 Security Group using awscli
View add_cloudflare_ips.sh
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# iterate over the lines in the downloaded file
# make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4
@dduvnjak
dduvnjak / newrelic.config
Created May 16, 2016
Installs and configures New Relic System Monitoring agent on AWS Elastic Beanstalk instances
View newrelic.config
# installs and configures New Relic System Monitoring agent
#
files:
"/opt/elasticbeanstalk/get-eb-env-name.py":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env python
import boto.utils
@dduvnjak
dduvnjak / pre-commit
Last active Aug 22, 2018 — forked from DmZ/pre-commit
Git pre-commit hook to search for Amazon AWS API keys.
View pre-commit
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=5da2c1fe8f6458e32d11110e0ebdd915e472c6e0
fi
@dduvnjak
dduvnjak / wildfly-install.sh
Last active Dec 2, 2015 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
View wildfly-install.sh
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2015-10-24T17:14-0700
#usage :/bin/bash wildfly-install.sh
#tested-version :10.0.0.CR3
#tested-distros :Debian 7,8; Ubuntu 15.10; CentOS 7; Fedora 22
@dduvnjak
dduvnjak / .ebextensions--01phantom.config
Last active Oct 28, 2017
Elastic Beanstalk configuration file for installing phantomjs globally
View .ebextensions--01phantom.config
files:
"/opt/elasticbeanstalk/nodepath.rb":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env ruby
require 'json'
cc = "/opt/elasticbeanstalk/deploy/configuration/containerconfiguration"
j = JSON.parse(File.read(cc))
@dduvnjak
dduvnjak / apache_mod_jk_win.md
Created Jan 27, 2014
Set up mod_jk with Apache on Windows
View apache_mod_jk_win.md

Download and install Apache from:
http://www.apache.org/dist/httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi

download mod_jk for windows: http://apache.mirrors.pair.com//tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip

extract and put it in the modules folder:
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\modules

Add this to the httpd.conf file (located at C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf)

@dduvnjak
dduvnjak / .rdebugrc
Created Aug 22, 2013
Quick Ruby debug (thanks to @hkraji)
View .rdebugrc
set autolist
set autoeval
set autoreload
set listsize 20
@dduvnjak
dduvnjak / .vimrc
Last active Dec 21, 2015
Vim syntax highlighting and indentation (.vimrc)
View .vimrc
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab
syntax on
set backspace=indent,eol,start
You can’t perform that action at this time.