Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

diff --git a/modules/linux/dkms.conf b/modules/linux/dkms.conf
index 3ed77f9..263921f 100644
--- a/modules/linux/dkms.conf
+++ b/modules/linux/dkms.conf
@@ -1,39 +1,35 @@
PACKAGE_NAME=open-vm-tools
PACKAGE_VERSION=2013.04.16
MAKE_CMD_TMPL="make VM_UNAME=\$kernelver \
- MODULEBUILDDIR=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build"
+ MODULEBUILDDIR=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build \
@kikairoya
kikairoya / seh.cc
Last active December 10, 2022 15:19
SEH for gcc
/*
Copyright (c) 2012- kikairoya
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
.stream-item {
margin-bottom: 0px !important;
}
.item-box {
padding: 2px !important;
border-bottom: 1px solid gray;
}
.tweet {
display: flex !important;
flex-direction: column !important;
@kikairoya
kikairoya / _etc_profile.d_systemd.sh
Created June 24, 2013 14:01
Enables 'systemctl --user' without X11, dbus-launch, systemd-user-session
if [ ! -S /run/user/$(id -u)/dbus/user_bus_socket ]; then
mkdir -p /run/user/$(id -u)/dbus
dbus-daemon --session --fork --address=unix:path=/run/user/$(id -u)/dbus/user_bus_socket --systemd-activation
fi
if ! systemctl --user > /dev/null 2> /dev/null; then
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/dbus/user_bus_socket /usr/lib/systemd/systemd --user & > /dev/null 2> /dev/null
fi
BLOCKSIZE=100
rm x*.gz
bzcat source.txt.bz2 | split -l $BLOCKSIZE -d --filter='gzip --fast > ${FILE}.gz'
for f in x*.gz; do zcat $f | shuf | gzip --fast > shuf-$f; done
echo shuf-*.gz | gawk -v seed="${RANDOM}" 'BEGIN{srand(seed);} {while(NF) { i=int(rand()*NF)+1; cmd=sprintf("zcat %s", $i); if ((cmd | getline l) > 0) { print l; } else { $i=""; $0=$0; } } }' | gzip > shuf.gz
#include <array>
template <typename T, typename ...Args>
inline std::array<T, sizeof...(Args)> make_array(Args &&...args) {
return std::array<T, sizeof...(Args)>{ std::forward<Args>(args)... };
}
#define MAKE_ARRAY(T, ...) decltype(make_array<T>(__VA_ARGS__)){__VA_ARGS__}
#include <typeinfo>
@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 <pupykin.s+arch@gmail.com>
# Contributor: Krzysztof Raczkowski <raczkow@gmail.com>
pkgbase=open-vm-tools
pkgname=('open-vm-tools' 'open-vm-tools-dkms')
epoch=6
pkgver=9.4.0
_pkgsubver=1280544
@kikairoya
kikairoya / wandbox.l
Last active April 5, 2020 08:04
post to wandbox from xyzzy
(eval-when (:compile-toplevel :load-toplevel :execute)
(require 'xml-http-request)
(require 'json))
(defpackage :wandbox
(:use :lisp :editor))
(in-package "wandbox")
(export '(post-wandbox-region post-wandbox post-wandbox-string show-compiler-list show-compiler-options))
@kikairoya
kikairoya / stdin_stream.hpp
Created April 9, 2011 03:47
boost::asio AsyncReadStream for console input
class stdin_stream: boost::noncopyable {
typedef boost::function<void (const boost::system::error_code &, size_t bytes_transferred)> read_handler_type;
public:
stdin_stream(boost::asio::io_service &io, HANDLE hin): io(io), hin(hin), hev(CreateEvent(0, 0, 0, 0)), handler(), buffer(0), size(0) {
_beginthread(&stdin_stream::thread_handler_gateway, 0, this);
}
~stdin_stream() {
buffer = 0;
CloseHandle(hev);
}
#include <tuple>
#include <type_traits>
using std::tuple;
template <int n>
struct int_: std::integral_constant<int, n> { };
typedef int_<0> zero_;
template <typename l>
struct decrement: int_<l::value-1> {