Skip to content

Instantly share code, notes, and snippets.

View cr3a7ure's full-sized avatar

Goutis Dimitrios cr3a7ure

View GitHub Profile
#!/bin/bash
#Heith Seewald 2012
#Garoe Dorta 2015
#Feel free to extend/modify to meet your needs.
#Maya on Ubuntu v.1
#This is the base installer... I’ll add more features in later versions.
#if you have any issues, feel free email me at heiths@gmail.com
#### Lets run a few checks to make sure things work as expected.
#Make sure we’re running with root permissions.
@cr3a7ure
cr3a7ure / create-folder.py
Created January 8, 2019 12:08 — forked from keithweaver/create-folder.py
Create a folder with Python
import os
def createFolder(directory):
try:
if not os.path.exists(directory):
os.makedirs(directory)
except OSError:
print ('Error: Creating directory. ' + directory)
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)
@cr3a7ure
cr3a7ure / syncm.sh
Created July 15, 2019 13:45 — forked from cwsaylor/syncm.sh
Merge master into current branch
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git checkout master
git fetch
git merge origin/master
git checkout ${CURRENT}
git merge master ${CURRENT}
@cr3a7ure
cr3a7ure / geckodriver-install.sh
Created October 4, 2019 11:44 — forked from cgoldberg/geckodriver-install.sh
download and install latest geckodriver for linux or mac (selenium webdriver)
#!/bin/bash
# download and install latest geckodriver for linux or mac.
# required for selenium to drive a firefox browser.
install_dir="/usr/local/bin"
json=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest)
if [[ $(uname) == "Darwin" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("macos"))')
elif [[ $(uname) == "Linux" ]]; then
url=$(echo "$json" | jq -r '.assets[].browser_download_url | select(contains("linux64"))')
@cr3a7ure
cr3a7ure / .screenrc
Created April 30, 2020 20:25 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@cr3a7ure
cr3a7ure / slack.py
Created December 4, 2020 18:47 — forked from boxysean/slack.py
PythonSlackOperator -- how I've integrated notifications into my PythonOperators
# airflow/plugins/slack.py
import logging
from airflow.operators.python_operator import PythonOperator
from airflow.plugins_manager import AirflowPlugin
from slackclient import SlackClient
from titan.utils import config
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.contrib.operators.spark_submit_operator import SparkSubmitOperator
from datetime import datetime, timedelta
###############################################
# Parameters
###############################################
spark_master = "spark://spark:7077"
import airflowlib.emr_lib as emr
import os
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime, timedelta
default_args = {
'owner': 'airflow',
'depends_on_past': False,