2016年10月7日 星期五

Python install package

*Open package management PIP install

You should install the pip :
 #download get-pip.py and exeic
py get-pip.py
Requirement already up-to-date: pip in c:\users\andychung\appdata\local\programs\python\python35-32\lib\site-packages

# check the pip tools
pip list
hexdump (3.3)
pip (8.1.2)
python-evtx (0.5.0)
setuptools (20.10.1)
simplejson (3.8.2)
six (1.10.0)
wheel (0.29.0)


Ref: https://packaging.python.org/installing/#use-pip-for-installing


*Self PACKAGE  install

 python setup.py install

example:
git clone https://github.com/williballenthin/python-evtx

Reference: https://packaging.python.org/distributing/#setup-py

2016年8月26日 星期五

python sqlite interface

1.  Connection to DB and import many records



import sqlite3
conn = sqlite3.connect('C:\\sqlite\\IE11.sqlite')
c = conn.cursor()
c.executemany('INSERT INTO PCInfo(log,ip,pcname,IE,home) VALUES (?,?,?,?,?)', records)
conn.commit()



REF
official sqlite3

sqlite install in windows 64bits

1. Download from sqlite  https://sqlite.org/download.html

sqlite-dll-win64-x64-3140100.zip
sqlite-tools-win32-x86-3140100.zip


2. Create Folder and unzip 

.mkdir  in C:\sqlite
.unzip above  two zip











3. launch the sqlite 

cd c:\sqlite
sqlite3.exe

SQLite version 3.14.1 2016-08-11 18:53:32
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.


4. How to use 

.open test.sqlite
CREATE TABLE users (id integer primary key autoincrement, name text not null);
insert into users (name) values('jon');
insert into users (name) values('paul');
sqlite> select * from users;
1|john
2|paul

the .open is the command for create/connection database
other .tables or .drop



Reference :
First_Installing-and-Using-SQLite-on-Windows
Appropriate Uses For SQLite
SQLite vs MySQL


Python 3.5 windows install

1. Download site  https://www.python.org/downloads/

2.  Install it and will in the
C:\Users\andychung\AppData\Local\Programs\Python\Python35-32

3. default python will launch by py
cmd
py some_script

InstallREference GOOD
https://docs.python.org/3/using/windows.html
https://docs.python.org/3.3/using/windows.html




2016年8月10日 星期三

windows Regedit File Command add / delete



Using the reg command
Action: add, delete

If delete:

reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /f




From REF
修改(包括新增)登錄檔。範例:
reg add "HKCU\Keyboard Layout\Toggle" /v "Layout Hotkey" /d "2" /t REG_SZ /f
HKCU 是 HKEY_CURRENT_USER 的縮寫。
/v 後面寫:regedit 登錄編輯程式右半邊視窗登錄檔條目的名稱。
/d 後面寫:regedit 登錄編輯程式右半邊視窗登錄檔條目的數值。
/t 後面寫:regedit 登錄編輯程式右半邊視窗登錄檔條目的類型。如果你不知道你要修改的登錄檔是什麼類型,就到登錄編輯程式右半邊視窗那裡看一下,常見的有 REG_SZ、REG_DWORD。



2016年7月20日 星期三

VBS parameter space especialy using path


Solution:
Using the chr(34) and eval to run the command like linux eval run raw command


Example:
 strCommand =
 "%comspec% /c move %USERPROFILE%\IE11Doc.bat  %USERPROFILE%\" & chr(34) & "A BC" & chr(34)

#comspec is the exec, /c is close message, chr(34) mean qute

Wscript.Echo  strCommand
# the content will be presented %comspec% /c move  %userprofile%\IE11Doc.bat  %userprofile%\"A BC"

oShell.Run  strCommand, 0, True
# equal eval and runit, notice not using the run(...) no ( )


Noteice:
' K and run osrun/1 is show content for debug, convesty is  /c and 0 is no message

WIndow 自動啟動程式地方

Position 
1. 
C:\Users\使用者帳號\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup


2. 
上圖為 Windows 7 左下角「開始」鍵打開後的搜尋框,請直接輸入「msconfig」並按下 ENTER 即可。




REF