Monthly Archive: August 2019

0

Create many files with random content

Source: https://unix.stackexchange.com/questions/199863/create-many-files-with-random-content   For example, Name size file1.01 2K file2.02 3K file3.03 5K etc.   Strategy – 1 #! /bin/bash for n in {1..1000}; do dd if=/dev/urandom of=file$( printf %03d “$n” ).bin bs=1 count=$(( RANDOM + 1024 )) done  ...

0

snakebite – Python HDFS client

Source: https://snakebite.readthedocs.io/en/latest/client.html Example: >>> from snakebite.client import Client >>> client = Client(“localhost”, 8020, use_trash=False) >>> for x in client.ls([‘/’]): … print x   Warning Many methods return generators, which mean they need to be consumed to execute! Documentation will explicitly...