Skip to content

Instantly share code, notes, and snippets.

View flarco's full-sized avatar
Targeting

Fritz Larco flarco

Targeting
View GitHub Profile
@flarco
flarco / test_http_async.py
Created May 16, 2023 18:11
Python test_http_async.py
import aiohttp, time
import asyncio, requests
async def fetch(session, url):
async with session.get(url) as response:
return url + '>>>> ' + await response.text()
async def main2():
urls = [
'http://python.org',
@flarco
flarco / sling-file-to-database.md
Last active December 13, 2022 11:03
Sling CLI Examples - Loading from a File System into a Database (https://docs.slingdata.io/sling-cli/)

Sling CLI Examples

  • This is to demonstrate the various ways Sling CLI is able to load files from a File System into a Database
  • Compatible file formats include: CSV, TSV, JSON and XML. Parquet to come soon.
  • Compatible File Systems include: AWS S3, Google Cloud Storage, Azure Blob Storage, DigitalOcean Spaces, BackBlaze B2, Cloudflare R2, Wasabi
  • Compatible database systems: MySQL, Clickhouse, BigTable, Postgres, Snowflake, BigQuery, Redshift, SQL Server, Oracle
  • Check here for all connector list
@flarco
flarco / prerelease
Last active May 28, 2020 19:03 — forked from foca/release
Small shell script to create GitHub releases from the command line
#!/usr/bin/env bash
set -e
[ -z "$DEBUG" ] || set -x;
usage() {
echo "$0 <repo> <tag> [<release name>] [-- <asset>...]" >&2;
}
if [ "$1" = "-h" -o "$1" = "--help" ]; then
@flarco
flarco / route-traffic-through-droplet.sh
Created March 21, 2020 10:31
Routing traffic through another droplet (on DigitalOcean.com)
# on router / gateway
# https://serverfault.com/questions/306024/how-to-route-network-traffic-of-a-host-via-another-host
##### ON GATEWAY ##############################
# test IP
curl ifconfig.me
# Enable NAT
echo '
@flarco
flarco / floating-ip-gateway.sh
Created March 19, 2020 20:24 — forked from sparkcodeuk/floating-ip-gateway.sh
Digital Ocean floating IP gateway script (force droplet to use the assigned floating IP for outbound traffic as well as inbound traffic)
#!/bin/bash
# Force outbound traffic through the attached floating IP
NET_INT="eth0"
CURL_TIMEOUT=3
echo -n "Setting floating IP as the default gateway: "
# Check there's a floating IP attached to this droplet
if [ "$(curl -s --connect-timeout $CURL_TIMEOUT http://169.254.169.254/metadata/v1/floating_ip/ipv4/active)" != "true" ]; then
@flarco
flarco / n8n_json_to_csv.json
Created October 10, 2019 00:49
n8n workflows
{
"name": "",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
@flarco
flarco / install.go.sh
Created January 28, 2019 16:31
Install go
TARGET=/usr/local
# download https://golang.org/
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz
sudo tar -C $TARGET -xzf go1.11.5.linux-amd64.tar.gz
export PATH=$PATH:$TARGET/go/bin
nano $HOME/.profile
choco install -y 7zip golang nodejs winscp notepadplusplus.install adobereader pdfsam.install jre8 jdk8 maven firefox vlc git putty kitty curl teamviewer strawberryperl thunderbird awscli awstools.powershell microsoft-build-tools VisualCppBuildTools wireshark conemu cmder sql-server-management-studio youtube-dl ffmpeg azure-cli sublimetext3 greenshot vscode sqlite openvpn jq qbittorrent mingw gradle googleearthpro rufus winpcap pandoc androidstudio git-credential-manager-for-windows telegram.install jenkins dbeaver graphviz whatsapp sudo ant-renamer
import os
data = {
'1MB' : 1*1024*1024, # 1MB
'10MB' : 10*1024*1024, # 10MB
'100MB' : 100*1024*1024, # 100MB
'1GB' : 1*1024*1024*1024, # 1GB
'10GB' : 10*1024*1024*1024, # 10GB
'50GB' : 50*1024*1024*1024, # 50GB
}