Skip to content

Instantly share code, notes, and snippets.

@amaya382
amaya382 / 1-host_prepare_qemu.sh
Last active August 6, 2017 06:12
Easy installation and test of xgboost scripts for hadoop/hive/hivemall on ubuntu16.04/arm64
#!/bin/sh
# http://www.mztn.org/dragon/arm64_01.html
mkdir -p qemu-arm64
cd qemu-arm64
wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img
sudo qemu-img resize xenial-server-cloudimg-arm64-uefi1.img +10G
@amaya382
amaya382 / README.md
Last active February 20, 2018 05:18
Scala関西Summit 2017: ハンズオン事前準備

事前にやっていただきたいこと

  1. ツール3種のインストール
  2. sbtのドライラン

利用するツール

JDK 1.8+

Scalaのプロジェクト/周辺ツールも基本的にJVM上で動作するので必要です.

@amaya382
amaya382 / garbage.scala
Last active December 10, 2017 06:01
(dotty)
object Main {
def main(args: Array[String]): Unit = {
case class =>>[T, U](f: T => Boolean, g: T => U)
implicit class Ex[T](f: T => Boolean) {
def =>>[U](g: T => U): T =>> U = new =>>(f, g)
}
def matchx1[T, U](target: T)(cases: (T =>> U)*): U = {
cases.collectFirst {
case cas if cas.f(target) => cas.g(target)
#!/bin/sh -eu
BRD='10.255.255.255' # for searching interface
enable_wol() {
sudo ethtool -s $1 wol g
sudo sh -c 'cat << EOF > /etc/systemd/system/[email protected]
[Unit]
Description=Wake-on-LAN for %i
Requires=network.target
@amaya382
amaya382 / tabs_to_bottom.css
Last active June 30, 2018 08:35 — forked from Arty2/tabs_to_bottom.css
Firefox CSS to move tabs and adress bar to bottom of window. Use with Stylish or userChrome.css (works with Firefox 57+)
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* tabs to bottom */
#browser-panel { /* Deprecated since FF 59 */
-moz-box-direction: reverse;
padding: 0 !important;
}
#navigator-toolbox {
-moz-box-ordinal-group: 2;
@amaya382
amaya382 / surfingkeys.js
Last active October 7, 2024 02:52
surfingkeys.js
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
iunmap,
@amaya382
amaya382 / foo.bash
Created December 25, 2018 10:55
dust
# Not work, because of https://github.com/kubernetes/kubernetes/issues/20352
for label in ${labels//,/ }; do
if [ "${query}" != '' ]; then
query="${query} &&"
fi
query=${query}@.spec.selector.${label//=/\=\=\"}\"
done
$KUBECTL get rs --no-headers=true -o=jsonpath="{.items[?(${query})].metadata.name}" | xargs
# Use jq
{
"editor.minimap.enabled": false,
"window.title": "${dirty}${rootName}${separator}${appName} / ${activeEditorLong}",
"editor.fontSize": 15,
"editor.fontFamily": "Karen, Menlo, Monaco, 'Courier New', monospace",
"window.zoomLevel": 0,
"go.testFlags": [
"-v"
],
"breadcrumbs.enabled": true,
#!/bin/bash -eu
# Prerequisites: helm-client, kubeseal, yq, GNU grep, and GNU sed
# $1: chart
# $2: values file
# $3: chart name
cat << EOF > $1/templates/secret.yaml
apiVersion: v1
@amaya382
amaya382 / 90-mtrack.conf
Created September 10, 2019 22:44
/etc/X11/xorg.conf.d/
Section "InputClass"
MatchIsTouchpad "on"
Identifier "Touchpads"
Driver "mtrack"
# Acceleration and Sensitivity
Option "AccelerationProfile" "2"
Option "ConstantDeceleration" "2.4"
Option "Sensitivity" "1.35"