Skip to content

Instantly share code, notes, and snippets.

View seven0525's full-sized avatar

ahpjop seven0525

View GitHub Profile
@seven0525
seven0525 / inject.py
Created March 20, 2019 05:33 — forked from leonjza/inject.py
Wordpress 4.7.0/4.7.1 Unauthenticated Content Injection PoC
# 2017 - @leonjza
#
# Wordpress 4.7.0/4.7.1 Unauthenticated Content Injection PoC
# Full bug description: https://blog.sucuri.net/2017/02/content-injection-vulnerability-wordpress-rest-api.html
# Usage example:
#
# List available posts:
#
# $ python inject.py http://localhost:8070/
@seven0525
seven0525 / get_user_tweets_over200.py
Last active September 6, 2018 05:56
指定したユーザーのツイートを200件以上取得する方法(Twitter API使用)
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import json
from requests_oauthlib import OAuth1Session
from twitter import Twitter, OAuth
from janome.tokenizer import Tokenizer
import collections
import re
from collections import Counter, defaultdict
import sys, json, time, calendar
@seven0525
seven0525 / code_lstm.py
Created June 17, 2018 15:09
RADWIMPSっぽい曲LSTMで自動生成してみた(1)(歌詞と、コード進行のみ) ref: https://qiita.com/ahpjop/items/a1d2d159c614258828ab
from keras.layers import Dense, Activation, LSTM
from keras.optimizers import RMSprop
from keras.utils.data_utils import get_file
import numpy as np
import random
import sys
chars = sorted(list(set(text)))
print('Total chars:', len(chars))
@seven0525
seven0525 / VewController.swift
Last active June 27, 2018 05:15
一時停止してるし、レシート写真から情報を読みとるやつ自分で途中まで作ってみた ref: https://qiita.com/ahpjop/items/a36817bc5d8e25e634e3
// Build our API request
let jsonRequest = [
"requests": [
"image": [
"content": imageBase64
],
"features": [
[
"type": "TEXT_DETECTION",
"maxResults": 10
@seven0525
seven0525 / file3.txt
Last active August 8, 2018 14:58
落合陽一っぽいツイートを自動生成してツイートさせてみた ref: https://qiita.com/ahpjop/items/9f532a72ac4666b9083a
#文章をツイートする
import twitter
auth = twitter.OAuth(consumer_key="",
consumer_secret="",
token="",
token_secret="")
t = twitter.Twitter(auth=auth)
@seven0525
seven0525 / check.py
Last active June 2, 2018 13:25
顔写真から、乃木坂46系かAKB48系か一般人系か判定する学習モデル作ってみた ref: https://qiita.com/ahpjop/items/06d960a0f56635327669
from keras.models import Sequential
from keras.layers import Activation, Dense
from PIL import Image
import numpy as np, sys
classes = 3
photo_size = 75
data_size = photo_size * photo_size * 3
labels = ["48系統", "46系統", "普通の人"]
@seven0525
seven0525 / file3.txt
Last active April 1, 2019 06:46
「自作Python100本ノック」15日目(やっと最終日:96本〜100本目) ref: https://qiita.com/ahpjop/items/2c0ba1decdb60a6e643b
# 自分のやつ
def checkio(n):
list_n =[1,2,3,4,5,6,7,8,9]
if n < 10:
return n
factors = []
for d in range(9,1, -1):
if n >= 10 and n % d == 0 and d != 1:
factors.append(d)
@seven0525
seven0525 / q91.py
Last active June 7, 2018 14:12
「自作Python100本ノック」14日目(91本〜95本目) ref: https://qiita.com/ahpjop/items/dc68cc02bc2b2ac30669
def count_one(n):
counts = 0
for i in range(1,n+1):
str_i = str(i)
count = str_i.count("1")
counts += count
return counts
@seven0525
seven0525 / q89.py
Last active May 24, 2018 03:01
「自作Python100本ノック」13日目(Pythonおじさんへの道:89本〜90本目) ref: https://qiita.com/ahpjop/items/6e522cee43e01fbd9b49
def count_n(n_list):
counts = []
for n in n_list:
count = 0
while n % 2 == 0:
count += 1
n = n / 2
else:
counts.append(count)
aws = min(counts)
@seven0525
seven0525 / q81.py
Last active May 24, 2018 03:00
「自作Python100本ノック」12日目(81本〜88本目) ref: https://qiita.com/ahpjop/items/e86f361e903e3adb6f84
from itertools import combinations
def twosums(x, target):
for item in combinations(x, 2):
if sum(item) == target:
return item
nums = [2, 7, 11, 15]
target = 9
twosums(nums, target)