This content has moved.
Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/miekg/dns" | |
) | |
// adapted from https://gist.github.com/walm/0d67b4fb2d5daf3edd4fad3e13b162cb |
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
import sys | |
import time | |
import dateparser | |
import pytz | |
import json | |
import csv | |
from datetime import datetime | |
from binance.client import Client |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# This script to install Kubernetes will get executed after we have provisioned the box | |
$script = <<-SCRIPT | |
# Install kubernetes | |
apt-get update && apt-get install -y apt-transport-https | |
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - | |
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list |
This content has moved.
Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!
To give false DNS responses from userland we need to handle different type of syscalls : gethostbyname()
, gethostbyname2()
, getaddrinfo()
, getnameinfo()
, etc.
To cover all these cases, and to prevent leaks to real dns servers, we will use two libraries : libresolv_wrapper and libnss_wrapper.
Install resolv_wrapper and nss_wrapper, either from sources or from your favorite Linux distribution.
# uses the date_to_milliseconds and interval_to_milliseconds functions | |
# https://gist.github.com/sammchardy/3547cfab1faf78e385b3fcb83ad86395 | |
# https://gist.github.com/sammchardy/fcbb2b836d1f694f39bddd569d1c16fe | |
from binance.client import Client | |
import time | |
def get_historical_klines(symbol, interval, start_str, end_str=None): | |
"""Get Historical Klines from Binance |
# https://www.quantopian.com/posts/technical-analysis-indicators-without-talib-code | |
import numpy | |
import pandas as pd | |
import math as m | |
#Moving Average | |
def MA(df, n): | |
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n)) | |
df = df.join(MA) |
This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.
While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.
Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).
docker run -it --rm --privileged --pid=host justincormack/nsenter1
more info: https://github.com/justincormack/nsenter1