Skip to content

Instantly share code, notes, and snippets.

View fno2010's full-sized avatar
🎯
Focusing

Jensen Zhang fno2010

🎯
Focusing
View GitHub Profile
@fno2010
fno2010 / .spacemacs
Last active December 9, 2018 19:09
Spacemacs dot file
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@fno2010
fno2010 / fetchBibtex.py
Created April 12, 2017 11:51
A utility script to fecth bibtex from top conferences of CS
#!/usr/bin/env python
"""DBLP Bib Fetcher
A utility script for fetching bibtex from DBLP.
Dependencies:
pyquery
"""
import urllib2
@fno2010
fno2010 / check-flow.sh
Last active November 1, 2017 17:55
Quickly remove all filtered flows: ./check-flow.sh --filter <flow_name_head> | ./remove-flow.sh
#!/bin/bash
FILTER=false
while true; do
case "$1" in
--filter)
FILTER=true
FILTER_HEAD=$2
shift 2
@fno2010
fno2010 / getfileinfo
Last active September 11, 2017 15:37
Some utility scripts for CMS dashboard: http://dashb-cms-job.cern.ch/dashboard
#!/bin/bash
curl -sSL -H 'Accept: application/json' -H 'Accept-Encoding: gzip' \
http://dashb-cms-job.cern.ch/dashboard/request.py/fileaccessinfo2?$(./getparams $1) \
| gzip -d
@fno2010
fno2010 / dashb-phedex.org
Last active September 12, 2017 16:20
Org mode notebook for CMS dashboard/PhEDEx database query.

Get Parameters

import sys
if sys.version[0] == 2:
    from urllib import urlencode
else:
    from urllib.parse import urlencode
@fno2010
fno2010 / openalto-logo-raw.svg
Last active April 6, 2018 07:54
SVG source for OpenALTO logo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fno2010
fno2010 / setup-unicorn-without-odl.sh
Last active October 29, 2017 08:14
Quickly setup an ODL controller with alto-unicorn
#!/bin/bash
WORKDIR=$1
UNICORN_URL=https://github.com/openalto/alto-experimental
UNICORN_DIR=$WORKDIR/alto-experimental
UNICORN_FEATURE=$UNICORN_DIR/features/target/alto-experimental-features-0.1.0-SNAPSHOT.kar
yum install -y wget git zip unzip
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
@fno2010
fno2010 / mininetsim.py
Created January 25, 2018 06:42
Utility script to generate mininet topology from topologyzoo
#!/usr/bin/env python
"""
run this file:
sudo -E python mininetsim.py {*.graphml}
"""
import networkx
import random
import sys
from mininet.net import Mininet
from mininet.topo import Topo
@fno2010
fno2010 / wacom-mac-remover.sh
Created December 14, 2018 19:31
Clear all the installed files by Wacom Driver
#/bin/bash
# Clear all the installed files by Wacom Driver
rm -rf /Applications/Wacom\ Tablet.localized
rm -rf /Applications/Pen\ Tablet.localized
rm -rf /Library/Application\ Support/Tablet
rm -rf /Library/Extensions/Wacom\ Tablet.kext