Skip to content

Instantly share code, notes, and snippets.

View takaswie's full-sized avatar

坂本 貴史 takaswie

View GitHub Profile
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Give /dev/fw? as a parameter"
exit
elif [ ! -e $1 ] || [[ "x" == "x${1}" ]] ; then
echo "Given special file doesn't exist."
exit
fi
@takaswie
takaswie / phase88-specific.sh
Created November 12, 2014 15:42
VENDOR-DEPENDENT commands for Terratec PHASE 88 FW Rack (and EWS MIC2/MIC8, too)
#!/bin/bash
#
# Advanced Standalone Mode for
# EWS MIC 2/8 (96kHz or ADAT Firmware since Version 1.13.13.31) and
# PHASE 88 Rack FW (since Firmware Version 1.17.13.31)
# ftp://ftp.terratec.de/Producer/PHASE/PHASE88RACKFireWire/Manual/PHASE88Rack_FW_AdvancedStandaloneMode_Tutorial.pdf
#
#
@takaswie
takaswie / layout-manager.py
Created February 2, 2017 10:49
An example of ClutterLayoutManager for python 3, translated from https://git.gnome.org/browse/clutter/tree/examples/layout-manager.c
#!/usr/bin/env python3
import sys, signal, math
try:
import gi
from gi.repository import GLib
except:
print('Please install "gir1.2-glib-2.0" to your Ubuntu.')
sys.exit()
@takaswie
takaswie / basic-actor.py
Created February 2, 2017 10:50
An example of ClutterActor for Python 3, translated from https://git.gnome.org/browse/clutter/tree/examples/basic-actor.c
#!/usr/bin/env python3
import sys, signal
try:
import gi
from gi.repository import GLib
except:
print('Please install "gir1.2-glib-2.0" to your Ubuntu.')
sys.exit()
@takaswie
takaswie / test.c
Created February 25, 2017 02:50
Address and indirection operators
#include <stdio.h>
#include <stdlib.h>
struct hoge {
unsigned int number;
char data[512];
unsigned int hoge;
};
int main(void)
@takaswie
takaswie / test.c
Created March 8, 2017 00:43
ALSA timer test program
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@takaswie
takaswie / timer-and-dmix-plugin-test.c
Created March 12, 2017 03:54
Poll(2) blocking test of PCM dmix plugin.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <pthread.h>
#include <stdbool.h>
#include <alsa/asoundlib.h>
@takaswie
takaswie / atomix-test.cpp
Created July 30, 2017 05:47
Nowadays, arithmetic operations for storage classes of any sizes are not necessarily compiled and executed as atomic instruction.
#include<iostream>
#include<atomic>
#include<thread>
#include<mutex>
#include<condition_variable>
#include<mutex>
/*
* Refereces:
* - std::unique_lock: https://cpprefjp.github.io/reference/mutex/unique_lock.html
@takaswie
takaswie / stdin-vs-tty.c
Created August 26, 2017 09:23
stdin v.s. tty
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
@takaswie
takaswie / alsa-ctl-dimen-check.c
Last active September 2, 2017 04:25
A small program to check logical contradiction between member count and dimension info.
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>