Skip to content

Instantly share code, notes, and snippets.

@kikairoya
kikairoya / netctl
Created August 17, 2014 11:00
fake netctl script for vmware-suspend
#!/bin/sh
case "$0" in
store)
;;
resume)
systemctl restart dhcpcd
;;
stop-all)
;;
%define gccver 4.8.2
Summary: rust for wandbox
Name: wandbox-rust-head
Version: %(eval date +%Y%m%d)
Release: 1
License: Apache
Group: wandbox
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: wandbox-gcc-%{gccver} wandbox-libuv
BuildRequires: libffi-dev
error: linking with `/opt/wandbox/gcc-4.8.2/bin/g++` failed: exit code: 1
note: /opt/wandbox/gcc-4.8.2/bin/g++ '-m64' '-L' '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustuv-ede8cb89-0.11.0-pre.so' 'x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/rustuv.o' '-lmorestack' 'x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/rustuv.metadata.o' '-nodefaultlibs' '-Wl,--as-needed' '-Wl,-O1' '-L' '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lstd-59beb4f7-0.11.0-pre' '-L' '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lsync-305341d2-0.11.0-pre' '-L' '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-g
(cd /home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/src/libuv/ && /usr/bin/python2.7 ./gyp_uv.py -f make -Dtarget_arch=x64 -D ninja -DOS=linux -Goutput_dir=/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/rt/libuv --generator-output /home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/rt/libuv)
['-f', 'make', '-Dtarget_arch=x64', '-D', 'ninja', '-DOS=linux', '-Goutput_dir=/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/rt/libuv', '--generator-output', '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/x86_64-unknown-linux-gnu/rt/libuv', '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/src/libuv/uv.gyp', '-I', '/home/kikairoya/rpmbuild/BUILD/wandbox-rust-head-20140620/src/libuv/common.gypi', '--depth=.', '-Dgcc_version=48', '-Dclang=0', '-Dhost_arch=x64', '-Duv_library=static_library', '-Dcomponent=static_library']
Traceback (most recent call last):
File "./gyp_uv.py", line 102, in <
@kikairoya
kikairoya / open-vm-tools_PKGBUILD
Created January 18, 2014 23:48
AURのopen-vm-tools-dkmsが最近のkernelで動かなくなってるからUbuntuからパチってきた
# patch -p1 <$srcdir/dkms-conf.patch
# $Id: PKGBUILD 102331 2013-12-09 03:38:37Z bisson $
# Maintainer: Sergej Pupykin <[email protected]>
# Contributor: Krzysztof Raczkowski <[email protected]>
pkgbase=open-vm-tools
pkgname=('open-vm-tools' 'open-vm-tools-dkms')
epoch=6
pkgver=9.4.0
_pkgsubver=1280544
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDv94WPz35cGOR+OSae2rW+VLcx0L0stOAPZy8Ft1Ci6dzTNfKRhn1vHLIy85isZGf8r+ZsF04FGA7arcAuRxX5Zt6Gx10JLUN1PBRFEaoHKvKfYc/CezJlIINLXSOyiT8lUX6YQ7fYA4W4fDXWaat2UWdOQIh97sZngUxpWtknQ6lL4VqQaz2y5n0lHyCtBgGGEsExBe0haY2aLRykgygQfX8QufR7T5/6odjClRNLPdWAagg6fL/6ltTq6d1d7q8AQyxbPT6vvCtH+Vk3+VPGKBz+0bQWNI7jpnOgdLAK5e7wxQZ7OertXESfsGw/imBb+MM8UiRnuJVi4RsZjceH kikairoya@x240
@kikairoya
kikairoya / wand
Last active December 31, 2015 10:29
script for using wandbox instead of local compiler
#!/usr/bin/python
from sys import argv, version_info
import json
from urllib2 import urlopen, Request
def print_usage():
print("usage: {} compiler {{options}} srcfile".format(argv[0]))
print(" {} --list-compilers".format(argv[0]))
print(" {} --list-options compiler".format(argv[0]))
(defun fmap (f m)
(funcall (get (si:*structure-definition-name (si:*structure-definition m)) 'fmap) f m))
(defun >>= (m f)
(funcall (get (si:*structure-definition-name (si:*structure-definition m)) '>>=) m f))
(defun >> (m a)
(funcall (get (si:*structure-definition-name (si:*structure-definition m)) '>>) m a))
(defstruct maybe
has-value
(defun resolve-bind-args (bindexpr args)
(mapcar
(lambda (x)
(cond
((bind-subexpression-p x) (call (resolve-bind-args x args)))
((bind-placeholder-p x) (nth (1- (bind-placeholder-position x)) args))
(t x)))
(bind-subexpression-bounds bindexpr)))
(defmacro bind (&rest bounds)
; 雀の往来
(require "isearch")
(require "ni/setup")
(require "wandbox")
(ni-autoload)
(setq-default backup-by-copying t)
(setf
(symbol-function 'backward-delete-char-untabify-or-selection) #'delete-backward-char-or-selection