Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Shipit!

Mihai Todor mihaitodor

:shipit:
Shipit!
View GitHub Profile
@mihaitodor
mihaitodor / foo_names.md
Created Jul 9, 2016
Map slugs to course names
View foo_names.md

https://archive.org/download/archiveteam_coursera_20160627114043/coursera_20160627114043.megawarc.warc.gz

  • bigdata = Web Intelligence and Big Data
  • clinical skills = Teaching and Assessing Clinical Skills
  • comp finance = Introduction to Computational Finance and Financial Econometrics
  • data sci = Introduction to Data Science
  • dmathgen = 离散数学概论 Discrete Mathematics Generality
  • global introuslaw = The Global Student's Introduction to U.S. Law
  • global theatre = Theatre and Globalization
  • global theatre = Theatre and Globalization
  • inforiskman = Information Security and Risk Management in Context
@mihaitodor
mihaitodor / Makefile
Created Sep 18, 2016
GTest sample Makefile
View Makefile
# A sample Makefile for building Google Test and using it in user
# tests. Please tweak it to suit your environment and project. You
# may want to move it to your project's root directory.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
@mihaitodor
mihaitodor / smart_ssh.sh
Last active Feb 14, 2019
ssh convenience wrapper script
View smart_ssh.sh
#!/bin/sh
# Assume that the last argument is the address of the host
input_addr="${@: -1}"
do_ssh () {
ssh "$@"
ret_val=$?
if [[ ${ret_val} != 0 && ${ret_val} != 127 && ${ret_val} != 130 ]]; then
echo "Failed to connect to: ${input_addr}"
@mihaitodor
mihaitodor / cloudflare_fetch_rayid_log.sh
Created Feb 12, 2019
Fetch Cloudflare log data for a given Ray ID
View cloudflare_fetch_rayid_log.sh
#!/bin/bash
# Fetch Cloudflare log data for a given Ray ID
# Please note that the Ray ID is the first part of `CF-RAY` (4a807f60ca5727a4-FRA -> 4a807f60ca5727a4)
CF_ZONE=${1}
RAY_ID=${2}
if ! host -N 0 "${CF_ZONE}" 2>&1 > /dev/null; then
echo "Invalid domain '${CF_ZONE}'"
@mihaitodor
mihaitodor / singularity_menu_extra_script.js
Created Aug 7, 2020
Hubspot/Singularity `extraScript` config hack for adding links in the menu to instances of a given service
View singularity_menu_extra_script.js
<script>
fetch('/singularity/api/tasks/ids/request/{{ Environment }}_{{ Service }}')
.then(response => response.json()).then((taskIDs) => {
Object.values(taskIDs.healthy).forEach(function(task) {
fetch('/singularity/api/tasks/task/' + task.id)
.then(response => response.json()).then((taskInfo) => {
let host = taskInfo.taskId.host.replace(/_/g, '-');
let port = taskInfo.mesosTask.container.docker.portMappings[0].hostPort;
let a = document.createElement('a');
a.textContent = '{{ Service }} at ' + host + ':' + port;
You can’t perform that action at this time.