Skip to content

Instantly share code, notes, and snippets.

@Ruin0x11
Ruin0x11 / asound.conf.alsa
Created October 31, 2016 21:04
asound.conf
pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
@Ruin0x11
Ruin0x11 / vocalyric.rb
Created May 28, 2016 21:21
search 初音ミク@Wiki for lyrics
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'mechanize'
require 'nokogiri'
require 'logger'
class Vocalyric
def initialize
@agent = Mechanize.new
@agent.log = Logger.new "mech.log"
@Ruin0x11
Ruin0x11 / niconico_dl.rb
Created May 12, 2016 03:16
download niconico video + comments
#!/usr/bin/env ruby
require 'niconico'
require 'streamio-ffmpeg'
require 'optparse'
require 'yaml'
# also requires danmaku2ass
VIDEO_URL = /https?:\/\/(?:www\.|secure\.)?nicovideo\.jp\/watch\/((?:[a-z])+?[0-9]+)/
count = 1000
@Ruin0x11
Ruin0x11 / mpv-seq.sh
Last active March 22, 2019 19:48
play videos/episodes in sequential order
#!/bin/bash
# mpv-seq - Play files in a directory in order, starting from given file
# caveat: needs the filename as first argument, then arguments to pass to mpv
playlist=/var/tmp/.playlist
thisfile="$0"
qa="$1"
q=$(printf '%s\n' "$qa" | sed 's/[[\.*^$/]/\\&/g')
ext="${q##*.}"