Skip to content

Instantly share code, notes, and snippets.

View SiewYan's full-sized avatar

Siewyan Hoh SiewYan

View GitHub Profile
@SiewYan
SiewYan / latex_in_atom.md
Created August 25, 2021 07:08 — forked from Aerijo/latex_in_atom.md
Setting up Atom for LaTeX

Disclaimer: I wrote the packages language-latex2e, autocomplete-latex, latex-wordcount, and hyperclick-latex. I still try to provide a list of all useful packages though, so let me know if I have missed one.

This is a general guide for how to get started with LaTeX in Atom.

NOTE: This guide assumes you already have LaTeX installed on your computer. If you do not, I recommend TeX Live.

@SiewYan
SiewYan / ginterpretor
Last active September 14, 2020 18:44
ROOT.gInterpreter.Declare(
'''
//static std::map<const std::string,TH2D*> SFmap_;
std::map<std::string,TH2D*> loadSF2D( const char *filename )
{
std::map<std::string,TH2D*> SFmap;
TFile f = TFile( filename , "READ" );
SFmap.insert(std::make_pair( "mc_" , (TH2D*) f.Get("mc")->Clone("mc_") ));
@SiewYan
SiewYan / Sherpa-bootstrap.sh
Last active May 17, 2020 06:33
Boostrap script to install sherpa , hacking from rivet-bootstrap script
#! /usr/bin/env bash
# Rivet bootstrapping / installation script for version 3.0.2
test -z "$BUILD_PREFIX" && BUILD_PREFIX="$PWD"
test -z "$INSTALL_PREFIX" && INSTALL_PREFIX="$PWD/local"
test -z "$MAKE" && MAKE="make -j6"
test -z "$INSTALL_HEPMC2" && INSTALL_HEPMC2="1"
test -z "$INSTALL_HEPMC3" && INSTALL_HEPMC3="1"
@SiewYan
SiewYan / Hist2D.py
Created October 10, 2019 09:14
2D histogram producer for charge flip study
import ROOT
from ROOT import gROOT, gStyle
import collections
import numpy as np
import math
import sys
rbins=np.array([0. , 1. , 1.5 , 2.5])
xbins=[ [0. , 1.] , [1., 1.5] , [1.5, 2.5] ]
@SiewYan
SiewYan / Latino-setup.md
Last active June 21, 2019 14:58
Setting up latino framework README

1.) Pre-requisite

a.) ssh key setup for your github account

b.) SL6

2.) Setup

cmsrel CMSSW_9_4_12

@SiewYan
SiewYan / README.md
Created July 28, 2018 10:19 — forked from magnetikonline/README.md
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set. Value will be returned.

Couple with : no-op if return value is to be discarded.
${variable="value"}
: ${variable="value"}

ssh-keygen -t rsa

ssh b@B mkdir -p .ssh

cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'

ssh b@B

@SiewYan
SiewYan / Setuphadoop.md
Last active July 13, 2018 21:54
Setting up hadoop in raspberrypi

1.) Creating a new group and user

sudo addgroup hadoop
sudo adduser --ingroup hadoop hduser
sudo adduser hduser sudo
su hduser

2.) Generating SSH keys

cd ~

@SiewYan
SiewYan / EOSls.sh
Created April 25, 2018 19:33
Accessing EOS space
export EOS_MGM_URL=root://eospublic.cern.ch
xrdcp testfile.txt root://eospublic.cern.ch//eos/opstest/cmspd-bigdata/testfile.txt
eos ls -l /eos/opstest/cmspd-bigdata
#!/usr/bin/env python
import json
import socket
from re import sub
from sys import exit
from random import choice
from time import clock,time,sleep
from os import system,getenv,path,environ