Skip to content

Instantly share code, notes, and snippets.

View yyamasak's full-sized avatar

Yusuke Yamasaki yyamasak

View GitHub Profile
@yyamasak
yyamasak / mymath.tcl
Last active May 17, 2018 07:20
Making Tcl expr handle Inf or NaN transparently
proc is_computable_double {val} {
expr {[string is double -strict $val] && ![is_nan $val]}
}
proc is_nan {val} {
string match -nocase [string trimleft $val +-] "nan"
}
proc is_infinite {val} {
expr {$val == Inf || $val == -Inf}
@dariussullivan
dariussullivan / b79021d41025.py
Last active July 6, 2017 01:38
Small demonstration of secs equipment server. Uses secsgem and twisted.
from twisted.internet import reactor, protocol, endpoints
from twisted.protocols import basic
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue
from twisted.internet import task
from twisted.python import log
# log errors inside reactor to stdout
from twisted.python.log import startLogging
from sys import stdout
startLogging(stdout)
@yyamasak
yyamasak / TestGetPrivateProfileSectionNames.cs
Created March 17, 2015 11:17
GetPrivateProfileSectionNames.exe .\system.ini
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.IO;
namespace TestGetPrivateProfileSectionNames
{
public class Program
{
[DllImport("kernel32.dll")]
@flcdrg
flcdrg / boxstarter-bare-v3.ps1
Last active March 25, 2024 01:47
My BoxStarter Scripts
# 1. Install Chocolatey
<#
Set-ExecutionPolicy RemoteSigned -Force
# Create empty profile (so profile-integration scripts have something to append to)
if (-not (Test-Path $PROFILE)) {
$directory = [IO.Path]::GetDirectoryName($PROFILE)
if (-not (Test-Path $directory)) {
New-Item -ItemType Directory $directory | Out-Null
}
@udzura
udzura / LICENSE
Last active May 8, 2021 14:23
やわらかRuby
やわらかRubyはCC BY 4.0 で提供します。
詳細: https://creativecommons.org/licenses/by/4.0/deed.ja
This work is licensed under a Creative Commons Attribution 4.0 International License.
See also: https://creativecommons.org/licenses/by/4.0/deed
@wbond
wbond / compile.sh
Last active September 21, 2022 22:39
Subversion windows compile
# Install mingw with msys and all options from http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
# Install python 2.7 to C:\Python27 and add to Path environmental variable
cd ~/src
cd openssl
./Configure mingw shared --prefix=/usr/local
make depend
make
make install
@deroter
deroter / BitbucketへのSSH公開鍵の手順メモ.md
Last active October 19, 2016 13:36
まとめ# BitbucketへのSSH公開鍵の手順メモ.自分用

BitbucketへのSSH公開鍵の手順メモ

Bitbucket登録後にSSHの公開鍵を設定する時のメモ

SSH鍵の作成

$ cd ~/.ssh

$ mkdir bitbucket
@mala
mala / gist:5107120
Last active March 19, 2020 01:41
TwitterのOAuthの問題の補足とか

https://gist.github.com/mala/5062931

の続き。

Twitterの人に色々と問題点は伝えたんだけど、これからOAuthのサーバー書く人や、クライアント書く人が似たような問題を起こさないようにするために、どうすればいいのかについて簡単に書きます。既存の実装真似して作るとうっかりひどい目にあう。

自分は意図的に「Twitterの脆弱性」という表現を使わないように気を使っていて、それはクライアントアプリ側の責任もあるからなのだけれども、安全に実装するための方法がわかりにくかったり誤解を招きやすかったり、Twitterに買収されているTweetDeckにも問題があったりしたので、それはやっぱりTwitter側の責任の比重が大きいとは思う。とはいっても別に責任を追求したかったり◯◯はクソだといったことを言いたいわけではなく、誰が悪いとか言う以前に、複合的な要因によって問題が起きるときには原因を正しく理解する必要があると思う。

そもそも何を担保に安全性を保証しているのか

  • サーバー側で秘密の鍵を持っている(それが無いとアクセストークンを取得できない or 使えない)
@mala
mala / gist:5062931
Last active March 18, 2020 15:31
TwitterのOAuthの問題まとめ

どういう問題があったか

説明するのめんどい http://vividcode.hatenablog.com/entry/twitter-oauth-vulnerability

どういう対策がされたか

とりあえず即座に攻撃できるような状態ではなくなっています。

フィッシング?

@mochiz
mochiz / gist:5027808
Last active December 14, 2015 04:19
Ruby2 + Rails4環境を構築する(2013/02/25版)

更新日:2013/02/26

※WEB+DB PRESS vol.73のRails4特集を写経したくてRuby2 + Rails4環境を構築した際のメモです。
まっとうな手順ではないので、大人しく正式リリースを待ったほうがいいと思いますが

2013/02/26 追記

gemがリリースされたので、ふつうにgem installするといいですよ