Skip to content

Instantly share code, notes, and snippets.

@orimanabu
orimanabu / SMcli_examples.sh
Created November 28, 2012 06:51
SMcli examples
#!/bin/sh
SMCLI=/opt/IBM_DS/client/SMcli
contA="IP address of Controller A"
contB="IP address of Controller B"
${SMCLI} ${contA} ${contB} -c "show storagesubsystem profile;"
${SMCLI} ${contA} ${contB} -c "show allControllers;"
@orimanabu
orimanabu / libvirt_generate_UUID_MAC.py
Created December 27, 2012 05:32
generate MAC address and UUID for libvirt KVM guest.
#!/usr/bin/env python
import virtinst.util
print "UUID:\t", virtinst.util.uuidToString(virtinst.util.randomUUID())
print "MAC:\t", virtinst.util.randomMAC(type="qemu")
# for one-liner
# python -c 'from virtinst.util import *; print uuidToString(randomUUID())'
# python -c 'from virtinst.util import *; print randomMAC(type="qemu")'
@orimanabu
orimanabu / OpenSSL speed benchmark on MacBookPro10.1 - Intel Core i7 (@2.7GHz), Snow Leopard
Last active December 12, 2015 02:49
OpenSSL speed benchmark on MacBookPro10.1 - Intel Core i7 (@2.7GHz), Snow Leopard
manglobe:~ ori$ system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro10,1
Processor Name: Intel Core i7
Processor Speed: 2.7 GHz
Number of Processors: 1
@orimanabu
orimanabu / OpenSSL speed benchmark on MacBookPro10.1 - Intel Core i7 (@2.7GHz), Mavericks
Last active December 27, 2015 12:59
OpenSSL speed benchmark on MacBookPro10.1 - Intel Core i7 (@2.7GHz), Mavericks
manglobe:~ ori$ system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro10,1
Processor Name: Intel Core i7
Processor Speed: 2.7 GHz
Number of Processors: 1
@orimanabu
orimanabu / bhyve log (FreeBSD 10.0 host on FreeBSD 9.2 guest)
Created April 2, 2014 11:22
bhyve log (FreeBSD 10.0 host on FreeBSD 9.2 guest)
ori@freebsd-master:~/work/bhyve-script % sudo sh freebsd1 start
Password:
vmm.ko is loaded.
Entering vmload()
vmload: Attaching raw image ./vm/freebsd1/freebsd1.img for fsck
vmload: DEBUG: VMIMG is ./vm/freebsd1/freebsd1.img and VMDEV is md0
Entering getvolpart()
vmload: DEBUG: fsck_ufs -y /dev/md0p2
** /dev/md0p2
http://people.redhat.com/wpan/doc/rhel7/docs/dup_book.pdf
http://people.redhat.com/wpan/doc/rhel7/docs/How_to_Create_a_Driver_Update_Package_on_RHEL7_v0.1.pdf
@orimanabu
orimanabu / otp_sanitized.py
Created July 7, 2014 12:38
HOTP password generator
#!/usr/bin/python
# vim: set et sts=4 sw=4 ts=4 :
# see also: http://www.slideshare.net/aoshiman/shizuokapy3-totp
import sys
import time
import hashlib
import hmac
import struct
import base64
@orimanabu
orimanabu / vpn_sanitized.scpt
Last active August 29, 2015 14:03
AppleScript to connect VPN with HOTP
-- references: http://apple.stackexchange.com/questions/78793/apple-script-vpn-textbox
tell application "System Events"
tell current location of network preferences
set VPNservice to service "VPN NAME" -- name of the VPN service
if exists VPNservice then
if current configuration of VPNservice is not connected then
connect VPNservice
else
error "already connected."
end if
@orimanabu
orimanabu / wifi_sanitized.scpt
Last active August 29, 2015 14:03
AppleScript to connect Wi-Fi with HOTP
-- inspired by: http://forums.macrumors.com/showthread.php?t=1099181
tell application "System Events"
tell process "SystemUIServer"
tell menu bar 1
set menuExtras to (value of attribute "AXChildren")
set airport to -1
repeat with aMenu in menuExtras
tell aMenu
if value of attribute "AXDescription" contains "Wi-Fi" then
set airport to aMenu
@orimanabu
orimanabu / gist:8c7841c345fe14f84820
Created October 22, 2014 08:16
devstack localrc for juno on ubuntu14.04
HOST_IP=172.16.143.89
DEST=/opt/stack
LOGFILE=stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=${DEST}/logs/screen
FLOATING_RANGE=172.16.99.0/24
FIXED_RANGE=172.16.89.0/24
FIXED_NETWORK_SIZE=256
FLAT_INTERFACE=eth0