Skip to content

Instantly share code, notes, and snippets.

@takumikinjo
takumikinjo / inventory.cgi
Created June 19, 2016 16:03
Obtain inventory by JSON. Cisco Catalyst is supported.
#!/usr/bin/env perl
use File::Basename;
use JSON 'encode_json';
my $XLOGIN = '/usr/lib/rancid/bin/clogin';
sub usage
{
print <<EOS;
@takumikinjo
takumikinjo / pfping
Last active June 19, 2016 16:41
A wrapper of fping to print pretty timestamp and host description.
#!/bin/bash
#
# A wrapper for fping to print pretty timestamp and host description.
#
# Copyright (C) 2016 Takumi KINJO - All Rights Reserved
# Permission to copy and modify is granted under the MIT license
# Version 0.1.0
# Licence: MIT
usage()
#!/usr/bin/env python
# Recieve WOL packet and then run vmrun command to boot VM.
#
# sudo ./wol-vmrun ~/path/to/vm1.vmx@xx:xx:xx:xx:xx:xx ~/path/to/vm2.vmx@yy:yy:yy:yy:yy:yy
#
# Tested on OS X El Capitan and VMware Fusion 8 Pro.
import re
import sys
@takumikinjo
takumikinjo / extra-letter-case.el
Created December 30, 2014 05:30
Extra letter case
;;; extra-letter-case.el --- Extra letter case
;; Copyright (C) 2014 Takumi Kinjo
;; Author: Takumi Kinjo <[email protected]>
;; Keywords: convenience, wp
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
@takumikinjo
takumikinjo / Vagrantfile
Created September 6, 2014 05:02
My trial of Ansible.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
;;; osx-say.el --- Utilizing `say' command which Mac OSX has for Emacs
;; Copyright (C) 2014 Takumi Kinjo
;; Author: Takumi Kinjo <[email protected]>
;; Keywords: local, hypermedia
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
@takumikinjo
takumikinjo / b.py
Last active August 29, 2015 14:04
Example of Bpy with a plane object
data = bpy.data.objects['Plane'].data
data.vertices.add(1)
data.vertices[4].co.x=3
data.edges.add(2)
data.edges[4].vertices[0]=3
data.edges[4].vertices[1]=4
data.edges[5].vertices[0]=1
data.edges[5].vertices[1]=4
@takumikinjo
takumikinjo / Vagrantfile
Last active August 29, 2015 14:04
Vagrantfile for Ruby installing.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@takumikinjo
takumikinjo / Dockerfile
Last active August 29, 2015 14:03
Dockerfile using baseimage-docker for my trial.
FROM phusion/baseimage:0.9.11
ENV HOME /root
RUN /etc/my_init.d/00_regen_ssh_host_keys.sh
RUN echo /root > /etc/container_environment/HOME
Add id_rsa.pub /tmp/id_rsa.pub
RUN cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys && rm -f /tmp/id_rsa.pub
RUN apt-get update
RUN apt-get install -y autoconf bison build-essential curl git-core libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev libxml2-dev libxslt1-dev libyaml-dev sqlite3 zlib1g-dev
@takumikinjo
takumikinjo / ubuntu-base
Last active August 29, 2015 14:03
My favorite packages.
# test
linux-headers-generic
build-essential
bzr
curl
cvs
dnsutils
git
lv
manpages