Skip to content

Instantly share code, notes, and snippets.

View keijiro's full-sized avatar

Keijiro Takahashi keijiro

View GitHub Profile
@keijiro
keijiro / fix_screen.sh
Created April 5, 2019 07:40
Ubuntu on GPD Win 2: Fix screen rotation
xrandr --output eDP-1 --mode 720x1280 --rotation right
@keijiro
keijiro / fix-touch-screen.md
Last active March 24, 2019 12:34
How to remap a touch screen to a display on Linux.
  • Check the input device ID with xinput.
  • Check the display device name with xrandr.
  • xinput map-to-output
@keijiro
keijiro / install-ndi.sh
Last active January 27, 2024 09:25
Install the NDI shared library into a Linux system
#!/bin/sh
DEST=/usr/local/lib/x86_64-linux-gnu
test -d $DEST || mkdir $DEST
cp -P lib/x86_64-linux-gnu/libndi.so* $DEST
ldconfig
@keijiro
keijiro / asc2ply.cpp
Created February 8, 2019 09:41
A small utility that converts .asc point cloud file into binary-LE .ply file.
#include <deque>
#include <fstream>
#include <iostream>
#include <memory>
namespace
{
struct Point
{
float x, y, z;
@keijiro
keijiro / generate_test_hap.sh
Created February 8, 2019 05:13
Generate a test HAP video from a still image.
ffmpeg -loop 1 -i input.jpg -c:v hap -t 12 -vf scale=6144x3072 -r 60 out.mov
@keijiro
keijiro / ffmpeg_gif.sh
Last active February 7, 2019 14:17
How to create an animated GIF from a video file using ffmpeg.
ffmpeg -i input.mp4 -filter_complex "[0:v] fps=30,scale=500:-1,split [a][b];[a] palettegen=max_colors=64 [p];[b][p] paletteuse=dither=floyd_steinberg" out.gif
@keijiro
keijiro / desktop-capture.sh
Last active August 4, 2019 15:31
How to record desktop on Linux (Ubuntu) with ffmpeg
ffmpeg -f x11grab -framerate 30 -video_size 1920x1080 -i :1+0,0 -c:v huffyuv -an desktop.avi
@keijiro
keijiro / ubuntu-install-setup.md
Last active November 22, 2022 04:56
This is how I set up a Ubuntu Linux system.
  • Install Ubuntu using rufus and a USB stick.
  • Install the NVIDIA dirver from "Software & Updates" - "Additional Drivers".
  • Install Mozc input method from "Region & Language" - "Input Sources".
  • Install Unity Hub by following these steps.
  • Install Git, Vim and Vulkan.
    • sudo apt install git vim vulkan-tools
  • Sign in to GitHub and add a new SSH key.
  • Clone dotfiles and run setup.
@keijiro
keijiro / KlakHap.md
Last active February 25, 2019 01:17

KlakHAP

Gif

KlakHAP is a Unity plugin that allows playing back a video stream encoded with the [HAP video codecs].

HAP is a fast and high-quality video codec often used in real-time interactive applications. From the HAP Codecs website:

@keijiro
keijiro / MeshDuplicator.cs
Created December 5, 2018 09:55
Duplicates mesh assets (Unity 4.x)
using UnityEditor;
using UnityEngine;
static class MeshDuplicator
{
static Mesh[] SelectedMeshes { get {
return Selection.GetFiltered<Mesh>(SelectionMode.Unfiltered);
} }
[MenuItem("Assets/Duplicate Mesh")]