Skip to content

Instantly share code, notes, and snippets.

View SiewYan's full-sized avatar

Siewyan Hoh SiewYan

View GitHub Profile
@SiewYan
SiewYan / github_command.sh
Created January 28, 2018 20:55
Github cheatsheet
#!/bin/bash
#Github Cheat Sheet
#To make a branch
git branch -b <branch name>
#To delete a branch
git branch -D <branch name>
#To copy a file from one branch to other branch
#!/bin/bash
#1.)This is to list the install version
sudo edit-chroot -a
#2.)To delete
sudo edit-chroot -d trusty
#for installation
#3.)list the linux distribution
sh ~/Downloads/crouton -r list
@SiewYan
SiewYan / cleanup_LHE.py
Created January 29, 2018 11:56
Cleaning up offensive line in LHE files.
import os
import sys
def filter_lines(f, start_delete, stop_delete):
"""
Given a file handle, generate all lines except those between the specified
text markers.
"""
lines = iter(f)
try:
@SiewYan
SiewYan / main321.cc
Created January 29, 2018 12:00
This is a sample program showing Alpgen- or Madgraph-style MLM matching
// main32.cc is a part of the PYTHIA event generator.
// Copyright (C) 2016 Torbjorn Sjostrand.
// PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
// Please respect the MCnet Guidelines, see GUIDELINES for details.
// This is a sample program showing Alpgen- or Madgraph-style MLM matching
// for Madgraph LHEF or native Alpgen format event files.
//
// Please see the 'Jet Matching Style' manual page for a description of the
// parameters and user options.
sudo chromeos-setdevpasswd
@SiewYan
SiewYan / eospublicroot
Created March 1, 2018 16:09
Accessing opendata at lhc
root -l root://eospublic.cern.ch://eos/opendata/cms/Run2010B/MuOnia/AOD/Apr21ReReco-v1/0000/FEF1B99B-BF77-E011-B0A0-E41F1318174C.root
@SiewYan
SiewYan / wpa_supplicant.conf
Last active May 3, 2018 06:53
wpa_supplicant.conf for rapsberry pi, reside it in /etc/wpa_supplicant
country=IT
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="shoh_MacBookPro"
psk="2XXXXXXXX9"
key_mgmt=WPA-PSK
}
#!/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
@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
@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 ~