Skip to content

Instantly share code, notes, and snippets.

View ossdev-somewhere's full-sized avatar

OSSDEV SOMEWHERE ossdev-somewhere

View GitHub Profile
@ossdev-somewhere
ossdev-somewhere / hello.cl
Created January 16, 2018 12:53
OpenCL Hello World
__kernel
void hello(
__global __read_only char * restrict a,
__global __write_only char * restrict b)
{
b[0] = 'H';
b[1] = 'e';
b[2] = 'l';
b[3] = 'l';
b[4] = 'o';
@ossdev-somewhere
ossdev-somewhere / host-single-work-item.c
Created January 7, 2018 14:10
OpenCL single work-item host program
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
@ossdev-somewhere
ossdev-somewhere / host-nd-range.c
Created January 7, 2018 12:50
OpenCL NDRange kernel call
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
@ossdev-somewhere
ossdev-somewhere / autossh.service
Created May 14, 2015 01:42
autossh service file for systemd. place this file as /etc/systemd/system/autossh.service
[Unit]
Description=Keeps a ssh tunnel open
After=network.target
[Service]
User=yourusername
ExecStart=/usr/bin/autossh \
-M 0 -N -L '8080:somehost:8080' \
-o "BatchMode yes" \
-o "StrictHostKeyChecking no" \
@ossdev-somewhere
ossdev-somewhere / mbox2mh
Created April 1, 2015 05:58
mbox2mh - Converts Firefox's mbox format into Mew's MH format.
#!/bin/sh
#
# FirefoxのmboxファイルをMewのMH形式に変換します。
# (Firefoxの管理用フィールドを削除して変換します。)
#
# ■使い方
# $ mbox2mh input-mbox-file
#
# ■出力
@ossdev-somewhere
ossdev-somewhere / jgrep
Last active August 29, 2015 14:18
A Simple mg Replacement for Mew
#!/bin/bash
# mew用メール検索 (mgの代替)
#
# ■mewから渡される引数
# $1 ... 検索文字列(EUC-JP)
# $2以降 ... 検索対象のメールのインデックス(1 2 3 ...)
# pwdがメールフォルダであるため、そのままファイル名である
#
# ■mewが期待する出力
@ossdev-somewhere
ossdev-somewhere / xsel.el
Last active July 3, 2023 11:58
Emacs-nox <-> X11 clipboard transfer.
; You need "xsel" program.
(defun x-paste ()
"insert text on X11's clipboard to current buffer."
(interactive)
(insert-string (shell-command-to-string "xsel -b")))
(defun x-copy ()
"copy text on local kill-ring to X11's clipboard."
(interactive)