Skip to content

Instantly share code, notes, and snippets.

<?php
$file = "http://localhost:8888/sample/user.json";
$data= file_get_contents($file);
$user_data = array(
'name' => $user['name'],
'age' => $user['age'],
'language' => $user['language']
);
{
"id": "user1",
"index": 0,
"profileImage": "http://localhost:8888/sample/profile.png",
"guid": "9ca6cdad-fe76-45e2-bf46-7744799cbd87",
"isActive": true,
"age": 29,
"name": {
"first": "Mccullough",
"last": "Craft"
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import cv2
from PIL import Image
import pytesseract
import sys
import math
@mimaun
mimaun / q12.py
Created December 28, 2015 04:26
ksnctf Hypertext Preprocessor Writeup
#! /usr/bin/env python
# -*-coding: utf-8-*-
import requests
url = "http://ctfq.sweetduet.info:10080/~q12/index.php"
headers = { # Set the appropriate headers for the response
'Host': "ctfq.sweetduet.info:10080",
'User-Agent': 'Mozilla',
'Connection': 'keep-alive'
@mimaun
mimaun / file0.mat
Last active October 7, 2016 04:40
MATLABで画像取り込み・グレースケール・保存 ref: http://qiita.com/mimaun/items/ff9da5086f1b6238bfff
>> img = imread('bear.png'); %% load image file :)
>> imtool(img);
@mimaun
mimaun / CeasarII.py
Created June 11, 2015 06:43
Ceasar II [We Chall]
# -*- coding: utf-8 -*-
cipher = "0F 37 37 2C 20 32 37 2A 74 20 41 37 3D 20 3B 37 34 3E 2D 2C 20 37 36 2D 20 35 37 3A 2D 20 2B 30 29 34 34 2D 36 2F 2D 20 31 36 20 41 37 3D 3A 20 32 37 3D 3A 36 2D 41 76 20 1C 30 31 3B 20 37 36 2D 20 3F 29 3B 20 2E 29 31 3A 34 41 20 2D 29 3B 41 20 3C 37 20 2B 3A 29 2B 33 76 20 1F 29 3B 36 6F 3C 20 31 3C 07 20 79 7A 00 20 33 2D 41 3B 20 31 3B 20 29 20 39 3D 31 3C 2D 20 3B 35 29 34 34 20 33 2D 41 3B 38 29 2B 2D 74 20 3B 37 20 31 3C 20 3B 30 37 3D 34 2C 36 6F 3C 20 30 29 3E 2D 20 3C 29 33 2D 36 20 41 37 3D 20 3C 37 37 20 34 37 36 2F 20 3C 37 20 2C 2D 2B 3A 41 38 3C 20 3C 30 31 3B 20 35 2D 3B 3B 29 2F 2D 76 20 1F 2D 34 34 20 2C 37 36 2D 74 20 41 37 3D 3A 20 3B 37 34 3D 3C 31 37 36 20 31 3B 20 2E 2E 3B 2D 34 2B 38 36 2D 30 31 37 76"
cipher_no_space = cipher.split(" ")
hextTodecimal = []
for w in cipher_no_space:
# 16 -> 10
curl -b cookie.txt -c cookie.txt -X POST -d 'username=mimaun' -d 'password=pass' https://www.wechall.net/login
curl -b cookie.txt -X POST http://www.wechall.net/challenge/wannabe7331/limited_access/protected/protected.php
curl -b cookie.txt --request PATCH http://www.wechall.net/challenge/wannabe7331/limited_access_too/protected/protected.php
@mimaun
mimaun / ExampleAnnotation.java
Created May 31, 2015 09:58
Annotationのインスタンスを取得
import java.lang.annotation.*;
/* annotationを作成 */
// Retention: 新たにアノテーションNewAnnotationを作るとき、このアノテーション情報はソースコードのみにしか保存されないことを意味する.
@Retention(RetentionPolicy.RUNTIME)
// Target: このアノテーションをどの型に使うことができるかを指定している.
@Target(ElementType.METHOD)
@mimaun
mimaun / Programming1.py
Created May 29, 2015 04:00
WeChall Programming1(Timed out)
# -*- coding: utf-8 -*-
import mechanize
br = mechanize.Browser()
br.set_handle_robots(False)
# 仮想ブラウザが開いてログインページを読み込む.
br.open("http://www.wechall.net/login")
@mimaun
mimaun / AppDelegate.swift
Last active August 29, 2015 14:22
UINavigationControllerとUITabBarControllerを併用する
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// ViewControllerのインスタンス生成.