Skip to content

Instantly share code, notes, and snippets.

View Shaunakde's full-sized avatar

Shaunak De Shaunakde

View GitHub Profile
@Shaunakde
Shaunakde / fast-rsync.md
Created November 30, 2020 21:21
Fast rsync from mac to linux

This set of parameters experimentally seems to work the best for macos to linux file transfer. This is ofcourse not secure and is intended for transferring things like machine learning datasets to a workstation from a laptop etc.

Command

rsync -rltv --progress --human-readable --delete -e 'ssh -T -c aes128-gcm@openssh.com -o Compression=no -x'

Explaination

  • r: Recursive. Allow directories to be traversed and copied.
@Shaunakde
Shaunakde / dask_map_blocks_dims.py
Created January 12, 2021 01:34
Dealing with reduced dimensions in Dask `map_blocks`
# A method that adds a diagonal line:
def brighten(chunk):
chunk_out = chunk[0] + np.eye(chunk[0].shape[0])
return chunk_out[None,:5,:5] # The key here is to use None or newaxis
# Make the array
arr = da.from_array(np.zeros((2,100,100)), chunks=(2,10,10))
# Examine the array shape
arr.shape
@Shaunakde
Shaunakde / .screenrc
Created November 22, 2023 16:54
Sane and minimal bottom status line for `screen`
hardstatus alwayslastline "%{b kw}%H %{r}%1` %{w}| %{g}%c %{w}| %{y}%d.%m.%Y %{w}| %{g}%l %{w}| %{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"