Skip to content

Instantly share code, notes, and snippets.

View egidijus's full-sized avatar
🏠
Working from home

Egidijus Ligeika egidijus

🏠
Working from home
View GitHub Profile
@egidijus
egidijus / get-role-token
Last active January 12, 2017 14:55 — forked from cmerrick/get-role-token
Prints the exports required to install an AWS Role's temporary keys to stdout
#!/usr/bin/env python
import socket
import json
import sys
import os
import re
from subprocess import Popen, PIPE
from pprint import pprint
@egidijus
egidijus / gotoke.py
Created October 23, 2015 12:28
google authenticator python script. prints your one time auth code to stdout
#!/usr/bin/python
import onetimepass as otp
my_secret = 'YOURGOOGLEAUTHSECRET'
my_token = otp.get_totp(my_secret)
print(my_token)

Keybase proof

I hereby claim:

  • I am egidijus on github.
  • I am egidijus (https://keybase.io/egidijus) on keybase.
  • I have a public key whose fingerprint is 3609 557E F8AD 4A22 75D9 E4A3 D0AE 6F0C D29A C6DD

To claim this, I am signing this object:

@egidijus
egidijus / ssl-cert-info.sh
Created July 18, 2017 11:48
Shell script to check SSL certificate info like expiration date and subject. Taken from http://giantdorks.org/alain/shell-script-to-check-ssl-certificate-info-like-expiration-date-and-subject/
#!/bin/bash
usage()
{
cat <<EOF
Usage: $(basename $0) [options]
This shell script is a simple wrapper around the openssl binary. It uses
s_client to get certificate information from remote hosts, or x509 for local
certificate files. It can parse out some of the openssl output or just dump all
@egidijus
egidijus / guest2skel.sh
Created January 18, 2018 16:32
snapshot guest user account in to a skeleton on ubuntu 16.04
#!/bin/bash
# Version: 1.1.0
# Date: 19/03/2016
# Origin: http://cascaval.com
#
# UBUNTU 16.04
# Start a guest session and customize it as you like, then switch users to the main/admin user, and run this script.
# The next time you login in to a "fresh" guest, the guest account will be setup from the skeleton.
@egidijus
egidijus / decrypt.sh
Created September 9, 2018 10:07 — forked from PaulMaddox/decrypt.sh
LUKS encrypted image file
#!/bin/bash
FILENAME="private.img";
FILESIZE="100M";
# Create encrypted volume if it doesn't exist
if [ ! -f $FILENAME ]; then
echo "Creating image file...";
dd if=/dev/zero of=$FILENAME bs=$FILESIZE count=0 seek=1
@egidijus
egidijus / golang_onboarding.md
Last active October 2, 2018 10:42
how to start with golang

golang installation linux

download

wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.11.linux-amd64.tar.gz
mkdir ~/go

set paths

add these paths to your bash/zsh profile

@egidijus
egidijus / create_fake_elasticsearch_indexes_and_data.py
Last active May 3, 2019 09:49
Use this script to generate some indexes and documents in your elasticsearch cluster, with some rules. I use this to "fake" log message documents.
#!/bin/env python
from elasticsearch import Elasticsearch as es
from datetime import datetime, timedelta
import random, sys, uuid
es = es("http://localhost:9200")
"""
create some sample data, so we can use the cleaner to test the cleaning
"""
@egidijus
egidijus / test_dags.py
Created May 25, 2019 12:16 — forked from criccomini/test_dags.py
test_dags.py
import os
import unittest
from airflow.models import DagBag
class TestDags(unittest.TestCase):
"""
Generic tests that all DAGs in the repository should be able to pass.
"""
@egidijus
egidijus / run-tests.sh
Created May 25, 2019 12:17 — forked from criccomini/run-tests.sh
run-tests.sh
#!/bin/bash
# Runs airflow-dags tests.
# Set Nose defaults if no arguments are passed from CLI.
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NOSE_ARGS=$@
if [ -z "$NOSE_ARGS" ]; then
NOSE_ARGS=" \
--with-coverage \