This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from Crypto.Cipher import AES | |
from binascii import b2a_hex | |
''' | |
@brief CipherDataクラス | |
ブロック暗号は元のデータの長さがブロック長の倍数になっていない場合パディングが必要なので、それを覚えとくためのクラス。 | |
''' | |
class CipherData: | |
def __init__(self, encrypted_data, padding_length): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% base64 -D -i testfile | iconv -f ISO-2022-JP -t UTF-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ dscacheutil -flushcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% sudo diskutil checkRAID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 仮想インタフェースの作成 | |
% sudo ifconfig lo0 alias 127.0.0.2 | |
Password: <--- パスワードを入力。 | |
2. トンネル接続 | |
% ssh -N <username>@<ssh server> -L 127.0.0.2:8139:<SMB server>:139 | |
3. Finderでマウント |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIView animateWithDuration:0.5 animations:^{ | |
self.imageView.alpha = 0.0; | |
}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NSTask launchedTaskWithLaunchPath:@"/usr/bin/open" arguments:[NSArray arrayWithObject:[NSString stringWithFormat:@"/tmp/%@.png", filename]]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto, time | |
''' | |
@param[in] aws_access_key_id AWSアカウントのアクセスキーID | |
@param[in] aws_secret_access_key AWSアカウントのシークレットキー | |
@param[in] keypair_id CloudFrontキーペアID | |
@param[in] keypair_file CloudFrontキーペアファイル | |
@param[in] cf_distribution_id CloudFrontディストリビューションID | |
@param[in] s3_object_name 公開したいS3オブジェクトのキー | |
@param[in] expires_in_seconds CloudFrontで公開する期間を秒で指定 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *languages = [NSLocale preferredLanguages]; | |
if ([[languages objectAtIndex:0] isEqualToString:@"ja"]) { | |
// 日本語での処理 | |
} else { | |
// それ以外での処理 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, char **argv) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
/* | |
Objective-Cのコード。 | |
*/ | |
[pool drain]; | |
return 0; | |
} |
OlderNewer