Skip to content

Instantly share code, notes, and snippets.

View ontheklaud's full-sized avatar
😪

Seungkyun Hong ontheklaud

😪
View GitHub Profile
@rueberger
rueberger / ipp_gpu.py
Last active June 3, 2020 07:07
A quick way to distribute embarrassingly parallel things with ipyparallel on multiple gpus (or other things)
WS_N_GPUS = {
'turagas-ws1': 2,
'turagas-ws2': 2,
'turagas-ws3': 2,
'turagas-ws4': 2,
'c04u01': 8,
'c04u07': 8,
'c04u12': 8,
'c04u17': 8,
}
@harv
harv / glibc-2.17_centos6.sh
Last active October 21, 2024 17:23
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@Zireael-N
Zireael-N / Checksum.py
Last active March 14, 2023 07:48
Python script that calculates SHA1, SHA256, MD5 checksums of a given file.
#!/usr/bin/python
import hashlib
import os
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s filename' % sys.argv[0])
if not os.path.exists(sys.argv[1]):
@rossant
rossant / points.py
Created December 15, 2014 16:23
VisPy example: interactive cloud of points in 3D
import sys
import numpy as np
from vispy import app, scene
canvas = scene.SceneCanvas(keys='interactive')
view = canvas.central_widget.add_view()
view.set_camera('turntable', mode='perspective', up='z', distance=2,
azimuth=30., elevation=30.)
pos = .25 * np.random.randn(1000, 3)
@lebedov
lebedov / queue_pool_demo.py
Created June 11, 2014 15:08
How to use multiple queues for passing data to/from a multiprocessing pool.
#!/usr/bin/env python
"""
How to use multiple queues for passing data to/from a multiprocessing pool.
"""
from multiprocessing import Pool, Queue
import shortuuid
def f(q_in, q_out):
@jdherman
jdherman / spinning-globe-example.py
Created November 2, 2013 19:36
Example of spinning globe in Basemap/Matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
from mpl_toolkits.basemap import Basemap, shiftgrid
from matplotlib.backends import backend_agg as agg # raster backend
filename = 'vic_error_9p_1K.txt'
# Set up the color data
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active November 9, 2024 08:57
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1