Skip to content

Instantly share code, notes, and snippets.

View nodakai's full-sized avatar

NODA Kai nodakai

View GitHub Profile
#! /usr/bin/ruby
# -*- coding: utf-8 -*-
# ex: set fileencoding=utf-8 :
def main
puts <<-EOS
はてなにGistを埋め込むテスト
EOS
end
@nodakai
nodakai / fstab
Created May 13, 2012 13:41
/etc/fstab of zbox
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda6 during installation
LABEL=zboxRoot / ext4 defaults,noatime,errors=remount-ro,discard 0 1
@nodakai
nodakai / svn-ptree.sh
Last active December 11, 2015 14:39
Enumerates prop key-value pairs for each managed objects in a SVN repo
#! /bin/bash
function objloop() {
local fp=$1 pn
echo -n "$fp: "
for pn in `svn plist "$fp" | tail -n +2 | sort`; do
echo -n $pn=\"`svn pget "$pn" "$fp"`\" ' '
done
echo
}
#! /usr/bin/env python
import sys
def prt(x):
i = 0
while i <= x:
if i*(i+1)/2 >= x:
break
i += 1
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
int main(int argc, char *argv[]) {
int megs = 100;
size_t buflen;
failures:
---- [run-pass-valgrind] run-pass-valgrind/cleanup-auto-borrow-obj.rs stdout ----
error: test run failed!
status: exit code: 1
command: /usr/bin/valgrind --error-exitcode=100 --soname-synonyms=somalloc=NONE --quiet --suppressions=/home/nodakai/prog/rust-HEAD/src/etc/x86.supp --tool=memcheck --leak-check=full x86_64-unknown-linux-gnu/test/run-pass-valgrind/cleanup-auto-borrow-obj.stage1-x86_64-unknown-linux-gnu
stdout:
------------------------------------------
$ gcc f.c -o f -Wall -Wextra -pedantic -Wno-missing-field-initializers -g3 -O0 && echo OK
f.c: 関数 ‘main’ 内:
f.c:5:14: 警告: 仮引数 ‘argc’ が未使用です [-Wunused-parameter]
OK
$ nc -l 33333 &
[1] 25653
$ cd /proc/25653
$ killall nc
[1] + terminated nc -l 33333
$ /tmp/f 25653
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using std::cout;
using std::endl;
int main(int argc, char *argv[]) {
std::ifstream ifs(argv[1]);
@nodakai
nodakai / bar.cpp
Created August 13, 2015 01:31
Minimal Gradle example for withType(CppCompile)
int main() { }