Bug in Python3.6 standard library when compile using MinGW

Python36 is compiled by Visual Studio 2015 or MSBuild tools 2015, which included Compiler v19.00 (MSC_VER 1600). But “C:\Python36\Lib\distutils\cygwinccompiler.py” can’t handle it…

I modify it simply like this:

Posted in Memo | Tagged , , , , , , , | Comments Off on Bug in Python3.6 standard library when compile using MinGW

USB3.0 Hub

I bought some USB3.0 hub, and look inside:)

Unitek Y-3043CBK, RTS5411, transfer stable and look pretty. This chip have EFuse ROM, so external SPI Flash is useless.

Continue reading

Posted in Memo | Tagged , , , , , | Comments Off on USB3.0 Hub

Xilinx update Spartan3AN device!

I found the release date of some XC3S50AN is 2014 or 2016! and Impact can’t download to In-System Flash, show me “SPI not found”…
But the older 2010’s IC is OK. After some searching…

Xilinx manufacturing Spartan3AN devices, not discontinued! And the flash density is changed.

https://www.xilinx.com/support/answers/59572.html

http://www.xilinx.com/support/documentation/customer_notices/xcn14003.pdf

Posted in Memo | Tagged , , | Comments Off on Xilinx update Spartan3AN device!

Dump PE file

I am using some tool to check a PE file (dll or exe) depends, most free tool support 32bits file.
So I decided to write an tool support 32bits and 64bits PE file.

The PE struct is defined in MinGW’s headers. So What I need to do is write a parser and make some test.

the PE file is like this

An example PE header is

Both EXE and DLL file, the first 128 bytes is the same. This a DOS program, which print that message above. The MAGIC is “MZ”

Then is `e_lfanew`, which is `80 00 00 00`, point to new NT header.

the NT header is:

The Opt Header is difference between 32bits and 64bits!
The first WORD of Opt header is magic, for 32bits is 0x010B, 64bits is 0x020B.

So we can write a script to show PE type

which will output like `file` command:

For more details, see the source code

https://github.com/buaabyl/pedump

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

Posted in Writing | Tagged , , , , | Comments Off on Dump PE file

Remove unnecessary php file please

When I analysis web server log file, I found this

That means someone checking my files, and want to get the MySQL password?

It is better to prevent this location in web server!

Posted in Memo | Tagged , , , , | Comments Off on Remove unnecessary php file please

the format of openssh public key

The openssh public key is like this :

using openssl to decode it:

And I write a python script to decode it, and found the format like this:

The sample python code:

Posted in Writing | Tagged , , , , | Comments Off on the format of openssh public key

Fix wordpress 301 loop when enable nginx…

I am try to setup Nginx as reverse proxy, backend is Apache, the problem is WordPress always 301 to the same URL even if the browser request that URL (301 loop).


client <---> nginx(https) <---> apache(http)

The problem is WordPress think the site is on port 80 enable https, but actually apache is on 8080 without https, and Nginx is on 80 with https, so it request 301 to that ‘correct’ site… See below.

After digging Google for a long time, and found some solutions at the end.

this is my solution temporary. Just comment out canonical, because I don’t need it.

update:

After trace Nginx and Apache traffic, I found that Nginx always add ‘index.php’ to ‘/’, then send to apache, but wordpress will make 301 redirect to ‘/’, so browser request ‘/’ again, when Nginx received, it add ‘index.php’ to it and send to apache again, loop…

the solution is:

And append this to wp-config.php

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

Posted in Memo | Tagged , , , | Comments Off on Fix wordpress 301 loop when enable nginx…

Opensource gpjtag adapter

I finished gpjtag on Aug 2016, so it is time to opensource.

http://github.com/buaabyl/gpjtag_stm32

Continue reading

Posted in General Jtag | Tagged , , , | Comments Off on Opensource gpjtag adapter

Enable Let’s Encrypt

I am using StartSSL free certificate before, but Chrome and Firefox begin to drop it.
So I change to Let’s Encrypt. It really work!!! Great!!!

And force all request to SSL.

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

Posted in Memo | Tagged , , | Comments Off on Enable Let’s Encrypt

Found final audit of Truecrypt report

I found the final report on opencryptoaudit.org, and the answer is Truecrypt is safe, great!
Or I think is safer than most open source crypto on the fly disk implement without UEFI.
Continue reading

Posted in Memo | Tagged , | Comments Off on Found final audit of Truecrypt report