Skip to content

Instantly share code, notes, and snippets.

View duleitony's full-sized avatar

Lei Du duleitony

View GitHub Profile
@duleitony
duleitony / CreditCardNumberGenerator.java
Created January 27, 2016 02:14 — forked from josefeg/CreditCardNumberGenerator.java
Credit card number generator in Java
import java.util.Random;
/**
* A credit card number generator.
*
* @author Josef Galea
*/
public class CreditCardNumberGenerator {
private Random random = new Random(System.currentTimeMillis());
@duleitony
duleitony / InsecureHttpClient.java
Created June 14, 2016 05:17 — forked from jabbrwcky/InsecureHttpClient.java
A sample how to configure Apache HTTPClient (4.+) to accept SSL connections *without* certificate and hostname validation
package net.hausherr.sample;
import org.apache.http.client.CookieStore;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.routing.HttpRoutePlanner;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.conn.ssl.TrustStrategy;
@duleitony
duleitony / sniff.txt
Created July 13, 2016 05:49 — forked from manifestinteractive/sniff.txt
A friendly formatter for curl requests to help with debugging.
\n
============= HOST: ==========\n
\n
local_ip: %{local_ip}\n
local_port: %{local_port}\n
remote_ip: %{remote_ip}\n
remote_port: %{remote_port}\n
\n
======= CONNECTION: ==========\n
\n
@duleitony
duleitony / gist:92882ce8f5ed16cf8b772d24cd45ffcd
Created September 1, 2016 05:23 — forked from lanimall/gist:cb808a11a058f7fb620a
SSL Protocol Tests - TLSv1.2
public class SSLProtocolTests {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getInstance("TLSv1.2");
context.init(null,null,null);
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();
SSLSocket socket = (SSLSocket)factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
@duleitony
duleitony / gist:d907fd2d329ebb1b0d570e756a41492a
Created September 1, 2016 05:23 — forked from lanimall/gist:cb7d84c8d6c6301d4d0c
SSL Protocol Tests - Default
public class SSLProtocolTests {
public static void main(String[] args) throws Exception {
SSLContext context = SSLContext.getDefault();
SSLSocketFactory factory = (SSLSocketFactory)context.getSocketFactory();
SSLSocket socket = (SSLSocket)factory.createSocket();
String[] protocols = socket.getSupportedProtocols();
System.out.println("Supported Protocols: " + protocols.length);
for(int i = 0; i < protocols.length; i++)
@duleitony
duleitony / gist:389bcb65ef79718a0dbbf20688938eb2
Created September 8, 2016 07:01 — forked from bahayman/gist:9369651
tcpdump http monitor
Use TCPDUMP to Monitor HTTP Traffic
1. To monitor HTTP traffic including request and response headers and message body:
tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
2. To monitor HTTP traffic including request and response headers and message body from a particular source:
tcpdump -A -s 0 'src example.com and tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
3. To monitor HTTP traffic including request and response headers and message body from local host to local host:
@duleitony
duleitony / README-Template.md
Created July 11, 2017 06:50 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@duleitony
duleitony / カード決済業務のすべて_読書メモ.md
Created November 22, 2017 09:12
カード決済業務のすべて_読書メモ

1.決済カード業務の概要と実務

カードビジネスの仕組み

業法、主務官庁

日本における業法の守備範囲は以下の通り

  • 割賦販売法・・・クレジットカード
  • 貸金業法・・・キャッシングやカードローンなどの金融商品

所轄官庁は、クレジットカードが経済産業省、金融商品が金融庁
割賦販売法では以下の通り定義されている

  • クレジットカードを使ったショッピング・・・包括信用購入あっせん