2015年5月28日 星期四

利用AxCrypt自動對檔案加密

 

  最近因為備份資料庫的東西需要做異地備份,但是又被挑戰有沒有加密,如果資料被拿走怎麼辦,好吧,就去找了一個可以加密的軟體,找到的加密軟體為AxCrypt
http://www.axantum.com/AxCrypt/Downloads.html 下載網址
我覺得這個還不錯的是可以做成自解加密檔
然後另外一個就是可以用command line的方式執行,官網也有詳細的參數可以參考

加密成程式的加密格式
"%ProgramFiles%\Axantum\AxCrypt\AxCrypt.exe" -e -k "加密的密碼" -z 要加密的檔案 
缺點是一定要安裝這套加密軟體,不然無法解密
前面的%ProgramFiles%為環境變數,echo出來會是c:\Program Files,安裝完軟體預設會是在這個路徑下
-e為定義所要加密的檔案
-k為要加密的密碼
-z為加密檔案

加密成自解加密檔
"%ProgramFiles%\Axantum\AxCrypt\AxCrypt.exe"  -k "加密的密碼" -j 要加密的檔案
缺點會多增加一個檔案,會多佔用硬碟空間
-j為加密為exe自解檔

詳細參數
-i [.ext]InstallSet all registry values to default. Set the extension to associate with AxCrypt - default is .axx.
-pPsp testTest for the need to install psapi.dll. Only relevant on NT. If return code is 0, no need. This is an installation helper function only.
-uUninstallClear all registry values.
-xeXitEnd the resident server process, if loaded.
-lLicenseStart the license manager dialog.
-b tagBatch idDefine a tag, or batch id, to be used with subsequent pass phrases. These pass phrases will only be used when the same tag is specified in future calls to AxCrypt. The batch id is a decimal non-zero positive 32-bit signed integer. Odd values are reserved for internal use. If no -b option is given, saved pass phrases are 'global'. All tagged pass phrases are saved until cleared with -t.
-fToggle Fast modeWill modify certain operations to execute fast, rather than safe and/or secure. There is no guaranteed effect. Initially off.
-cToggle Copy-only flagCauses subsequent -d and -z to retain the originals. May be combined with -f for fast copy without wiping of temporaries. Initially off.
-gToggle ignore encrypted flagIf set, attempted encryption of already encrypted files will do nothing. Initially off.
-nOutput NameDefines a file name to be used as output instead of default for the next -z or -d.
-mToggle recurse flagIf set, causes subsequent wild card file names to search into sub-directories. Initially off.
-eEncryption pass phrase definitionSubsequent -a or -k options on this invocation define the default encryption key instead of one of possibly many decryption keys. The -b option may be used to define pass phrases with limited context.
-aAdd pass phrasePrompt for a pass phrase using the AxCrypt standard safe dialogues. -b and -e may be used as modifiers.
-k "pass phrase"Cache pass phraseCache the given pass phrase, quotes are recommended. The pass phrase is case-sensitive. -b and -e may be used as modifiers. Note that there are restrictions for what passphrases may be used in the AxCrypt dialogs - these are not enforced here! See below for allowed characters in passphrases.
-O "Path2Exe"Set Open ExecutableModify a subsequent -o (Open for edit) to use the specified executable instead of the automatic association by extension.
-zencryptEncrypt (and if useful compress) the given file(s) with either the current default encryption key, or with one that is prompted for. The originals are wiped. -b, -c, -g, -f and -n may be used as modifiers.
-Jself-decrypt encryptEncrypt (and if useful compress) and copy the given file(s) with either the current default encryption key, or with one that is prompted for to a self-decrypting executable archive. -b, -g and -n may be used as modifier. Default is to ignore files that already are self-decrypting.
-Kmake Key-fileGenerate and store a Key-file in the given folder, or directly to the given full path-name.
-dDecryptDecompress and decrypt the given file(s) with either a cached key, or with one that is prompted for. -b, -c, -f and -n may be used as modifiers.
-oOpenOpen the given file(s) with the appropriate application after temporary decryption and decompression. If they are modified after application exit, they are re-encrypted with the same pass phrase. -b may be used as modifier.
-v noverride wipe passesSets an override of the number of passes for wipe for the remainder of the command line. See -V for more info.
-V nwipe passesSets the global persistent default number of wipe passes when overwriting, 1-7. Default if not set is 1. The full set of 7 passes will overwrite in the following sequence: random, ones, zeroes, random, zeroes, ones, random. If less are specified only the last n passes are performed. Thus, -V 3 corresponds to the DoD 5220.22-M standard for sanitizing data on fixed hard disks.
-wWipeWipe the given files and delete. Show a confirmation warning first.
-swipe SilentWipe the given files and delete, but do not ask for confirmation.
-qQuery pass phrase cacheReturn exit code 0 if all files given have pass phrases in the cache already. -b may be used as modifier.
-hAnonymous renameRenames the given file(s) to anonymous names. The original names will be restored on decryption.
-tClear pass phrase cacheClear the internal pass phrase cache. If -b is given, only pass phrases associated with that tag are affected, otherwise all are removed, tagged and un-tagged alike.

by Johnny

2015年5月25日 星期一

如何更新(upgrade)windows Xampp的MySQL


  在XAMPP程式裡會安裝Aparch、MySQL、Perl、PHP等套件,但是如果要更新裡面的套件又不像安裝一般MySQL一樣,更新方式如下:

1、在更新前一定要事先備份,首先要先停止MySQL資料庫服務
指令方式:net stop mysql
GUI方式:電腦右鍵→管理→服務→找到MySQL服務停止
2、備份XMAPP安裝目錄裡的mysql資料夾
3、下載要更新的MySQL程式
4、這時先安裝在其他目錄資料夾下,如c:\或是d:\下面
在安裝過程中只安裝MySQL server就可以,其他不裝
最後裝完也不要啟動configure也不要開啟服務
5、在XMAPP資料夾底下更改mysql資料夾檔名,如mysql-old,之後建立新資料夾mysql
在新安裝的c:\mysql或是d:\mysql資料夾裡複製lib、share、bin三個資料夾到新建立的mysql資料夾
再到mysql-old把data資料夾復製到新mysql資料夾
6、最後最重要的是在mysql-old資料夾裡的bin資料夾找到my.ini檔案,複製到新的mysql資料夾的相同路徑底下
7、開啟服務
net start mysql

結束

By Johnny

2015年5月18日 星期一

win8系統進入安全模式



  看一大堆網頁都進入登入畫面後才做設定進入安全模式,阿就進得去登入畫面了還需要進入安全模式嗎?

只要在電腦開機前按住win鍵+F8再開機會進入到系統修復模式
選擇進階修復後選系統設定會直接重新開機進入boot選單畫面
選項就會有進入安全模式的選項

這樣做會比較合理吧



By Johnny

2014年10月15日 星期三

利用windows指令執行備份(增加時間參數)



差異備份

XCOPY 來源 目的  /D /K /E /Y /C

/D:日期,不指定則備份日期不同的資料
/K:複製屬性。一般 Xcopy 將會重設唯讀屬性。
/E:複製每個目錄及子目錄,包含空目錄。
/Y:不要提示您確認是否要覆寫已存在的目的地檔案。
/C:即使發生錯誤,仍繼續複製。
最近想說只備份當天的資料就好了,雖然有日期的參數但是總不可能自己天天用手打
就發現了windows也有類似時間的參數
下指令echo %date%會顯示當天的時間
但XCOPY的時間參數是m-d-y,跟windows秀出來的格式不同
不過還好windows也有類似Linux的cut功能
如要抓2015這四個數字方法為:%date:~0,4%;這個意思就是顯示出來的字元從第0個字元開始抓後面4個字元,這樣抓出來就是2015
如要抓月份方法為:%date:~5,2%;這樣就可以抓出05這兩個數字了
日期就以此類堆
這樣XCOPY的格式就可以自己寫出來了,以下範例
XCOPY 來源位置 /D:%date:~5,2%-%date:~8,2%-%date:~0,4% /K /E /Y /C 目的位置
這樣抓出來的資料就一直會是當天的資料了

備份刪除

forfiles /p 目錄位置 /d -7 /c "cmd /c del @path"

指令為刪除7天前的資料,7天為修改日期




By Johnny

2014年5月11日 星期日

安裝MSSQL 出現「效能計數器登錄區一致性」檢查失敗

出處http://yuta2.pixnet.net/blog/trackback/801ea8605e/43352278
因為我遇到又找到了解決辦法
就引用一下怕自己忘記

  如果是HP server用smartstart安裝OS的話我看都會遇到這個問題


方法如下: 
 1.   Regedit
 2.   找到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\0404 發現裡面沒有任何資料。 
描述: C:\Users\Yuta2.CFT\AppData\Local\Temp\SNAGHTML68f69cc.PNG
 3.   發現0404之下有一個 CurrentLanguage,按右鍵,選擇「匯出」
 4.   編輯匯出的檔案。將 CurrentLanguage改為 0404 。改完之後存檔。
 5.   匯入剛剛改好的登錄檔。匯入後檢查一下HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\0404 這時候應該會出現 Counter跟Help 。
 6.   到SQL的安裝程式中再檢查一次,如果沒意外應該就順利過關了。

2014年4月7日 星期一

如何還原xp mode password

How to reset XP Mode user password ~.~

Remove Integration Mode
try the original password, if it failed try following steps:
  • 1. Reboot in to safe mode (When boot up, press F8)
  • 2. Log in with the administrator and no password
  • 3. Go into users accounts
  • 4. Modify password of XPMuser or Create a new admin account with a password.
  • 5. Exit out and reboot in normal mode.
  • 6. Login using your new account name and password.
  • 7. Enable Integration Mode.

跟一般xp還原一樣,重點是F8

2014年4月1日 星期二

windows2003利用xp光碟開啟還原功能

1、準備好xp安裝光碟把i386\sr.in_裡面的檔案複製出來,可用如下指令
expand E:\I386\sr.in_ c:\sr.inf
把光碟裡資料夾i386裡的sr.in_複製並改檔名為sr.inf

2、把複製出來的檔案按右鍵執行安裝,會有錯誤訊息說找不到安裝程式,指定xp光碟裡的i386裡的sr_sys檔案

3、先不重開機,執行裡打regedit選[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SvcHost]找檔名為netsvcs編輯

把如下的文字複製進去,確定重開就有系統還原可以用了
AudioSrv
Browser
CryptSvc
DMServer
EventSystem
HidServ
Ias
Iprip
Irmon
LanmanServer
LanManWorkstation
Messenger
Netman
Nla
Ntmssvc
NWCWorkstation
Nwsapagent
Rasauto
Rasman
Remoteacess
Savsvr
Schedule
Seclogon
SENS
Sharedaccess
Themes
TrkWks
TrkSvr
W32Time
WZCSVC
Wmi
WmdmPmSp
winmgmt
wuauserv
BITS
ShellHWDetection
helpsvc
uploadmgr
WmdmPmSN
SRService