Skip to content

Instantly share code, notes, and snippets.

@g00cey
g00cey / gsub test
Created December 2, 2012 12:23
なんか正規表現の話が出ていたので。
#!ruby
# coding:utf-8
#
test = <<"EOR"
{\"title\"=>\"hogehoge\"}
EOR
puts test.gsub(/\\/,'')
@g00cey
g00cey / ping.rb
Created June 20, 2013 15:28
なんかめんどいので、normalだけ動作確認せずです。
# -*- coding: utf-8 -*-
#https://raw.github.com/tluna/ruby/master/network/ping.rb
require 'rubygems'
require 'net/ping'
require 'parallel'
require 'benchmark'
data = `ifconfig`
#すべてのNICからIPアドレス取得
{
"name": "cakephp/cakephp",
"repositories" : [
{
"type": "pear",
"url": "http://pear.php.net"
},
{
"type": "pear",
"url": "http://pear.phpunit.de"
<?php
/**
* This file is loaded automatically by the app/webroot/index.php file after core.php
*
* This file should load/create any application wide configuration settings, such as
* Caching, Logging, loading additional configuration files.
*
* You should also use this file to include any files that provide global functions/constants
* that your application uses.
*
my $profile = [{
"鈴木" => [{"address" => "東京都千代田区"}],
"山田" => [{"address" => "東京都葛飾区"}]
}];
foreach my $profile_record( $profile) {
foreach my $keys(keys $profile_record) {
foreach my $human ($profile_record->[$keys]) {
my %human_data = %$human;
#print "human\n";
@g00cey
g00cey / centos-openssl
Last active August 29, 2015 14:20
opensslファイル確認
sudo rpm -ql openssl
/etc/pki/CA
/etc/pki/CA/certs
/etc/pki/CA/crl
/etc/pki/CA/newcerts
/etc/pki/CA/private
/etc/pki/tls
/etc/pki/tls/certs
/etc/pki/tls/certs/Makefile
/etc/pki/tls/certs/make-dummy-cert
@g00cey
g00cey / INSATLL
Last active August 29, 2015 14:20
openssl source install
INSTALLATION ON THE UNIX PLATFORM
---------------------------------
[Installation on DOS (with djgpp), Windows, OpenVMS, MacOS (before MacOS X)
and NetWare is described in INSTALL.DJGPP, INSTALL.W32, INSTALL.VMS,
INSTALL.MacOS and INSTALL.NW.
This document describes installation on operating systems in the Unix
family.]
@g00cey
g00cey / centos-mod_ssl
Last active August 29, 2015 14:20
perl php httpd install
ldd /usr/lib64/httpd/modules/mod_ssl.so
linux-vdso.so.1 => (0x00007fff1a5ec000)
libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f6332e36000)
libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f6332a53000)
libc.so.6 => /lib64/libc.so.6 (0x00007f63326be000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f633247a000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f6332194000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f6331f8f000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f6331d63000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f6331b5f000)
@g00cey
g00cey / 1.0.1e-makeconfig
Last active August 29, 2015 14:20
opensslを自分でビルドしたものを各公式パッケージプログラムにそのまま利用させられるか?を確認。
sudo rm -rf /usr/local/openssl-1.0.1e
make clean
export CFLAGS="-fPIC"
./config --prefix=/usr/local/openssl-1.0.1e \
shared zlib shared \
enable-camellia enable-seed enable-tlsext enable-rfc3779 enable-cms enable-md2
make
sudo make install
luna-no-Air:~ luna$ dig test.tluna.mydns.jp
; <<>> DiG 9.10.2 <<>> test.tluna.mydns.jp
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21305
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 4
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1280