Skip to content

Instantly share code, notes, and snippets.

# This is my first, very own configuration file for yamllint!
# It extends the default conf by adjusting some options.
extends: default
rules:
comments-indentation: disable # don't bother me with this rule
indentation: disable # don't bother me with this rule
line-length:
max: 120
@smhr
smhr / sha256sum.sh
Created June 26, 2023 11:45
Create sha256sum for all files in a folder.
find snap_*.hdf5 -type f -exec sha256sum {} > ~/checksums_TNG50-2_snaps.txt \;
@smhr
smhr / numba_test.ipynb
Created March 1, 2023 16:52
Test Numba
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smhr
smhr / md_to_ipynb.sh
Last active March 1, 2023 03:04
Convert all markdown files to ipynb notebook using jupytext
jupytext --set-formats ipynb,md --sync ./first_test.ipynb ## sync a notebook with md
jupytext --to ipynb first_test.md ## make notebook from md
find . -type f -name "*.md" | xargs jupytext --to ipynb ## find all md files in the current dir and make their notebooks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smhr
smhr / sinkvis.sh
Created June 26, 2022 14:30
Example for sinkvis
# python ~/codes/SinkVis/SinkVis.py ./output/snapshot*.hdf5 --np=7 --keep_only_movie --movie_name=test --plot_B_map --plot_fresco_stars --outputfolder=movie --draw_axes
python ~/codes/SinkVis/SinkVis.py ./output/snapshot*.hdf5 --np=6 --movie_name=test --outputfolder=movie --draw_axes
@smhr
smhr / SKA_training.sh
Created January 28, 2022 04:43
SKA_training vagrant
#============= some useful links:
# From official site:
https://learn.hashicorp.com/tutorials/vagrant/getting-started-boxes?in=vagrant/getting-started
# Oracle guide
https://oracle-base.com/articles/vm/vagrant-a-beginners-guide
# Download vbox file:
wget -c https://app.vagrantup.com/ska-training/boxes/containers/versions/1.0.0/providers/virtualbox.box
# Download and add the box:
@smhr
smhr / skyroom_user_file_generator.py
Created January 18, 2022 18:56
A simple python3 code to generate Skyroom user file.
#!/usr/bin/env python
# coding: utf-8
import csv
def user_name(s):
'''Read the complete name and return the username'''
# split the string into a list
l = s.split()
sha256sum -c checksums.txt &> check.log &
## then to find bad files:
cat check.log | grep FA | awk -F. '{print $2}' > FAILED_CHECKSUM
# inpot: snap_099.92.hdf5: FAILED
# output: 92
# then run (for TNG100-1)
@smhr
smhr / TNG_extracting_data_example.ipynb
Created September 23, 2021 17:16
TNG_extracting_data_example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.