Skip to content

Instantly share code, notes, and snippets.

@edvakf
edvakf / 社内ISUCON事前ハンズオン.md
Last active April 30, 2023 13:12
ピクシブで新卒エンジニア全員向けに「インフラ研修」として次の内容のハンズオン講義を行いました。ちょうど2時間で終わる内容になっています。新卒達にはこの直後に社内ISUCONに挑んでもらいました。

AWSにインスタンスを立ててみよう

  • 質問:AWSにEC2インスタンスを立てたことがある人?
    • AWSのアカウント持ってない人はこの機会に取得してみよう
    • クレカがない人は言ってください
  • AWSにログインしてみよう https://portal.aws.amazon.com/
    • 東京リージョンに変更してみよう
  • Debian Jessieのインスタンスを起動してみよう
    • Rubyビルド済みインスタンスを用意しました
  • サイドバーのAMIから、検索欄に ami-53021a3d と書いて「パブリックイメージ」を選択
<!-- fotolife.wsf -->
<job id="InputBoxInJS">
<!-- http://stackoverflow.com/questions/532138/prompt-dialog -->
<script language="VBScript">
Function VBInputBox(promptText)
VBInputBox = InputBox(promptText)
End Function
</script>
<script language="JScript">
// ==UserScript==
// @name mata wikipedia yonderu
// @include http://*.wikipedia.org/wiki/*
// @include http://twitter.com/public_timeline?from=userjs
// ==/UserScript==
(function() {
if (location.href.indexOf('wikipedia.org')>0) {
var wikipe = function() {
var object = document.createElement('object');
javascript: (function(_HaH) {
var originalTitle = document.title;
var hintKeys = new String('asdfghjkl');
var choices = [];
var choice = '';
var xpath = '//a[@href]|//input[not(@type=\x22hidden\x22)]|//textarea|//select|//img[@onclick]|//button';
xpath += '|' + xpath.replace(/\/\//g, '//xhtml:');
var defaultType = 'HaHxlink';
function defaultAction(e) {
e.focus();
#control flows
#br inside block -> forward jump
#br inside loop -> backward jump
#if
ret = nil
catch(:a) do
/Users/atsushi/prog/rutie/examples/rutie_ruby_example% bundle exec rake test
bundle install
Using rake 10.5.0
Using ansi 1.5.0
Using builder 3.2.3
Using bundler 2.0.2
Using minitest 5.11.3
Using ruby-progressbar 1.10.1
Using minitest-reporters 1.3.6
Using color_pound_spec_reporter 0.0.9
// ==UserScript==
// @name jaro
// @namespace http://d.hatena.ne.jp/edvakf/
// @include http://www.google.co.jp/search*
// @include http://www.google.com/search*
// @license MIT license (http://www.opensource.org/licenses/mit-license.php)
// ==/UserScript==
// original script : https://gist.github.com/149474/35164ef7a57b2505097ca19e2af81d20f7ad00a6
// modified by : edvakf
// modified to use window.AutoPagerize.addDocumentFilter
@edvakf
edvakf / smc.c
Created November 10, 2012 01:13
SMC
/*
* Apple System Management Control (SMC) Tool
* Copyright (C) 2006 devnull
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
#include <stdio.h>
#include <stdlib.h>
#include "librtmp/rtmp.h"
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("usage : %s url ticket\n", argv[0]);
return 1;
}
@edvakf
edvakf / test.php
Last active June 30, 2017 01:43
collision rate of base64 of md5 split at 7th letter
#!php -d memory_limit=10G test.php
<?php
$a = [];
$total = 0;
$collision = 0;
for ($i = 0; $i < 100000000; $i++) {
$total += 1;
for ($j = 0; $j < 2; $j++) {