Skip to content

Instantly share code, notes, and snippets.

View nicor88's full-sized avatar
:octocat:

nicor88 nicor88

:octocat:
  • Berlin, Germany
View GitHub Profile
@amatthies
amatthies / boto3_profiles.md
Last active September 25, 2018 02:26
Handling multiple aws profiles and roles on my local machine

Handling multiple aws profiles and roles on my local machine

I have pretty some aws profiles. And each of those profiles can assume pretty some IAM roles. I write code for instance roles: I trip, when I see aws_access_key_id = in code. ("No! No! No!")

When I started writing aws stuff, I added profile= arguments to all my boto3 constructors... until the roles started to be crucial. In fact, on several AWS accounts I can be several users, who can assume several roles.

Long story short: meanwhile, I handle all profile and (most of the) region stuff locally before coding, not in the code. For an EC2 instance, the needed credentials are "just there" – I want the same on my local machine.

My ~/.aws folder contains two files, credentials and config:

@DrewML
DrewML / Theming-Slack-OSX.md
Last active January 25, 2022 00:53
Theming Slack for OSX

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

How to (OSX Only)

@robertpainsi
robertpainsi / README.md
Last active July 24, 2025 16:14
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
We can't make this file beautiful and searchable because it's too large.
Ort;Plz;Bundesland
Aach;54298;Rheinland-Pfalz
Aach;78267;Baden-Württemberg
Aachen;52062;Nordrhein-Westfalen
Aachen;52064;Nordrhein-Westfalen
Aachen;52066;Nordrhein-Westfalen
Aachen;52068;Nordrhein-Westfalen
Aachen;52070;Nordrhein-Westfalen
Aachen;52072;Nordrhein-Westfalen
Aachen;52074;Nordrhein-Westfalen
@mojodna
mojodna / 0_register_planet.sql
Last active May 18, 2022 17:51
Sample OSM Athena queries
--
-- This will register the "planet" table within your AWS account
--
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,
@adamhaney
adamhaney / dag.py
Created June 14, 2017 18:10
DBT Airflow DAG with model/graph introspection
from datetime import datetime, timedelta
import networkx as nx
from airflow import DAG
from airflow.operators import BashOperator, SubDagOperator
start_date = datetime(year=2017, month=6, day=13, hour=19, minute=0)
schedule_interval = '0 * * * 1-5'
default_args = {
kubectl get pods -a | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@shotahorii
shotahorii / 20171104_2.md
Last active March 26, 2025 15:19
(un)pivot on Presto

Pivot

Query
SELECT
  uid,
  kv['c1'] AS c1,
  kv['c2'] AS c2,
  kv['c3'] AS c3
FROM (
@tossmilestone
tossmilestone / Flake8.txt
Created March 30, 2018 06:55
Flake8 integrated with PyCharm
How to manually setup flake8 as PyCharm external tool
File / Settings / Tools / External Tools / Add
Name: Flake8
Program: $PyInterpreterDirectory$/python
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$
Working directory: $ProjectFileDir$
Output Filters / Add
Name: Filter 1
@Lowess
Lowess / DatabricksPushgatewayExporter.py
Last active December 13, 2024 07:21
Databricks Prometheus Integration
import os
import threading
import urllib.request
import logging
from time import sleep
__author__ = "Florian Dambrine <[email protected]>"
class DatabricksPushgatewayExporter:
"""