Skip to content

Instantly share code, notes, and snippets.

View daitomanabe's full-sized avatar

Daito Manabe daitomanabe

View GitHub Profile
@daitomanabe
daitomanabe / neural-style-gpu-in-ec2.markdown
Last active June 1, 2016 00:57
easy set up for neural-stlye with Cuda7.5 + cuDNN5 in EC2

#neural-style with Cuda7.5 + cuDNN5 in EC2

  • if you want to skip installing nvidia driver and cuda7.5, use this Ubuntu 14 AMI.
    https://aws.amazon.com/marketplace/pp/B01EYKBEQ0
    (Nvidia Drivers, Cuda 7.5 Toolkit, cuDNN pre-installed with Nvidia Drivers, Cuda 7.5 Toolkit, cuDNN 4, TensorFlow, and Jupyter to leverage Nvidia GRID instances)
    g2.2xlarge or better (GPU instance)
    Don't forget to make your root partition size bigger.

  • In case you want to install everything by yourself

@daitomanabe
daitomanabe / gist:76338dd806c5c6b4177de27b5268649f
Last active March 25, 2017 16:54
installing basic audio apps on OSX
sound flower
https://github.com/mattingalls/Soundflower/releases/
lame
https://gist.github.com/trevorsheridan/1948448
sound siphon
https://staticz.com/soundsiphon/
Barbabatch
http://www.audioease.com/index.php#software
Max
https://cycling74.com
When an app crashes on open.
remove
~/Library/Containers/xxxxxx
e.g, Quicktime
~/Library/Containers/com.apple.QuickTimePlayerX
disable
sudo chmod a-r /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC
sudo chmod a-r /System/Library/PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions/A/Resources/AVC.plugin/Contents/MacOS/AVC
sudo chmod a-r /System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component/Contents/MacOS/QuickTimeUSBVDCDigitizer
sudo chmod a-r /Library/CoreMediaIO/Plug-Ins/DAL/AppleCamera.plugin/Contents/MacOS/AppleCamera
sudo chmod a-r /Library/CoreMediaIO/Plug-Ins/FCP-DAL/AppleCamera.plugin/Contents/MacOS/AppleCamera
enable
sudo chmod a+r /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC
sudo chmod a+r /System/Library/PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions/A/Resources/AVC.plugin/Contents/MacOS/AVC
check the status
defaults read com.google.Keystone.Agent.plist
adjust the checkinterval of GoogleSoftwareUpdate.app
defaults write com.google.Keystone.Agent checkInterval 0
#!/bin/bash
for i in `seq -f %02g 0 50`
do
foo=0
k=`expr $foo + $i`
say ${k} -o ${i}.aiff -v Kyoko
done
@daitomanabe
daitomanabe / install virtualenv ubuntu 16.04.md
Created November 14, 2022 09:30 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@daitomanabe
daitomanabe / video_splitter.py
Last active June 9, 2023 00:09
video_splitter
import argparse
import os
import datetime
import math
from moviepy.editor import VideoFileClip
def split_video(video_file, output_basename, bpm, first_clip_length=None, offset_4bar=None):
# Load the video file
video = VideoFileClip(video_file)
@daitomanabe
daitomanabe / random_clip_extractor.py
Last active June 1, 2023 12:17
random_clip_extractor
import argparse
import random
from moviepy.video.io.VideoFileClip import VideoFileClip
import os
import concurrent.futures
def write_clip(clip, start_time, end_time, output_file_path):
output_clip = clip.subclip(start_time, end_time)
output_clip.write_videofile(output_file_path, codec='libx264', bitrate='5000k')
print(f'Created: {output_file_path}')
@daitomanabe
daitomanabe / extract_channels.py
Last active May 31, 2023 08:22
extract_channels
from pydub import AudioSegment
import sys
import os
def extract_channels(input_file, output_dir):
audio = AudioSegment.from_file(input_file, format="wav")
# Check if the audio is already mono
if audio.channels == 1:
print(f"Ignoring file '{input_file}' as it is already mono")