Sunday, December 18, 2022

How to Install keypatch plugin for IDA

IDA keypatch install

Intro

IDA keypatch addons used to modify disasm code

Usage

right click on asm code, keypatch -> pacher, edit and comfirm
edit -> patch program -> apply patch to input file (create backup)

install

FAQ

except HTTPError, e

May be you take old version of keypatch.py, try to use new version without "except HTTPError, e" in source code

Sunday, May 9, 2021

๐Ÿ–•๐Ÿ–•๐Ÿ–•windows ftp server๐Ÿ–•๐Ÿ–•๐Ÿ–•

"FTP" and "Anonymous" are reserved words. You cannot create IIS Manager user accounts that contain these names.
even "ftp" in lower case

I take 3 hours to find out why login with ".\ftp" sucessful but not "ftp"

Sunday, November 18, 2018

https://stackedit.io/app# test

 Welcome file

Welcome to StackEdit!

Hi! I’m your first Markdown file in StackEdit. If you want to learn about StackEdit, you can read me. If you want to play with Markdown, you can edit me. Once you have finished with me, you can create new files by opening the file explorer on the left corner of the navigation bar.

Files

StackEdit stores your files in your browser, which means all your files are automatically saved locally and are accessible offline!

Create files and folders

The file explorer is accessible using the button in left corner of the navigation bar. You can create a new file by clicking the New file button in the file explorer. You can also create folders by clicking the New folder button.

Switch to another file

All your files are listed in the file explorer. You can switch from one to another by clicking a file in the list.

Rename a file

You can rename the current file by clicking the file name in the navigation bar or by clicking the Rename button in the file explorer.

Delete a file

You can delete the current file by clicking the Remove button in the file explorer. The file will be moved into the Trash folder and automatically deleted after 7 days of inactivity.

Export a file

You can export the current file by clicking Export to disk in the menu. You can choose to export the file as plain Markdown, as HTML using a Handlebars template or as a PDF.

Synchronization

Synchronization is one of the biggest features of StackEdit. It enables you to synchronize any file in your workspace with other files stored in your Google Drive, your Dropbox and your GitHub accounts. This allows you to keep writing on other devices, collaborate with people you share the file with, integrate easily into your workflow… The synchronization mechanism takes place every minute in the background, downloading, merging, and uploading file modifications.

There are two types of synchronization and they can complement each other:

  • The workspace synchronization will sync all your files, folders and settings automatically. This will allow you to fetch your workspace on any other device.

    To start syncing your workspace, just sign in with Google in the menu.

  • The file synchronization will keep one file of the workspace synced with one or multiple files in Google Drive, Dropbox or GitHub.

    Before starting to sync files, you must link an account in the Synchronize sub-menu.

Open a file

You can open a file from Google Drive, Dropbox or GitHub by opening the Synchronize sub-menu and clicking Open from. Once opened in the workspace, any modification in the file will be automatically synced.

Save a file

You can save any file of the workspace to Google Drive, Dropbox or GitHub by opening the Synchronize sub-menu and clicking Save on. Even if a file in the workspace is already synced, you can save it to another location. StackEdit can sync one file with multiple locations and accounts.

Synchronize a file

Once your file is linked to a synchronized location, StackEdit will periodically synchronize it by downloading/uploading any modification. A merge will be performed if necessary and conflicts will be resolved.

If you just have modified your file and you want to force syncing, click the Synchronize now button in the navigation bar.

Note: The Synchronize now button is disabled if you have no file to synchronize.

Manage file synchronization

Since one file can be synced with multiple locations, you can list and manage synchronized locations by clicking File synchronization in the Synchronize sub-menu. This allows you to list and remove synchronized locations that are linked to your file.

Publication

Publishing in StackEdit makes it simple for you to publish online your files. Once you’re happy with a file, you can publish it to different hosting platforms like Blogger, Dropbox, Gist, GitHub, Google Drive, WordPress and Zendesk. With Handlebars templates, you have full control over what you export.

Before starting to publish, you must link an account in the Publish sub-menu.

Publish a File

You can publish your file by opening the Publish sub-menu and by clicking Publish to. For some locations, you can choose between the following formats:

  • Markdown: publish the Markdown text on a website that can interpret it (GitHub for instance),
  • HTML: publish the file converted to HTML via a Handlebars template (on a blog for example).

Update a publication

After publishing, StackEdit keeps your file linked to that publication which makes it easy for you to re-publish it. Once you have modified your file and you want to update your publication, click on the Publish now button in the navigation bar.

Note: The Publish now button is disabled if your file has not been published yet.

Manage file publication

Since one file can be published to multiple locations, you can list and manage publish locations by clicking File publication in the Publish sub-menu. This allows you to list and remove publication locations that are linked to your file.

Markdown extensions

StackEdit extends the standard Markdown syntax by adding extra Markdown extensions, providing you with some nice features.

ProTip: You can disable any Markdown extension in the File properties dialog.

SmartyPants

SmartyPants converts ASCII punctuation characters into “smart” typographic punctuation HTML entities. For example:

ASCII HTML
Single backticks 'Isn't this fun?' ‘Isn’t this fun?’
Quotes "Isn't this fun?" “Isn’t this fun?”
Dashes -- is en-dash, --- is em-dash – is en-dash, — is em-dash

KaTeX

You can render LaTeX mathematical expressions using KaTeX:

The Gamma function satisfying ฮ“(n)=(n1)!nN\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N is via the Euler integral

ฮ“(z)=0tz1etdt . \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.

You can find more information about LaTeX mathematical expressions here.

UML diagrams

You can render UML diagrams using Mermaid. For example, this will produce a sequence diagram:

AliceBobJohnHello Bob, how are you?How about you John?I am good thanks!I am good thanks!Bob thinks a longlong time, so longthat the text doesnot fit on a row.Checking with John...Yes... John, how are you?AliceBobJohn

And this will produce a flow chart:

Link text
Square Rect
Circle
Round Rect
Rhombus

idea[2018.2] create spring mvc and react mixing project

1. create spring mvc project
2. bash change current directory to "{project dir}/src/main", create reactproject with "create-react-app webapp.mobile.react"
3 modify "package.json" add "homepage": "./",
because default file link start with /
4. mark "webapp.mobile.react" directory as "sources root" in idea
5. create an ant file named "build.xml" in project root, fill with:

<?xml version="1.0" encoding="UTF-8"?>
<project name="wechatlogin" default="build">

  <property name="mobile.react" value="${basedir}/src/main/webapp.mobile.react"/>

  <target name="build" description="hello">
    <exec executable="/usr/bin/npm" dir="${mobile.react}">
      <arg value="run"/>
      <arg value="build"/>
    </exec>
  </target>
</project>

6. idea: "view -> tool window -> Ant Build" import build.xml
7. idea project config -> modules: config module "web" as follow:
a. web source directory: add "webapp.mobile.react/build" to "/mobile"
b. check "source roots" on the bottom with "java","resource","webapp.mobile.react"
8. idea config artifact: create new "web application" explorer or archive
a. config output layout, add java class, lib into WEB-INF output dir, add web facet resource to output root dir
b in "pre process" tab, checked "run ant target: build"
10. deploy as same as normal, eg: deploy to /spring3

finnal:
http://ip/spring3/ [test ok]
http://ip/spring3/mobile [test ok]

Saturday, June 23, 2018

make ESP8266 RELAY V3(LC Technology) useable , no longer a toy !

0X00 Background:
    ESP8266 RELAY V3(LC Technology) come with ESP8266-01 module + baseboard (with ssr), but, there is always a but, when power down and reboot it, the configuration is gone, should use AT command to config it again, eg: WIFI essid password can not store on chip.

0X01 GOAL:
     Http-GET control ssr -- ESP8266 RELAY V3(LC Technology)

0X02 Attention:
    This tutorial will erase every thing on ESP8266-01 module, your module will *NOT* support AT command anymore.

0XFF Tutorial here:
1. connect and prepare to flashing
REFERENCE:
esp8266_series_modules_user_manual_v1.1.pdf : 2.2 Boot Mode
How to use the ESP8266-01 pins

Get ESP8266-01 module down from baseboard, connect to *3.3V* USB-TTL as follow:
ESP8266-01 | USB-TTL
TX - RX
EN - resistance(560R works) - VCC3.3
RST - resistance(560R works) - VCC3.3
3V3 - VCC3.3
GND - GND
IO2 - VCC3.3
IO0 - GND
RX -TX

2. connect USB-TTL to pc usb port(OS arch linux here, windows will  be OK)
bash: ls /dev/ttyUSB*; sudo chmod 666 /dev/ttyUSB*

3. download Arduino IDE, and configuration
3.1 File -> Preferences: fill Additional board manager URLs as:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
3.2 Tool -> board -> Boards Manager -> install esp8266 by ESP8266 Community (version 2.4.1 here)

4. write code and flashing
REFERENCE:
wifi connection example
esp8266wifi library reference
arduino code reference

Tool -> Board -> Generic ESP8266 Module
Tool -> Flash Size -> 8M
Tool -> Upoad Speed -> 115200
Tool -> Port -> /dev/ttyUSBx

code as following, change #define suitable to your network, and compile & upload
#include
#include
#include

#define MDNSNAME "testlight"
#define ESSID "<your wifi  essid>"
#define WIFIPASS "<your wifi password>"

byte openstr[] = {0xA0, 0x01, 0x01, 0xA2};
byte closestr[] = {0xA0, 0x01, 0x00, 0xA1};

ESP8266WebServer server(80);

void ssr(bool of=false) {
  if(of)
    Serial.write(openstr, sizeof(openstr));
  else
    Serial.write(closestr, sizeof(closestr));
}

void handleRoot() {
  server.send(200, "text/plain", "/?ssr=on/off");
  if (server.hasArg("ssr")) {
    if (server.arg("ssr") == "on") {
      ssr(true);
    }
    else if (server.arg("ssr") == "off") {
      ssr(false);
    }
    server.send(200, "text/plain", "ssr="+server.arg("ssr"));//this line  not works, fix it later
  } else {
    server.send(200, "text/plain", "/?ssr=on/off");
  }
}

void handleNotFound(){
  handleRoot();
}

void setup() {
  Serial.begin(9600);
  WiFi.begin(ESSID, WIFIPASS);
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());

  if (!MDNS.begin(MDNSNAME)) {
  Serial.println("Error setting up MDNS responder!");
  }
  Serial.println("mDNS responder started");

  server.on("/", handleRoot);
  server.onNotFound(handleNotFound);
  server.begin();
  Serial.println("HTTP server started");
}

void loop() {
  server.handleClient();
}

5. Test
bash: ping testlight.local
eg: 192.168.1.123
http://192.168.1.123/?ssr=on
http://192.168.1.123/?ssr=off


Tuesday, March 19, 2013

mplayer steal focus in awesome wm

mplayer use as mtv player in dualhead screen, it steal keyboards focus when open a new video.

awesome-3.4.11

Modify rc.lua as follow:

awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = true,
    -- focus = flase,
    -- focus = awful.client.focus.filter,
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
      properties = { floating = true, focus=false } },
    { rule = { class = "pinentry" },
      properties = { floating = true } },
    { rule = { class = "gimp" },
      properties = { floating = true } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    -- { rule = { class = "Firefox" },
    --   properties = { tag = tags[1][2] } },
    -- Set Firefox to always map on tags number 2 of screen 1.
    { rule = { class = "Chrome" },
     properties = { tag = tags[1][6] } },
    { rule = { class = "Thunderbird" },
     properties = { tag = tags[1][7] } },
    { rule = { class = "Ktouch" },
     properties = { tag = tags[1][8] } },
    { rule = { class = "VBoxSDL" },
     properties = { tag = tags[1][8] } },
    { rule = { class = "VirtualBox" },
     properties = { tag = tags[1][8] } },
}


Monday, November 29, 2010

charging ipod shuffle (the simple way)

just:
eject /dev/sdb
OK, linux will not transmission any data with ipod now.
AND, ipod light will not show as flashing,
AND, when battery full, ipod will turn the green light on.