Skip to content

Instantly share code, notes, and snippets.

View Bowenislandsong's full-sized avatar

Bowen Song Bowenislandsong

  • USC
View GitHub Profile
@Bowenislandsong
Bowenislandsong / creator.py
Created January 28, 2019 01:55
Creating Repositories inside organization. Add members as assigned. Using PyGithub
# Creating repositories in an organization from a list
# Add people from the list to their repositories
# by Bowen Song
# Input List File Format:
# <repository name> | <Member username/email> | <role>
# ceph-end-to-end-tracing bowenislandsong member
# $ pip install PyGithub
@Bowenislandsong
Bowenislandsong / TaigaCreator.py
Created February 16, 2019 17:14
Creating Taiga Project with invitation
# Creating projects in Taiga from a list
# Add people from the list to their projects
# by Bowen Song
# Input List File Format:
# <Project name> | <Member username/email>
# $ pip install PyGithub
# use Normal Access
@Bowenislandsong
Bowenislandsong / mvunlockedtxt.py
Last active February 17, 2019 15:17
Preparing Experimental Data
import os
from os import listdir
from os.path import isfile, join
def writeline(f_name,line):
f = open(f_name,'a')
line = line.replace("$", "")
f.write(line)
# we edit the grades off-line from blackboard
# we assume the combination of Student ID and BU emails as unique and valid identity (either should do)
# group assignment list should be with this script
# Mode 1:
# we input csv files for grade assignments
# Mode 2:
# we input a grade for a group
import csv
import os
import copy as c
import test "github.com/openshift/windows-machine-config-operator/tools/windows-node-installer/pkg/cloudprovider/aws"
func getInstance(a *test.awsProvider, instanceID string) (*ec2.Instance, error) {
instances, err := a.EC2.DescribeInstances(&ec2.DescribeInstancesInput{
InstanceIds: aws.StringSlice([]string{instanceID}),
})
if err != nil {
return nil, err
}
#!/bin/bash
# move content of clusterN to cluster dir and destroy cluster
# cp install-config from current dir to clusterN and edit cluster name with random suffix
# create the OpenShift Cluster there.
# Pre-req: dir(cluster, clusterN), installer-config.yaml, and openshift-install binary.
rm -rf cluster/*
mv clusterN/* cluster/
./openshift-install destroy cluster --dir cluster &
cp install-config.yaml clusterN/
nameSufix=$RANDOM % 100000 | bc
#!/bin/bash
# make a dir with time
dir_name="olm_$(date +"%m_%d-%T")"
mkdir "$dir_name"
for pod_name in $(oc get pods -n olm | awk 'NR>1 {print $1}')
do
oc logs --all-containers $pod_name -n olm > "$dir_name/$pod_name.txt"
done
# have raw-pull-secret by Visit https://cloud.redhat.com/openshift/install/aws/installer-provisioned for aws pull-secret
# Login to OC using https://api.ci.openshift.org/ and upper right corner you'll see the dropdown to Command Line Tools that'll give you an oc login command to cp/paste in your terminal.
cp raw-pull-secret pull-secret
oc registry login --to=pull-secret
tr -d ' \t\n\r\f' <pull-secret >openshift-pull-secrets.yaml
pullsecret=`cat openshift-pull-secrets.yaml`
sed -i "/^\([[:space:]]*pullSecret: \).*/s//\1'${pullsecret}'/" install-config.yaml
// Project trigger is available in UI.
function SendEmail() {
var agendaSheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0];
var emailTempSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Email Template")
var startRow = 2;
var emailTemp = emailTempSheet.getDataRange().getValues()
var address = emailTemp[0][1]
var subject = emailTemp[1][1]
var meetingTP = emailTemp[2][1]
%% Graph IBLT
clear all
close all
t=csvread("./setDiff_iblt.txt");
i=csvread("./setDiff_intercpi.txt");
samples = 50;
dataLength = 50;
plotIBLTPerf_diff(t,i,samples,dataLength,"Communication and Time Cost vs. Diffrences Between 2 DB");