Skip to content

Instantly share code, notes, and snippets.

@tamano
tamano / ipmsg_send.rb
Created September 27, 2012 07:10
code to send message to self in IPMsg protocol
require 'socket'
udp = UDPSocket.open()
sockaddr = Socket.pack_sockaddr_in(2425,"127.0.0.1")
udp.send("1:1:user:host:32:Hello",0,sockaddr)
udp.close
@tamano
tamano / gist:3b5e844ae3bbb0e09e93
Last active October 22, 2015 02:26
Check Chef's behavior about file / directory permission
###################################### Precondition
[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)
[vagrant@localhost ~]$ chef -v
Chef Development Kit Version: 0.9.0
chef-client version: 12.5.1
berks version: 4.0.1
kitchen version: 1.4.2
@tamano
tamano / gist:3f4c425ebd4b5cc5df6c
Created October 22, 2015 02:02
Install Chef for test
[vagrant@localhost ~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)
[vagrant@localhost ~]$ wget https://opscode-omnibus-packages.s3.amazonaws.com/el/6/x86_64/chefdk-0.9.0-1.el6.x86_64.rpm --no-check-certificate
[vagrant@localhost ~]$ sudo rpm --install chefdk-0.9.0-1.el6.x86_64.rpm
[vagrant@localhost ~]$ sudo chef gem install knife-zero --no-document
[root@localhost ~]# ssh-keygen -N ''
[root@localhost ~]# cp ~/.ssh/{id_rsa.pub,authorized_keys}
[ERROR: alfred.workflow.input.scriptfilter] Code 255: Warning: require(/Users/tamano/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.92ED01A8-58DA-45B9-AF7E-2152B71209F8/scripts/config/routes.php): failed to open stream: No such file or directory in /Users/tamano/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.92ED01A8-58DA-45B9-AF7E-2152B71209F8/scripts/vendor/composer/autoload_real.php on line 54
Fatal error: require(): Failed opening required '/Users/tamano/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.92ED01A8-58DA-45B9-AF7E-2152B71209F8/scripts/config/routes.php' (include_path='.:') in /Users/tamano/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.92ED01A8-58DA-45B9-AF7E-2152B71209F8/scripts/vendor/composer/autoload_real.php on line 54
[ERROR: alfred.workflow.input.scriptfilter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDoma
@tamano
tamano / 0_reuse_code.js
Created October 20, 2016 07:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"