Skip to content

Instantly share code, notes, and snippets.

@kaito834
kaito834 / pyCrypto_setup.py_build.txt
Last active August 29, 2015 14:26
This is snippet to encrypt or decrypt string by pyCrypto.
## Git Bash on Windows 10
$ git clone git@github.com:dlitz/pycrypto.git
Cloning into 'pycrypto'...
Enter passphrase for key '(snip)':
remote: Counting objects: 6554, done.
remote: Total 6554 (delta 0), reused 0 (delta 0), pack-reused 6554
Receiving objects: 100% (6554/6554), 3.78 MiB | 1.37 MiB/s, done.
Resolving deltas: 100% (3401/3401), done.
Checking connectivity... done.
@kaito834
kaito834 / import-myTestModule.py
Last active August 29, 2015 14:26
This is snippet to import my module; myTestModule.py and import-myTestModule.py were saved on same directory.
#!/usr/bin/env python
# coding: utf-8
# tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
'''
If you does NOT create .pyc file, run python.exe with -B option or
set non-empty value on PYTHONDONTWRITEBYTECODE, environment variable.
Ref.
@kaito834
kaito834 / refForBurpSuite.md
Created July 18, 2015 06:17
References for Burp Suite
@kaito834
kaito834 / splitStrByComma.py
Created July 18, 2015 03:08
Split str by comma, and validate the str whether those are decimal between 0 and 10
#!/usr/bin/env python
# tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
def main():
numbers = []
str = input('Please input numbers separated by comma: \n> ')
# https://docs.python.org/3/library/stdtypes.html#string-methods
@kaito834
kaito834 / diff_win.txt
Created July 11, 2015 04:16
Compare two files on Windows instead of "diff" command; "fc" command or Compare-Object cmdlet
$>type diff-test_a.txt
This is test string.
hoge fuga.
This is test.
$>type diff-test_b.txt
This is test string.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@kaito834
kaito834 / curl_range-globbing_sample.txt
Created June 1, 2015 15:18
Sample results of cURL's range globbing feature
# This is sample results of cURL's range globbing feature.
# I tested this on Windows 8.1.
#
# References:
# 'URL' section, http://curl.haxx.se/docs/manpage.html
$> curl -V
curl 7.38.0 (i386-pc-win32) libcurl/7.38.0 zlib/1.2.7
Protocols: dict file ftp gopher http imap ldap pop3 rtsp smtp telnet tftp
Features: AsynchDNS IPv6 Largefile libz
@kaito834
kaito834 / generateSSHkeysOnWindows.md
Created May 4, 2015 07:05
Generate SSH public/private keys on Windows.
@kaito834
kaito834 / re-multilines.py
Created April 26, 2015 12:32
Python 3.x script to match string over multi-lines by re library
#!/usr/bin/env python
#
# tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
import re
# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
# http://d.hatena.ne.jp/itasuke/20090815/p1 (in Japanese)
filename=r"C:\\Users\\kaito\\Documents\\mydata\\scripts\\re-multilines_sample.txt"
@kaito834
kaito834 / generateKeysByGpg.md
Last active August 29, 2015 14:19
Generate openPGP public/private keys by GPG

An Environment for this procedure

  • GnuPG(GPG) 2.0.x on Windows 8.1
    • We should latest gpg if no specific reasons.
    • I have used one Gpg4win contains

Procedure to generate keys

  1. Define parameters
  2. Generate public/private keys
  3. Generate revocation certificate