This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Usage: measure-gpu-memory-usage.py command args... | |
import cupy | |
import subprocess | |
import sys | |
initial_memory = None | |
for device_id in range(cupy.cuda.runtime.getDeviceCount()): | |
cupy.cuda.runtime.setDevice(device_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::{Arc, Mutex}; | |
struct Data{ data: Option<Arc<Mutex<Data>>> } | |
fn main() { | |
for _ in 0..5000000 { | |
let val = Arc::new(Mutex::new(Data{ | |
data: Some(Arc::new(Mutex::new(Data { data: None }))) | |
})); | |
let mut child = Arc::new(Mutex::new(Data{ data: None })); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# curl 'https://gist.githubusercontent.com/imos/38e242d1cc3a8db06d90f3368f4a3fa8/raw/install.sh' | bash | |
set -e -u | |
################################################################################ | |
# 1. Docker のインストール | |
################################################################################ | |
if ! which docker; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdint.h> | |
#include <sys/time.h> | |
#include <atomic> | |
#include <functional> | |
#include <map> | |
#include <mutex> | |
#include <string> | |
#include <thread> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('UTC'); | |
function Parse($file, $shift = 0) { | |
$data = explode("\n", trim(str_replace( | |
["\r\n", "\r"], "\n", file_get_contents($file)))); | |
array_shift($data); | |
$output = []; | |
foreach ($data as $row) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('UTC'); | |
function Parse($file, $shift = 0) { | |
$data = explode("\n", trim(str_replace( | |
["\r\n", "\r"], "\n", file_get_contents($file)))); | |
array_shift($data); | |
$output = []; | |
foreach ($data as $row) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
MAINTAINER Kentaro Imajo <docker@imoz.jp> | |
RUN apt-get update -qq && apt-get -y install sslh | |
ENTRYPOINT sslh -f -u root -p 0.0.0.0:443 --ssh ${MASTER_HOST}:22 --ssl ${MASTER_HOST}:10443 | |
EXPOSE 443 |