This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build our API request | |
let jsonRequest = [ | |
"requests": [ | |
"image": [ | |
"content": imageBase64 | |
], | |
"features": [ | |
[ | |
"type": "TEXT_DETECTION", | |
"maxResults": 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#文章をツイートする | |
import twitter | |
auth = twitter.OAuth(consumer_key="", | |
consumer_secret="", | |
token="", | |
token_secret="") | |
t = twitter.Twitter(auth=auth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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系統", "普通の人"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 自分のやつ | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
NewerOlder