This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_kafka_device() { | |
for device in $(nvme list | grep ^/dev | awk '{print $1}') | |
do | |
local found_device="$(nvme id-ctrl -v $device | grep -Po '/dev/[a-z0-9]+' || true)" | |
if [[ -n "$found_device" ]]; then | |
echo "$device" | |
return 0 | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
int main(int argc, char **argv) | |
{ | |
if (argc < 2) { | |
printf("Provide the host to be resolved\n"); | |
return 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'pathname' | |
class EnvImporter | |
def initialize(env_file, environment_name, app_name, overwrite = false, | |
number_of_threads = 4) | |
validate_aws_cli | |
@env_file = env_file | |
@environment_name = environment_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- repo: local | |
hooks: | |
- id: poetry_lock | |
name: Check if poetry is updated | |
entry: python -c "from poetry.poetry import Poetry; | |
assert Poetry.create('.').locker.is_fresh(), 'Poetry is not locked'" | |
language: python_venv | |
additional_dependencies: | |
- poetry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CaseInsensitiveDict(dict): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.__map = {} | |
mapping = args[0] if len(args) else {} | |
keys = set() | |
if isinstance(mapping, dict): | |
keys |= mapping.keys() | |
elif isinstance(mapping, (list, tuple)): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.yield_fixture(scope='session') | |
def patch_session(): | |
def commit(): | |
"""Flush and expire caches.""" | |
db.session.flush() | |
db.session.expire_all() | |
old_commit = db.session.commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- spoon.sh.bkp 2017-10-11 11:43:09.000000000 +0200 | |
+++ spoon.sh 2017-10-11 11:52:07.000000000 +0200 | |
@@ -1,5 +1,15 @@ | |
#!/bin/sh | |
+# Hacky way to force java8 | |
+JAVA_VMS_LOCATION="/Library/Java/JavaVirtualMachines" | |
+LATEST_JAVA_8="$(ls $JAVA_VMS_LOCATION | grep jdk1.8 | sort | tail -n 1)" | |
+if [ -z "$LATEST_JAVA_8" ]; then | |
+ echo "Java 8 not found" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate ring; | |
use ring::aead::*; | |
use ring::pbkdf2::*; | |
use ring::rand::SystemRandom; | |
fn main() { | |
// The password will be used to generate a key | |
let password = b"nice password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import signal | |
import sys | |
import time | |
import traceback | |
import threading | |
lock = threading.Lock() | |