Skip to content

Instantly share code, notes, and snippets.

View iogi's full-sized avatar
:octocat:

Ippei Ogiwara iogi

:octocat:
View GitHub Profile
<?php
$url = "http://d.hatena.ne.jp/i_ogi/atom/blog";
$user_name = "your hatena id";
$password = "your password";
$nonce = md5(mt_rand());
$created = date(DATE_ISO8601);
$x_wsse = sprintf('UsernameToken Username="%s", PasswordDigest="%s", Nonce="%s", Created="%s"',
$user_name,
<?php
require 'Services/Amazon/SQS/Queue.php';
define('AMAZON_ACCESS_KEY', your access key);
define('AMAZON_SECRET_ACCESSKEY', your secret access key);
// queueのURIを指定
define('QUEUE_URL', 'http://queue.amazonaws.com/508403871985/test-queue');
$sqs = new Services_Amazon_SQS_Queue(QUEUE_URL, AMAZON_ACCESS_KEY, AMAZON_SECRET_ACCESSKEY);
diff -crN config.m4 config.m4.new
*** config.m4 2010-01-17 13:34:39.000000000 +0900
--- config.m4.new 2010-01-17 14:10:01.000000000 +0900
***************
*** 1,5 ****
dnl
! dnl $Id: config.m4 247692 2007-12-06 14:01:49Z helly $
dnl
dnl Suppose we need FlatFile if no support or only CDB is used.
// ==UserScript==
// @name noreferrer
// @namespace http://ss-o.net/
// @include http://*
// ==/UserScript==
document.body.addEventListener('DOMNodeInserted',noref,false);
noref({target:document.body});
function noref(e){
<?php
// Signature Version 4 Key Derivation Samples in PHP5
// http://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html
function hash_sha256_raw($msg, $key)
{
return hash_hmac("sha256", $msg, $key, true);
}
function getSignature($key, $dateStamp, $regionName, $serviceName)
{
import boto.ec2
VPC_ID = 'vpc-xxxxxxxx'
conn = boto.ec2.connect_to_region(
'ap-northeast-1',
aws_access_key_id='<access key>',
aws_secret_access_key='<secret access>')
sg_elb = conn.create_security_group('elb2', '80,443 from world', VPC_ID)
#!/bin/sh
VPC_ID="vpc-xxxxxxxx"
# ELB
SGID=`aws ec2 create-security-group --group-name elb --description elb --vpc-id $VPC_ID --output text --query GroupId`
aws ec2 authorize-security-group-ingress --group-id $SGID --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-id $SGID --protocol tcp --port 443 --cidr 0.0.0.0/0
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"sgadmin": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "ssh from office",
"VpcId": "vpc-xxxxxxxx",
"Tags": [{"Key": "Name", "Value": "admin"}],
"SecurityGroupIngress": [
# -*- coding: utf-8 -*-
class DomainScore(object):
KEYMAP = [
'1234567890-',
'qwertyuiop',
'asdfghjkl',
'zxcvbnm,.'
]
def __init__(self):
var Promise = require('bluebird');
var Slack = require('slack-node');
var AWS = require('aws-sdk');
var moment = require('moment');
var _ = require('underscore');
var util = require('util');
var apiToken = "";
function getLastChecked() {