Skip to content

Instantly share code, notes, and snippets.

View pnsinha's full-sized avatar

P. Sinha pnsinha

View GitHub Profile
#!/bin/bash
# Variables
USERNAME="pnsinha"
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC9p/5ob6qOD55c+DdYTVDLpanxoCULNJAaNZIr1rNv9bdw7yaq1Ow3TbYrLmcV0ZVKnCQM/ZRa//tM/ybx7zbFQkh8aKwZog0f84+ImeqNoO5NfodoiGbQMEv+OKxXo4UaXO3lJIVIe1z5brBatxSOuTHM0oIeWowUKPURX5oCYmeekivseWFHJ+DGB+cmlmtntR8G1pXrMFv7+T+j3H8F+PI6RREZvftUj9eZiGKstFIGuSRzkCkqwWBXzwBrl8FZgZ/a0eA2V59PHt0C3XOMYGfBXBrKinV79Poc9Sddn8sodnoO8t46CjROR58+ADGSZRXjtH+84Hk3oXYzbXCZ parma@DESKTOP-UCGIS"
# Create a new user
echo "Creating user $USERNAME..."
sudo useradd -m -s /bin/bash "$USERNAME"
@pnsinha
pnsinha / error_a100.txt
Last active January 23, 2025 22:02
alphafold3_beagle3_error
python /software/alphafold3.0-el8-x86_64/alphafold3/run_alphafold_test.py \
--db_dir /software/alphafold3.0-el8-x86_64/databases \
--output_dir /scratch/midway3/$USER/alphafold3_output \
--model_dir /software/alphafold3.0-el8-x86_64/params \
--run_data_pipeline \
--run_inference
@pnsinha
pnsinha / XDG.md
Last active November 13, 2024 14:57
XDG Base Directory Specification

Overview of the XDG Base Directory Specification

The XDG Base Directory Specification provides guidelines for where applications should look for configuration files, data files, and cache files in a user's environment. This specification aims to improve the organization of user files and reduce clutter in the user's home directory.

  1. Base Directories: The specification defines several base directories that applications should use:
    • $XDG_CONFIG_HOME: This is the directory where user-specific configuration files should be stored. If this variable is not set, the default is ~/.config.
    • $XDG_DATA_HOME: This directory is for user-specific data files, defaulting to ~/.local/share if not set.
    • $XDG_CACHE_HOME: This is where user-specific non-essential data files (cache) should be stored, defaulting to ~/.cache.
  • $XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or empty, a def
Tool Name Description Key Features Use Cases
scp A command-line tool for securely copying files between hosts using
#!/usr/bin/expect -f
# Set timeout for the script
set timeout 60
# Define variables for the second server
set my_server "midway3.rcc.uchicago.edu"
set my_username "pnsinha"
set my_password "your_password_here" ;
Variable Default Value
%SystemDrive% C:
%ProgramFiles% C:\Program Files
%AppData% C:\Users{username}\AppData\Roaming
%LocalAppData% C:\Users{username}\AppData\Local
%UserProfile% C:\Users{username}
%UserName% {username}
%COMPUTERNAME% {computername}
%PATH% C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;{plus program paths}
@pnsinha
pnsinha / missing_shared_lib
Created July 3, 2024 06:27
find missing shared libraries
ldd /software/R-4.2.1-el8-x86_64/lib64/R/library/*/libs/*.so \
| egrep '(so:$|not found)' > ~/R-4.2.1-el8-x86_64/
%runscript
exec R "${@}"
%post
export TZ="America/Chicago"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
dnf makecache --refresh
dnf install -y tzdata gnupg2 glibc-langpack-en
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh
@pnsinha
pnsinha / mvRsync.sh
Last active February 21, 2024 21:54
rsync Permissions
#https://unix.stackexchange.com/questions/43957/using-rsync-to-move-not-copy-files-between-directories
#!/usr/bin/bash
echo -e "Would you like to use a relative path to your source?[y/n?]\n"
read ans
if [[ $ans == y ]]; then
echo -e "Relative source?\n"
read source
source="`pwd`/$source"