Skip to content

Instantly share code, notes, and snippets.

View kimrojas's full-sized avatar

Kurt Irvin Rojas kimrojas

View GitHub Profile
@kimrojas
kimrojas / run_python_script_in_conda_env.bat
Created March 10, 2021 11:05 — forked from maximlt/run_python_script_in_conda_env.bat
Run a Python script in a conda environment from a batch file
@echo OFF
rem How to run a Python script in a given conda environment from a batch file.
rem It doesn't require:
rem - conda to be in the PATH
rem - cmd.exe to be initialized with conda init
rem Define here the path to your conda installation
set CONDAPATH=C:\ProgramData\Miniconda3
rem Define here the name of the environment
@kimrojas
kimrojas / single_machine_slurm_on_ubuntu.md
Created June 2, 2022 02:20 — forked from ckandoth/single_machine_slurm_on_ubuntu.md
Install Slurm 19.05 on a standalone machine running Ubuntu 20.04

Use apt to install the necessary packages:

sudo apt install -y slurm-wlm slurm-wlm-doc

Load file:///usr/share/doc/slurm-wlm/html/configurator.html in a browser (or file://wsl%24/Ubuntu/usr/share/doc/slurm-wlm/html/configurator.html on WSL2), and:

  1. Set your machine's hostname in SlurmctldHost and NodeName.
  2. Set CPUs as appropriate, and optionally Sockets, CoresPerSocket, and ThreadsPerCore. Use command lscpu to find what you have.
  3. Set RealMemory to the number of megabytes you want to allocate to Slurm jobs,
  4. Set StateSaveLocation to /var/spool/slurm-llnl.
  5. Set ProctrackType to linuxproc because processes are less likely to escape Slurm control on a single machine config.
@kimrojas
kimrojas / read_projwfc.py
Created June 2, 2022 07:12
Reading projwfc (Quantum Espresso) output files via PANDAS
import pandas as pd
test_file = 'name_of_test_file.csv'
df = pd.read_csv(test_file, sep='\s+', header=0, usecols=[0,1,2], names=['E (eV)', 'UP', 'DN'] )
@kimrojas
kimrojas / Set up GitHub push with SSH keys.md
Created November 16, 2022 23:18 — forked from xirixiz/Set up GitHub push with SSH keys.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "[email protected]"
@kimrojas
kimrojas / plot-workfunc.py
Created June 22, 2023 07:26 — forked from Ionizing/plot-workfunc.py
A script to plot work function using LOCPOT.
#!/usr/bin/env python3
'''
A script to plot work function using LOCPOT.
Requirement: python3, numpy, matplotlib, ase
Author: @Ionizing
Date: 22:46, Jan 11th, 2021.
CHANGELOG:
- 1:56, Jan 25th, 2021
- Add E-fermi level correction