Skip to content

Instantly share code, notes, and snippets.

View DaisukeMiyamoto's full-sized avatar

Daisuke Miyamoto DaisukeMiyamoto

  • Tokyo, Japan
View GitHub Profile
# -*- coding: utf-8 -*-
"""
Simulate Izhikevich model and draw graph
Created on Tue Mar 01 04:21:25 2016
@author: nebula
"""
import numpy as np
import matplotlib.pyplot as plt
@DaisukeMiyamoto
DaisukeMiyamoto / test_simulation.py
Created January 20, 2017 07:16
example of visualizing simulation
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 9 15:52:38 2016
@author: nebula
"""
import os
import swc2vtk
from tqdm import tqdm
#### import the simple module from the paraview
from paraview.simple import *
# Properties modified on renderView1
renderView1.EnableOSPRay = 1
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# get active view
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Blender python script for rendering x3d scenes
# Tobias Holzmann
# February 2016
# Tobias.Holzmann@Holzmann-cfd.de
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
import bpy
# Loop through all x3d files
@DaisukeMiyamoto
DaisukeMiyamoto / convert.sh
Created May 5, 2017 15:34
convert file name for plex.tv
#!/bin/bash
TO=./test2
rm -rf $TO/*
BROADCASTS="NHKG NHK ATX BS11 BSF BST TBS CTC TX MX"
EXTS="mp4 avi mkv"
FROM=/share/backstores/tmp?/anime
LN="ln -s"
@DaisukeMiyamoto
DaisukeMiyamoto / convert.sh
Created May 5, 2017 15:34
convert file name for plex.tv
#!/bin/bash
TO=./test2
rm -rf $TO/*
BROADCASTS="NHKG NHK ATX BS11 BSF BST TBS CTC TX MX"
EXTS="mp4 avi mkv"
FROM=/share/backstores/tmp?/anime
LN="ln -s"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
class RenameForPlex():
def __init__(self, input_path, output_path, debug=False):
self.broadcast_list = {'ATX':3, 'BS11':3, 'MX':-2}
@DaisukeMiyamoto
DaisukeMiyamoto / userparameter_matlab.conf
Created May 20, 2017 08:38
Zabbix userparameter for matlab floating license
UserParameter=matlab.matlab_max,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of MATLAB" | cut -d " " -f7
UserParameter=matlab.matlab,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of MATLAB" | cut -d " " -f13
UserParameter=matlab.simulink,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of SIMULINK" | cut -d " " -f13
UserParameter=matlab.curve_fitting,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of Curve_Fitting_Toolbox" | cut -d " " -f13
UserParameter=matlab.image,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of Image_Toolbox" | cut -d " " -f13
UserParameter=matlab.neural_network,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of Neural_Network_Toolbox" | cut -d " " -f13
UserParameter=matlab.optimization,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of Optimization_Toolbox" | cut -d " " -f13
UserParameter=matlab.distrib_computing,/usr/local/MATLAB/R2016b/etc/lmstat -f MATLAB | grep "Users of Distrib_Computing_Toolbo
@DaisukeMiyamoto
DaisukeMiyamoto / CPU_Temperature.xml
Last active February 2, 2021 15:46
zabbix template for measuring CPU temperature by "coretemp-isa-0000" sensor
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.2</version>
<date>2017-05-29T14:09:16Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@DaisukeMiyamoto
DaisukeMiyamoto / neuron-python1.py
Created May 29, 2017 15:07
example1 of neuron with python
import numpy as np
import matplotlib.pyplot as plt
import neuron
def calc_hh():
soma = neuron.h.Section(name="soma")
soma.nseg = 3 # odd number
soma.diam = 10 # [um]