Skip to content

Instantly share code, notes, and snippets.

@dseg
dseg / PKGBUILD
Last active July 2, 2016 20:18
簡単! パッケージを作成してAURへ登録しよう ref: http://qiita.com/dseg/items/32807a9305801f2d430c
pkgbase=paho-mqtt
pkgname=(python-$pkgbase python2-$pkgbase)
package_python-paho-mqtt() {
pkgdesc="Python client library for MQTT v3.1 and v3.1.1"
depends=('python')
cd $srcdir/$pkgbase-$pkgver
python setup.py install --root="$pkgdir" --optimize=1
}
@dseg
dseg / file0.txt
Last active January 9, 2016 00:22
Bind 9.10のGeoIP機能を使って、リクエスト元に近いサーバのIPを返す ref: http://qiita.com/dseg/items/db3b66f824cfcb12f065
$ httping -c 3 qiita.com
PING qiita.com:80 (/):
connected to 54.248.127.202:80 (386 bytes), seq=0 time=579.29 ms
connected to 54.248.127.202:80 (386 bytes), seq=1 time=530.49 ms
connected to 54.248.127.202:80 (386 bytes), seq=2 time=533.82 ms
--- http://qiita.com/ ping statistics ---
3 connects, 3 ok, 0.00% failed, time 4645ms
round-trip min/avg/max = 530.5/547.9/579.3 ms
@dseg
dseg / ens3
Last active January 12, 2018 13:04
クラウド環境でArchLinuxを使う (Vultr編) ref: https://qiita.com/dseg/items/b4ad1c076dc585cb4432
Description='A basic static ethernet connection'
Interface=ens3
Connection=ethernet
IP=static
Address=('111.112.113.114/255.255.254.0')
Gateway='111.112.113.1'
DNS=('108.61.10.10')
## For IPv6 autoconfiguration
#IP6=stateless
@dseg
dseg / chargen.lua
Last active February 9, 2016 00:26
NGINX 1.9が汎用TCPサーバとして使えるようになっていた件 ref: http://qiita.com/dseg/items/75bf517738a1d8b2d036
-- chargen.lua
-- RFC 864 (https://tools.ietf.org/html/rfc864)
-- Init character table
local chars = {}
for j = 0x21, 0x7E do table.insert(chars, string.char(j)) end
-- Main loop
local size, i, p = #chars, 0, ngx.print
while true do
#!/bin/bash
VER=1.9.7.3
OPENRESTY=openresty-$VER.tar.gz
OPENSSL_PATH=/usr/local/src/openssl-OpenSSL_1_0_2f
# HTTP/2 patch for Nginx
#curl http://nginx.org/patches/http2/patch.http2-v2_1.9.3.txt -o http2.patch
# OpenResty
if [ ! -f "$OPENRESTY" ]; then
# Maintainer: Daichi Shinozaki <[email protected]>
pkgname=red
pkgver=0.6.0
pkgrel=1
pkgdesc="An open source, native code compiled, dialect of Rebol"
arch=('i686' 'x86_64')
url="http://www.red-lang.org"
license=('custom:3-clause BSD' 'custom:BSL')
groups=('devel')
makedepends=('wget' 'rebol=2.7.8' 'lib32-curl')
@dseg
dseg / sfen-parser.pegjs
Created March 8, 2016 14:33
sfen-parser.pegjs
/**
* Title: SFEN parser
* Date: 23-Jan-2014
* Author: Daichi Shinozaki <[email protected]>
* Demo URL: http://jsfiddle.net/dseg/QezQ7/15/
*
* Note:
* Tested with PEG.js 0.8.0
* http://pegjs.majda.cz/
*
@dseg
dseg / nftables.conf
Created April 22, 2016 07:45
A basic nftables config. Only accept ssh, http and https.
#!/usr/bin/nft -f
# ipv4/ipv6 Simple & Safe Firewall
# you can find examples in /usr/share/nftables/
table inet filter {
chain input {
type filter hook input priority 0;
# allow established/related connections
ct state {established, related} accept
Lastebil commented on 2010-12-06 14:07
I'm not actually sure what the output difference is, but per the jed build instructions, a make clean should be done before the make. This is mentioned during the build process as well.
Obviously we get an executable that runs afterward, and I haven't had any segfaults or any problems at all, but it's probably a good idea to follow that advice since the jed make scripts are somewhat different.
Anonymous comment on 2013-06-05 06:45
here's build fix because without freetype headers won't be found during build:
--- PKGBUILD~ 2013-06-05 15:43:36.396663854 +0900
@dseg
dseg / index.d.ts
Created September 30, 2016 10:05
The Updated typing file for Redux-Form v5.3.3
// Generated by typings
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/b0f7c3beeda79423c690a0080f984963fa9bec23/redux-form/redux-form.d.ts
declare module 'redux-form' {
import { Component, SyntheticEvent, FormEventHandler } from 'react';
import { Dispatch, ActionCreator, Reducer } from 'redux';
export const actionTypes: {[actionName:string]: string};
export type FieldValue = any;