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
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 / rsync
Last active September 10, 2022 04:18
rsync examples
## sync a remote directory on a server S1 to a local directory L2 (i.e. copy S1 into L2)
rsync -avh user@192.168.0.1:/S1 /L2
## sync files from a remote directory on a server S1 to a local directory L2 (i.e. copy S1 contents into local L2)
rsync -avh user@192.168.0.1:/S1/ /L2
## sync a local directory L1 to a remote directory /S2 (i.e. copy L1 into remote S2)
rsync -avh ./L1 user@192.168.0.1:/S2
## sync files from a local directory L1 to a remote directory /S2 (i.e. copy L1 and its contents into remote S2)
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 / rocks_roll_server_apache_config.md
Last active April 18, 2022 12:23
rocks roll server apache config

At the very beginning of installation of rocks-7.0, we must define a roll server. It's recommended to set up a local server to facilitate roll addition. There are some scripts to make this easy for non experts here. After doing steps 0, I and II, change your site configuration file (e.g /etc/apache2/sites-enabled/000-default.conf in ubuntu or mint) to be like this:

## Definitions for rocks-7-0.my.org (change according to your one)
###
<VirtualHost *:80>
ServerName rocks-7-0.my.org
</VirtualHost>

# allow all access to the rolls RPMS
@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: