Skip to content

Instantly share code, notes, and snippets.

@andrew128
andrew128 / gist:83f1701f6c04b8424ab0a71e97bbaae1
Created March 22, 2019 20:29
CS32 Replacing FileName scripts
#!/bin/bash
x='data/bacon/bacon.sqlite3'
y='/ltmp/awei6/bacon.sqlite3'
for file in ./tests/student/bacon/*.test; do
#echo $file
#sed -i -e "s:${x}:${y}:g" ./tests/student/bacon/pathExistsAbigailToLaurel.test
sed -i '' -e "s:${x}:${y}:g" $file
done
@andrew128
andrew128 / gist:bcc49798e2b1f6f6ec3a3a048f26fe59
Created December 23, 2024 01:22
google colab environment
# Analyze environment
import os
import psutil
import subprocess
import torch
# Check CPU Info
def cpu_info():
cpu_details = subprocess.run(['cat', '/proc/cpuinfo'], stdout=subprocess.PIPE).stdout.decode()
return cpu_details.split("\n\n")[0]