Skip to content

Instantly share code, notes, and snippets.

View danikaze's full-sized avatar

danikaze danikaze

  • Tokyo, Japan
View GitHub Profile
@danikaze
danikaze / multiple-git-config.md
Last active November 26, 2023 12:41
Use multiple github repositories from the same server

1. Generate the ssh key:

ssh-keygen -t ed25519 -C "username@domain"

username@domain can be your email or the username @ server domain for easier readability, or anything.

Store it using a custom filename like ~/.ssh/github-REPO

2. Add the deployment key:

@danikaze
danikaze / ffmpeg-extract-sub.sh
Last active November 3, 2023 12:22
Subtitle files operations
# Extract a subtitle from a .mkv file
#
# -map X:s:Y means (https://trac.ffmpeg.org/wiki/Map)
# * X: Input index
# * s: subitle (v for video, a for audio)
# * Y: Stream index
# 0:s:0 = the 1st subtitle of the 1st stream
ffmpeg.exe -i INPUT_FILE.mkv -map 0:s:0 OUTPUT.srt
@danikaze
danikaze / ipesc-helpers.user.js
Last active May 21, 2024 14:28
Set of utilities available on DevTools for IPESC racing community
// ==UserScript==
// @name Simracing GP for IPESC
// @namespace ipesc.danikaze
// @version 0.1.4
// @description Set of utilities available on DevTools for IPESC racing community
// @author danikaze
// @source https://github.com/danikaze/ipesc
// @updateURL https://gist.github.com/danikaze/9154b3b79eb2c605687c78f4991841fd/raw/ipesc-helpers.user.js
// @downloadURL https://gist.github.com/danikaze/9154b3b79eb2c605687c78f4991841fd/raw/ipesc-helpers.user.js
// @match https://app.simracing.gp/*
@danikaze
danikaze / obs-to-premiere.sh
Created March 5, 2023 03:28
Convert OBS video to something that Premiere can read
# OBS to be configured with the following Recording options
# * Settings > Output > Recording (Advanced)
# - Recording Format: mkv
# - Recording Tracks: 2, 3
# - Encoder: NVIDIA NVENC H.264
# Convert video to something usable by Premiere
ffmpeg.exe -i input.mkv -codec copy output.mp4
# Extract the other audio track
@danikaze
danikaze / tabletop-audio-dl.js
Created April 18, 2021 18:26
Download, organize and keep sync with tabletopaudio.com files with this gist
/**
* https://tabletopaudio.com/ is an awesome source of free music.
* Consider making a donation (to him) if using his creations!
*
*
* Just place the following .js+.bat files in the location you want to download
* from tabletop audio ^^
*
* Creating symboling links (to put files inside folders based on categories)
* requires admin permissions in Win :(
/**
* Find the route to access `data` in `object`.
* Note that if there's more than one ocurrence of `data` in `object`,
* it will return an array of routes with all of them unless `onlyFirst` is
* `true`, in which case it will just a string with the first found route
* (or `undefined` if not found)
*
* @param object Object where to search for `data`
* @param data Data to find
* @param onlyFirst set to `true` to return after the first match
@danikaze
danikaze / wordpress-backup.sh
Created May 8, 2019 08:26
Backup a wordpress database and/or filesystem into one (or two) compressed files based on the input options
#!/usr/bin/env bash
#
# Wordpress site backup
#
# Backup a wordpress database and/or filesystem into one (or two)
# compressed files based on the input options
#
# Author: @danikaze <danikaze@gmail.com>
#
@danikaze
danikaze / rakuten-lottery.user.js
Created December 21, 2018 01:51
Automagically join the Rakuten lottery every day
// ==UserScript==
// @name Rakuten Lottery
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Automagically join the Rakuten lottery every day
// @author danikaze
// @homepage https://gist.github.com/danikaze/
// @match *://*/*
// @grant GM_setValue
// @grant GM_getValue
@danikaze
danikaze / repoc-show-photos-again.user.js
Created December 18, 2018 09:03
TamperMonkey script to show again profile photos in REPOC SuccessFactors
// ==UserScript==
// @name REPOC SuccessFactors Show photo again
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description Latest version of Success Factors REPOC hides the photo in the profile page. This script shows it again.
// @author danikaze
// @match https://performancemanager10.successfactors.com/xi/ui/pages/empfile/*
// @grant none
// ==/UserScript==
(function() {
@danikaze
danikaze / .bash_profile
Last active November 21, 2018 03:01
Download MP3s from youtube | requires youtube-dl (https://rg3.github.io/youtube-dl/)
# Download a complete youtube playlist like
# ymp3list START_VIDEO_INDEX PLAYLIST_URL
alias ymp3list="youtube-dl.exe -o \"%(title)s.%(ext)s\" --extract-audio --audio-quality 0 --audio-format mp3 --playlist-start $1 $2"
# Download a single video
# mp3dl VIDEO_URL
alias mp3dl="youtube-dl.exe -o \"%(title)s.%(ext)s\" --extract-audio --audio-quality 0 --audio-format mp3 $1"