Skip to content

Instantly share code, notes, and snippets.

View ZhijieWang's full-sized avatar

Bill (Zhijie) Wang ZhijieWang

  • San Francisco
  • 00:17 (UTC -12:00)
View GitHub Profile
import sys
file = sys.argv[1]
with open(file, "r") as f:
lines = f.readlines()
clean = []
for l in lines:
clean.append(l.replace("\\{", "").replace("\\}",""))
file = sys.argv[2]
with open(file, "w+") as f:
for c in clean:
CMAKE_VERSION=3.21
CMAKE_BUILD=3
GEANT4_VERSION_TAG=v10.7.2
MAX_NUM_G4_THREADS=18
G4_DATASETS=('G4EMLOW.7.7.tar.gz' 'G4ENSDFSTATE.2.2.tar.gz')
G4ENSDFSTATEDATA=/usr/local/geant4-data/G4ENSDFSTATE2.2
G4LEDATA=/usr/local/geant4-data/G4EMLOW7.7
PATH=$PATH:/usr/local/geant4/bin:/opt/cmake/cmake-3.21.3-linux-x86_64/bin/
sudo apt-get install make libexpat1 libexpat1-dev
@ZhijieWang
ZhijieWang / ROCM Instruction.md
Last active August 30, 2018 22:15
Instructions and Supplementary documentation for ROCM and CUDA porting activities

Follow Instructions on ROCM homepage to get ROCM packages, DKMS and drivers.

Current release 1.8 as the time of writing, only works on Kernel 4.13 (per my experience). Ubuntu 18.04 can use tools like ukuu to drop kernel to lower version and select older kernel at GRUB boot menu.

Once ROCM is installed, add below to shell profile

export PATH="$PATH:<ROCM DIRECTORY>/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:<ROCM DIRECTORY>/hip/include"
@ZhijieWang
ZhijieWang / Ubuntu 16.04 AMD+NVIDIA Setup
Last active August 30, 2018 16:24
Instruction on setting up AMD and NVIDIA GPU in Ubuntu 16.04
Source:
https://askubuntu.com/questions/892532/nvidia-card-for-cuda-and-amd-card-for-display-on-ubuntu-16-04
Credit to Marcus on StackOverflow. This Gist is for archive and reference purpose.
Before starting I recommend to install ssh in order to be able to shutdown the system remotely if something goes wrong. To do so use this command:
sudo apt-get install ssh
Error applying plan:
2 error(s) occurred:
* aws_cloudwatch_metric_alarm.service_cpu_high: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
Please include the following information in your report:
Terraform Version: 0.8.0
Resource ID: aws_cloudwatch_metric_alarm.service_cpu_high
@ZhijieWang
ZhijieWang / AWS AutoScaling
Created December 27, 2016 21:31
Terraform 0.8.2 AWS Autoscaling Log
2016/12/27 13:30:37 [INFO] Terraform version: 0.8.2
2016/12/27 13:30:37 [INFO] CLI args: []string{"/usr/local/Cellar/terraform/0.8.2/bin/terraform", "apply", "-var-file", "credential.tfvars", "-var-file", "env.tfvars"}
2016/12/27 13:30:37 [DEBUG] Detected home directory from env var: /Users/zhijie.wang
2016/12/27 13:30:37 [DEBUG] Detected home directory from env var: /Users/zhijie.wang
2016/12/27 13:30:37 [DEBUG] Attempting to open CLI config file: /Users/zhijie.wang/.terraformrc
2016/12/27 13:30:37 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2016/12/27 13:30:37 [DEBUG] Detected home directory from env var: /Users/zhijie.wang
2016/12/27 13:30:37 [DEBUG] vertex "module.service": static expanding
ConfigResource
aws_ecs_task_definition.task - *terraform.GraphNodeConfigResource
@ZhijieWang
ZhijieWang / AWS-ECS.md
Last active December 14, 2016 06:52 — forked from anonymous/AWS-ECS.md
Demystifying AWS ECS -- ECS documentation for the impatient

Task Definition:

A bunch of containers logically bundled together

  • i.e. Nginx + MVC + DB for Traditional stack
  • i.e. service + optional db for Miscroservices

NetWork Mode:

  • Bridge -- Fork the connection on host's network stack, will have individual IP for container
Add this line to `/etc/rc.local` to fix ethernet
``ethtool -s eth0 speed 100 duplex full``
require "formula"
class Bohrium < Formula
homepage "http://bh107.org/"
head "https://github.com/bh107/bohrium.git"
url "https://codeload.github.com/bh107/bohrium/zip/7615b8804d5be119a1acf8d940d1cbb2e9444296"
version "v0.2-1894-g7615b88"
sha1 "b8d08acc305ef7cc894286b83a6001f87c9ea681"
depends_on "cmake" => :build
$ wget http://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin
$ chmod u+x cloudera-manager-installer.bin
$ sudo ./cloudera-manager-installer.bin