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 ( | |
"encoding/json" | |
"fmt" | |
) | |
func main() { | |
var err error | |
myJson := []byte(`{"name": "Natan", "age": 27, "hobbies": ["programming", "inline_skatting"], "is_millionaire": false}`) |
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 gcsfs | |
import pyarrow | |
def read_parquet(gs_directory_path, to_pandas=True): | |
""" | |
Reads multiple (partitioned) parquet files from a GS directory | |
e.g. 'gs://<bucket>/<directory>' (without ending /) | |
""" | |
gs = gcsfs.GCSFileSystem() | |
arrow_df = pyarrow.parquet.ParquetDataset(gs_directory_path, filesystem=gs) |
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 fastapi import FastAPI, UploadFile, HTTPException | |
from starlette.requests import Request | |
from streaming_form_data import StreamingFormDataParser | |
from streaming_form_data.targets import FileTarget | |
from tempfile import NamedTemporaryFile | |
import os | |
import shutil |
This is a simple sample script for achieving the resumable upload to Google Drive using Python. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.
In this sample, a PNG file is uploaded with the resumable upload using a single chunk.
Before you use this, please set the variables.
- What we want is to get a Developer Id https://developer.apple.com/developer-id/ to be able to sign the binaries for distribution.
- The company needs to get an Apple Developer Account Membership for macOS for $99/y https://developer.apple.com/programs/enroll/
- Apple needs a A D-U-N-S® Number to register the account, the person doing the registration will need to get in touch with somebody that knows the legal part.
- The registration could take a couple days
- When done, a certificate can be created for signing, you'll need to sync it with Xcode.
- Now the binary can be signed, and the signature can be verified.
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
# capture windows events over JSON | |
# expects to be sent by the NXLOG package | |
# author: Joff Thyer, 2017 | |
input { | |
tcp { | |
port => 3515 | |
codec => json | |
} | |
} |
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
**Only really tested on Ubuntu 16.04** | |
Requirements: | |
* Two Linux systems (one to send traffic, one to receive) | |
* Network connectivity over UDP 4789 | |
Sender Setup | |
* Install daemonlogger (sudo apt install daemonlogger) | |
* Save systemd service config as /etc/systemd/system/[email protected] (replace X.X.X.X with IP of receiver) | |
* Reload systemd (sudo systemctl daemon-reload) |
Reference:
sudo fdisk -l
NewerOlder