Skip to content

Instantly share code, notes, and snippets.

View amotoki's full-sized avatar

Akihiro Motoki amotoki

View GitHub Profile
@amotoki
amotoki / rectangle.el
Created September 29, 2013 15:59
Insert a decimal or hex incremental/decremental number into a region
;; Copyright (C) 2013 Akihiro Motoki <amotoki@gmail.com>
;; Author: Akihiro Motoki <amotoki@gmail.com>
;; Keywords: convenience rectangle
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
#!/usr/bin/env python
import argparse
import logging
import re
import sys
import pprint
#-------------------------------------------------
@amotoki
amotoki / po-file-update.sh
Last active December 22, 2015 22:09
Check the I18N strings in Horizon repository are updated and create a new commit if any
#!/bin/bash -e
# Latest version is available at
# https://github.com/amotoki/horizon-i18n-tools/blob/master/po-file-update.sh
function is_updated() {
local file=$1
git diff $file | \
grep -E '^[-+]' | \
grep -v -E '^[-+]#:' | \
@amotoki
amotoki / localrc-havana-allinone
Last active December 22, 2015 19:39
devstack all-in-one localrc for Havana
# Neutron
# To use nova-network, comment out the following
PRIVATE_NETWORK_NAME=net1
PUBLIC_NETWORK_NAME=ext_net
Q_PLUGIN=ml2
disable_service n-net
enable_service neutron q-svc q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
@amotoki
amotoki / po-fuzzy-diff.el
Created August 20, 2013 06:09
Compare the difference in PO fuzzy string
;;; po-fuzzy-diff.el --- Compare the difference in PO fuzzy string
;; Copyright (C) 2013 Akihiro Motoki <amotoki@gmail.com>
;; Author: Akihiro Motoki <amotoki@gmail.com>
;; Keywords: convenience po-mode
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
@amotoki
amotoki / localrc
Last active December 21, 2015 08:18
devstack stable/grizzly localrc with Neutron OVS plugin as compute node
# -*- mode: bash -*-
#-----------------------------
# Common congigurations
#-----------------------------
CFGDIR=$HOME/tool/config
source $CFGDIR/01-proxy
source $CFGDIR/02-repos
source $CFGDIR/10-local
@amotoki
amotoki / localrc-hv
Last active December 21, 2015 08:18
devstack stable/grizzly localrc with Neutron OVS plugin as controller node
# -*- mode: bash -*-
#-----------------------------
# Common congigurations
#-----------------------------
CFGDIR=$HOME/tool/config
source $CFGDIR/01-proxy
source $CFGDIR/02-repos
source $CFGDIR/10-local
# Gerrit Dashboard Creator https://github.com/sdague/gerrit-dash-creator.git
[dashboard]
title = NEC OpenStack CI Status
description = Review Inbox
foreach = project:openstack/neutron status:open
[section "Recent failures in NEC OpenStack CI, but Jenkins succeeds"]
query = label:Verified<=-1,nec-openstack-ci label:Verified>=1,jenkins NOT age:2week
[section "Recent failures (vote=0), but Jenkins succeeds"]
@amotoki
amotoki / openstack-gerrit-hide-ci.js
Last active August 29, 2015 14:02
Bookmarklet to hide CI comments in OpenStack Gerrit
javascript:(function(){
/* Bookmarklet maker: http://userjs.up.seesaa.net/js/bookmarklet.html */
/* Configuraitons */
me = 'Akihiro Motoki';
ci_hide = true;
fail_hide = false;
/* main code */
list = document.querySelectorAll('table.commentPanelHeader');
for(i in list) {