Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# https://stackoverflow.com/questions/47113813/using-pyarrow-how-do-you-append-to-parquet-file | |
# Create a virtualenv or pipenv with pyarrow installed | |
import pyarrow as pa | |
import pyarrow.parquet as pq | |
def append_to_parquet_table(ii, filepath=None, writer=None): | |
filename = f"/home/user/files/2020-01-09T{ii:02}_00_00Z_PT1H.parquet" | |
print("Merging: {}".format(filename)) | |
table = pq.read_table(filename) |
This file contains hidden or 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
mkdir $HOME/influxdbv2 | |
docker run -p 9999:9999 --name influxdb --restart=unless-stopped -v $HOME/influxdbv2:/root/.influxdbv2 quay.io/influxdb/influxdb:2.0.0-beta --reporting-disabled |
This file contains hidden or 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
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n |
This file contains hidden or 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
wget -r -p -U "Mozilla/5.0 (iPhone; CPU iPhone OS 12_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Mobile/15E148 Safari/604.1" https://www.example.com |
This file contains hidden or 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
convert () { | |
local f=$1 | |
echo "Processing ${f}" | |
local filedate=$( stat -c '%y' ${f} | awk -F"." '{print $1}' | awk -F" " '{printf "%s %s", $1, $2}' | sed 's/:/./g' - ) | |
echo "${filedate}-${f}" | |
cp ${f} "../101MEDIA/${filedate}-${f}" | |
} |
This file contains hidden or 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 time | |
import signal | |
import multiprocessing as mp | |
def worker(id): | |
while True: | |
print("Inside worker {}".format(id)) | |
time.sleep(10) | |
def proc_stop(p_to_stop): |
This file contains hidden or 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
use anyhow::*; | |
use futures::io::{copy, AsyncReadExt, AsyncWriteExt}; | |
use futures::stream::StreamExt; | |
use log::*; | |
use smol::Async; | |
use std::net; | |
const PORT: u16 = 5000; |