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 logging | |
import os | |
import signal | |
import threading | |
import time | |
from pathlib import Path | |
from typing import Callable | |
DEFAULT_LOCK_TIMEOUT_SEC = 60 |
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 json | |
from http_client import http_client | |
_JSON_CONTENT_HEADERS = {'Content-Type': 'application/json'} | |
_HOSTNAME = 'my.host.com' | |
class my_client(http_client): | |
def __init__(self): |
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
set background=dark | |
syntax enable | |
" show line numbers | |
set number | |
" highlight cursor line | |
set cursorline | |
" searchi |
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
from collections import defaultdict | |
from typing import List | |
class DGraph: | |
def __init__(self): | |
self._nodes = set() # using a set to easily avoid duplications | |
self._edges = defaultdict(list) | |
self._reverse_edges = defaultdict(list) |
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
<!-- | |
put in /Library/LaunchDaemons/limit.maxfiles.plist | |
make sure the file is owned by 'root' | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> |
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
package main | |
import ( | |
"bufio" | |
"net" | |
"os" | |
) | |
import "fmt" | |
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
#!/usr/bin/env bash | |
# remove exited/created containers | |
docker rm -vf $(docker ps -aqf status=exited -f status=created) | |
# remove untagged images | |
docker rmi $(docker images -qf dangling=true) | |
# remove unreferenced volumes - careful with that | |
docker volume rm $(docker volume ls | awk '{print $2}') |
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 java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.UUID; | |
public class GuidV5 { | |
public static UUID nameUUIDFrom(String name) throws UnsupportedEncodingException, NoSuchAlgorithmException { | |
MessageDigest sha1 = MessageDigest.getInstance("SHA-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
import io.netty.bootstrap.ServerBootstrap | |
import io.netty.buffer.Unpooled | |
import io.netty.channel._ | |
import io.netty.channel.nio.NioEventLoopGroup | |
import io.netty.channel.socket.SocketChannel | |
import io.netty.channel.socket.nio.NioServerSocketChannel | |
import io.netty.handler.codec.http._ | |
import io.netty.handler.logging.{LogLevel, LoggingHandler} | |
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor} |
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
#!/bin/sh | |
BASEDIR=`pwd` | |
# Set env | |
OPENGROK_FILENAME=opengrok-0.12.1 | |
OPENGROK_ARCH_FILENAME=$OPENGROK_FILENAME.tar.gz | |
OPENGROK_ARCH_URL=https://java.net/downloads/opengrok/$OPENGROK_ARCH_FILENAME |
NewerOlder