Skip to content

Instantly share code, notes, and snippets.

View apiri's full-sized avatar
😲
😱

Aldrin Piri apiri

😲
😱
View GitHub Profile
@apiri
apiri / add_epel.sh
Last active August 29, 2015 14:04
CentOS 6.x EPEL Install
#!/bin/bash
echo Installing EPEL Repository
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6*.rpm
sudo yum update
@apiri
apiri / docker_group.sh
Created October 17, 2014 00:03
Add user to docker group to avoid sudo
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo {service,systemctl} docker restart
# User logout/login needed for group to apply
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>
@apiri
apiri / verify-apache-nifi-release.sh
Last active March 26, 2016 16:21
Provides an automated means for getting the information necessary for carrying out the verification of an Apache NiFi release
#!/bin/bash -e
# Adapted from the guidance provided at http://nifi.apache.org/development/release-guide.html
repository=orgapachenifi-1079
version=0.6.0
base_url=https://repository.apache.org/service/local/repositories/${repository}/content/org/apache/nifi/nifi/${version}
release_file=nifi-${version}-source-release.zip
release_git_commit_hash=0b9bd20d31d7f805300254da768d91b973480151
@apiri
apiri / jdk_download.sh
Created February 16, 2016 05:08 — forked from P7h/jdk_download.sh
Script to download JDK / JRE / Java binaries from Oracle website from terminal / shell / command line / command prompt
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget.
### You can download all the binaries one-shot by just giving the BASE_URL.
### Script might be useful if you need Oracle JDK on Amazon EC2 env.
### Script is updated for every JDK release.
### Features:-
# 1. Resumes a broken / interrupted [previous] download, if any.
# 2. Renames the file to a proper name with including platform info.
@apiri
apiri / docker_sftp.sh
Created February 17, 2016 15:08
Start a docker container to evaluate SFTP using a cert
#!/bin/sh
docker run \
-v $(greadlink -f ~/.ssh/id_rsa.pub):/home/foo/.ssh/keys/id_rsa.pub:ro \
-v /tmp/temp_sftp_share:/home/foo/share \
--name sftp
@apiri
apiri / disable_controller_service.sh
Created April 11, 2016 21:15
Apache NiFi: Snippet to stop/disable a controller service's references and then disable the controller service a la curl
#!/bin/sh -e
# Requires jq
base_api_url=http://localhost:8080/nifi-api/controller
cs_uid=934ca9d6-9885-4a40-a347-911d42d00a8f
# Handle CS references by stopping and then disabling
curl -X PUT \
-d "version=$(curl -s ${base_api_url}/revision | jq .revision.version)" \
@apiri
apiri / nginx_modsite
Created May 12, 2016 00:11
Wrapper script that performs analogous functionality to a2ensite/a2dissite
#!/bin/bash
##
# Originally from: http://serverfault.com/a/562210
#
# File:
# nginx_modsite
# Description:
# Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories:
@apiri
apiri / Select_and_Count_JSON_Array.xml
Created May 13, 2016 01:00
Generates a sample JSON flowfile which then has: 1) An array of values extracted to an attribute 2) Using the 'Advanced' menu of UpdateAttributes, determines if the result IDs are non-empty and then performs a count using allDelinatedValues to create an id.count attribute with the count of records, otherwise sets id.count to 0 3) Logs the associ…
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><template><description>Generates a sample JSON flowfile which then has: 1) An array of values extracted to an attribute
2) Using the 'Advanced' menu of UpdateAttributes, determines if the result IDs are non-empty and then performs a count using allDelinatedValues to create an id.count attribute with the count of records, otherwise sets id.count to 0
3) Logs the associated variables for convenience</description><name>Select and Count JSON Array</name><snippet><processGroups><id>12bd754b-fddc-4580-bee6-45031fe5a464</id><parentGroupId>0b2d2e0f-8169-43d4-ad17-3a4f5bd90370</parentGroupId><position><x>2977.214817733394</x><y>791.6384429684335</y></position><activeRemotePortCount>0</activeRemotePortCount><comments></comments><contents><connections><id>2036f074-9464-4c92-bb8d-3f3f4f3e00c3</id><parentGroupId>12bd754b-fddc-4580-bee6-45031fe5a464</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPre
@apiri
apiri / keybase.md
Created July 19, 2016 20:34
Keybase GitHub verification

Keybase proof

I hereby claim:

  • I am apiri on github.
  • I am aldrin (https://keybase.io/aldrin) on keybase.
  • I have a public key whose fingerprint is 200D BBC8 8E11 000D E8E7 739A 531A EBAA 4CFE 5D00

To claim this, I am signing this object: