Skip to content

Instantly share code, notes, and snippets.

View pgaref's full-sized avatar

Panagiotis Garefalakis pgaref

View GitHub Profile

Spark HWC integration - HDP 3 Secure cluster

Prerequisites :

  • Kerberized Cluster

  • Enable hive interactive server in hive

  • Get following details from hive for spark or try this HWC Quick Test Script

@pgaref
pgaref / profile.sh
Last active October 22, 2019 16:01
###############################
### ENVIRONMENTAL VARIABLES ###
###############################
# HomeBrew PATH
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
# Jenv
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
@pgaref
pgaref / bash_profile.sh
Last active October 22, 2019 15:56
Custom bash profile for MacOS
##################
### ALIASES ###
##################
# git command autocompletion script
source ~/.git-completion.bash
source ~/.git-prompt.sh
source ~/.profile
# git commamands simplified
@pgaref
pgaref / backup_production.sh
Created May 24, 2016 10:17
Simple bash script to backup mongo production DBs to Amazon S3 and update development replica every Monday
#!/bin/bash
DIRNAME="/backups/production"
DOW=`eval date +%A`
REPLICANAME="production_replica"
declare -a DBNAMES=("example_v1_0" "example_v2_0" "example_v3_0" example_v4_0)
for DBN in "${DBNAMES[@]}"
do
@pgaref
pgaref / gist:8cd6a69060e786a09dc2d1d4af06185f
Created May 6, 2016 09:50
Daily logrotate for a supervisor job
# Path is: /etc/logrotate.d/my_job
/var/log/supervisor/my_job.log{
daily
missingok
rotate 1
compress
delaycompress
notifempty
create 0755 datateam adm
@pgaref
pgaref / gist:737700e0c576c02c7b73ac0893eabb36
Last active April 12, 2016 15:26
Downgrade ubuntu from 14.10 to 14.04 LTS
**/etc/apt/preferences.d/trusty-preferences**
Package: *
Pin: release a=trusty
Pin-Priority: 1010
Package: *
Pin: release a=trusty-updates
Pin-Priority: 1011
getent passwd | cut -d : -f 1 | xargs groups
| grep sudo
| grep root
You also have to check: /etc/sudoers
@pgaref
pgaref / gist:869a33e89e224ba17d83
Last active January 6, 2016 22:46
eth0 Static IP - ubuntu 14.04
1) Setting "managed=false" to "managed=true" in the file: /etc/NetworkManager/NetworkManager.conf
2) /etc/network/interfaces (Can find defaults using nm-tool)
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.108
netmask 255.255.255.0
network 192.168.1.0
@pgaref
pgaref / gist:4ac9a693965fcdc961f9
Created January 6, 2016 15:44
Ubuntu expired apt-get keys FIX
#To find any expired repository keys and their IDs, use apt-key as follows:
apt-key list | grep expired
#You will get a result similar to the following:
pub 4096R/BE1DB1F1 2011-03-29 [expired: 2014-03-28]
#The key ID is the bit after the / i.e. BE1DB1F1 in this case.
#To update the key, run
awk '{print $7}' access.log | # Split by whitespace, 7th field is request path
sort | # Make occurrences of the same URL appear consecutively in file
uniq -c | # Replace consecutive occurrences of the same URL with a count
sort -rn | # Sort by number of occurrences, descending
head -n 5 # Output top 5 URLs