Skip to content

jstout211/general_code_hints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 

Repository files navigation

general_computing_reminders

Just a reminder for myself on how to do certain things

Pytest

Printout all outputs (-s is important) pytest -s -k TestName

Vim Stuff

https://github.com/jstout211/vim_cmds

TMUX hints:

https://gist.github.com/michaellihs/b6d46fa460fa5e429ea7ee5ff8794b96

Docker / Podman

https://github.com/jstout211/podman_commands
Docker w/ github actions:
https://linuxhit.com/how-to-create-docker-images-with-github-actions/

Datalad

https://github.com/jstout211/datalad_examples

Used for nested looping and getting the x,y index in a matrix

np.unravel_index(tile_idxs, [row_num, col_num])

find all files and replace a specific word (deprecated function) with an alternative. Use git clean / checkout / restore to fix if erroneous changes happen

find /MYGITPROJECT/ -type f | xargs sed -i 's/word1/word2/g'

Checking connectivity issues to a computer

ping IPADDRESS --- if this works and the below says filtered, then there is a network block
sudo nmap -p 22 -Pn --traceroute IPADDRESS

also nslookup is helpful to return the ip address of a named computer
On the local computer --- sudo ufw status -- this may show any local firewall filtering that is occuring

Upload to pypi

Register at pypi and testpypi
Get a token and add to ~/.pypirc

python3 -m build -> Generates the ./dist folder with wheel and tar.gz files Test Repo
twine upload --repository testpypi dist/* --verbose

Sphinx setup (still learning this)

pip install sphinx
pip install sphinxcontrib-napoleon

mkdir docs
cd docs
sphinx-quickstart

Add the following to the conf.py file :

import os, sys
sys.path.insert(0, os.path.abspath('..'))

extensions = ["sphinx.ext.todo", "sphinx.ext.viewcode", "sphinx.ext.autodoc", "sphinx.ext.napoleon"]  

Run

cd ..
sphinx-apidoc -o docs .
sphinx-build -b html ./ ./html

RAID Config Help

sudo smartcl -a /dev/sd#
openSeaChest_*      #This is the seagate utility that can be installed through apt

Setup: https://github.com/nih-megcore/tako_config

Old Server

  cd /opt/MegaRAID/storcli
  sudo storcli show
  sudo strocli /c#/eall/sall show

New Server

cd /opt/MegaRAID/perccli/
sudo ./perccli64 show

Additional info on Seagate drives in Dell server: https://toughtechsite.wordpress.com/2017/12/03/the-case-of-non-certified-physical-drives-causing-warnings-in-dell-openmanage-omsa/
PWDIS fix: https://forums.servethehome.com/index.php?threads/powering-sas-drives.42019/
Kapton Insulating Tape: https://www.mcmaster.com/products/polyimide-tape/masking-tape-for-electronics-8/?s=polyimide-tape

About

Just a reminder for myself on how to do certain things

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published