Skip to content

Instantly share code, notes, and snippets.

View smhr's full-sized avatar

smhr

View GitHub Profile
@rohitfarmer
rohitfarmer / build-singularity.md
Last active January 18, 2025 07:44
Instructions to build a singularity container with popular data science and chemistry packages, including Tensorflow.

Building a Singularity Container for Machine Learning, Data Science, & Chemistry

Learning Objectives

  1. Build a Linux based Singularity container.
    • First build a writable sandbox with essential elements.
    • Inspect the container.
    • Install additional software.
    • Convert the sandbox to a read-only SquashFS container image.
  2. Install software & packages from multiple sources.
  • Using apt-get package management system.
import requests
import h5py
import yt
print(yt.__version__)
# First download a test halo from the TNG project
baseUrl = 'http://www.tng-project.org/api/'
def get(path, params=None):
# Let networkd manage all devices on this system
network:
version: 2
renderer: networkd
ethernets:
#declare the interface used y the bridge device
enp7s0:
dhcp4: no
dhcp6: no
@udkyo
udkyo / Dockerfile
Last active March 18, 2025 15:40
Basic container for X11 forwarding goodness
FROM ubuntu
RUN apt update \
&& apt install -y firefox \
openssh-server \
xauth \
&& mkdir /var/run/sshd \
&& mkdir /root/.ssh \
&& chmod 700 /root/.ssh \
&& ssh-keygen -A \
&& sed -i "s/^.*PasswordAuthentication.*$/PasswordAuthentication no/" /etc/ssh/sshd_config \
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active April 1, 2025 13:41
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@derick-montague
derick-montague / sync-github-to-bitbucket.md
Last active February 11, 2025 15:56
Sync github repo to bitbucket repo

Set up remotes

setup local repo

mkdir myrepository
cd myrepository
git init

add bitbucket remote as "origin"

@zshaheen
zshaheen / installing-and-running-slurm.md
Last active January 24, 2019 01:38
Installing and running Slurm on greyworm and other clusters

Installing and running Slurm on greyworm and other clusters

This page will specifically detail how to install and run Slurm on the greyworm cluster at LLNL. These instructions can be adapted to work on other clusters with other nodes.

In the current configuration, aims4.llnl.gov is the head, while greyworm[1-8].llnl.gov are the compute nodes. Note: The steps here are for the current configuration of aims4 and greyworm[1-8]. The configuration might change in the future.

A Brief Intro to Slurm

Slurm is a job scheduler used to run jobs on supercomputers and clusters.

@lgarrison
lgarrison / high_performance_python.ipynb
Last active December 12, 2024 08:21
High-Performance Python, or When to Write For Loops in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mangoliou
mangoliou / x11vnc-stack-smashing-detected-solution.mk
Last active June 1, 2023 06:49
x11vnc `stack smashing detected` solution.
# Install x-related to compile x11vnc from source code.
sudo apt-get update
sudo apt-get install -y libxtst-dev libssl-dev libjpeg-dev
# Grep source code.
wget http://x11vnc.sourceforge.net/dev/x11vnc-0.9.14-dev.tar.gz
gzip -dc x11vnc-0.9.14-dev.tar.gz | tar -xvf -
cd x11vnc-0.9.14/
./configure --prefix=/usr/local CFLAGS='-g -O2 -fno-stack-protector -Wall'
@subfuzion
subfuzion / curl.md
Last active March 31, 2025 16:15
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.