$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 84:f3:eb:0b:dd:53
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 javax.crypto.Cipher; | |
import java.io.InputStream; | |
import java.security.*; | |
import java.util.Base64; | |
import static java.nio.charset.StandardCharsets.UTF_8; | |
public class RsaExample { | |
public static KeyPair generateKeyPair() throws Exception { | |
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); |
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
//client = HttpClient | |
//captchaUserId = user id from http://2captcha.com | |
private String solveCaptcha(WebDriver driver) throws Exception{ | |
WebElement captchaChallenge = driver.findElement(By.id("recaptcha_challenge_image")); | |
if (captchaChallenge != null){ | |
String imageURL = captchaChallenge.getAttribute("src"); | |
InputStream in = new BufferedInputStream(new URL(imageURL).openStream()); | |
ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
for (int i; (i = in.read()) != -1;){ |
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
//Generate a self signed X509 certificate with Bouncy Castle. | |
// StringBuilder sb = new StringBuilder(); | |
// | |
// for (int i = 0; i < pub.length; ++i) | |
// { | |
// sb.append(Integer.toHexString(0x0100 + (pub[i] & 0x00FF)).substring(1)); | |
// } | |
// | |
// System.out.println(sb); | |
// sb.setLength(0); |
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 cv2.cv as cv | |
import tesseract | |
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE) | |
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY) | |
api = tesseract.TessBaseAPI() | |
api.Init(".","eng",tesseract.OEM_DEFAULT) | |
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz") | |
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD) | |
tesseract.SetCvImage(gray,api) | |
print api.GetUTF8Text() |