Firefox text file viewer


用Firefox直接看文字檔,會有兩個問題:
  • wrap long lines
  • text / background color

wrap long lines

在Firefox 22以前沒有 Wrap long lines 的功能,有兩種方法可以解決:

命令列下複製多個檔案與批次轉換圖檔

Copy range of files

cp file{01..34}.bmp [dst]

Batch convert BMP to JPEG

  1. mogrify -format jpg *.bmp
  2. for i in *.bmp; do convert ${i} ${i%bmp}jpg; done # {i%bmp} 會把bmp去除
  3. find -name *.bmp -type f -exec convert '{}' '{}'.jpg ;
Reference:

Build KeePassX v2.0 alpha4


KeePassX終於可以相容於Keepass2了, 這下可以擺脫keepass2 + mono了。
主要是使用mono的程式目前只有keepass2。但是卻要消耗500Mib+的硬碟空間=_=
外加程式反應慢,輸入/顯示等問題。

System: Linux Mint 13

下載:
Source code

編譯前準備:
  • cmake
  • libgcrypt11-dev
  • zlib1g-dev
Steps:
  1. mkdir build
  2. cd build
  3. cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_VERBOSE_MAKEFILE=ON
  4. make -j2
  5. checkinstall -D make install #製作.deb包,並方便日後刪除
Reference:

[SFC] Der Langrisser

修改檔案: *.bst(bsnes即時存檔)

Search Pattern
===============================================
mp1 mp2 AT DF          > mp1‧mp2‧魔法‧召喚
MV 指揮範圍 AT+ DF+     > mp1‧mp2‧魔法‧召喚

mp LV EXP AT DF        > mp(不會隨過關失效),可僱用傭兵數量,可僱用傭兵種類

修改標的
===============================================
[角色] 第???章

* mp1(現時MP, Scenario內有效,過關後設定為mp)
* mp2(最大MP, Scenario內有效,過關後設定為mp)
* 魔法1~3
* 召喚(含部份魔法)
* mp(修改一次,所有Scenario有效)
* 可僱用傭兵數量
* 可僱用傭兵種類

「準備畫面」中可以修改上述所有項目
「Scenario」中則只能修改mp1, mp2, 魔法,召喚,裝備1,裝備2等項目

================        ===============================================
offset                  description
================        ===============================================
0x6744                  Gold(Max: 65535)
0x6746                  Item1
                        0x6746:道具種類
                        0x6747:道具裝備者
0x678E                  道具欄倒數第4格(道具會自動整理,由道具欄的倒數往前改以避免覆蓋已有道具)

[エルウィン]          
0xFB70                  裝備1
0xFB71                  裝備2              
0xFA9F                  mp1
0xFAA0                  mp2
0xFAB7                  魔法1~3
0xFABA                  召喚
0x6489                  mp
0X6494(1)               可僱用傭兵數目
0x6495~0x649D           可僱用傭兵種類1~9(FF*8, 1F*1)

[ヘイン]
0xFBD0                  裝備1
0xFBD1                  裝備2
0xFAFF                  mp1
0XFB00                  mp2
0xFB17                  魔法1~3                                        
0XFB1A                  召喚         
0x6519                  mp
0x6524                  可僱用傭兵數目
0x6525~0x652D           可僱用傭兵種類1~9(FF*8, 1F*1)

==========================================================================
光輝路線
==========================================================================
[スコット] 第二章
0xFB5F                  mp1
0xFB60                  mp2
0xFB77                  魔法
0xFB7A                  召喚
0x653D                  mp
0x6548                  可僱用傭兵數目
0x6549~0x6551           可僱用傭兵種類

[ロウガ] 第三章中途加入的修改位置
0xFB90                  裝備1
0xFB91                  裝備2
0xFBBF                  mp1
0xFBC0                  mp2                       
0x65F1                  mp
0xFBD7~0xFBD9           魔法
0xFBDA                  召喚
0x65FC                  可僱用傭兵數目
0x65FD~0X6605           可僱用傭兵種類                 

[シェリー] 第四章
0xFC1F                  mp1
0xFC20                  mp2
0xFC37~0xFC39           魔法1~3
0xFC3A                  召喚
0x64F5                  mp
0x6500                  可僱用傭兵數量
0x6501~0x6509           可僱用傭兵種類

[リアナ] 第四章
0xFC7F                  mp1
0xFC80                  mp2
0xFC97~0xFC99           魔法1~3
0xFC9A                  召喚
0x64AD                  mp
0x64B8                  可僱用傭兵數量
0x64B9~0x64C1           可僱用傭兵種類

[キース] 第五章
0xFC7F                  mp1
0xFC80                  mp2
0xFC97~0xFC99           魔法1~3
0xFC9A                  召喚
0x6561                  mp
0x656C                  可僱用傭兵數量
0x656D~0x6575           可僱用傭兵種類

[レスター] 第六章
0xFC7F                  mp1
0xFC80                  mp2
0xFC97~0xFC99           魔法1~3
0xFC9A                  召喚
0x65A9                  mp
0x65B4                  可僱用傭兵數量
0x65B5~0x65BD           可僱用傭兵種類

[アーロン] 第十章
0xFCDF                  mp1
0xFCE0                  mp2
0xFCF7~0xFCF9           魔法1~3
0xFCFA                  召喚
0x6585                  mp
0x6590                  可僱用傭兵數量
0x6591~0x6599           可僱用傭兵種類

[ラーナ] 第十七章
0xFD3F                  mp1
0xFD40                  mp2
0xFD57~0xFD59           魔法1~3
0xFD5A                  召喚
0x64D1                  mp
0x64DC                  可僱用傭兵數量
0x64DD~0x64E5           可僱用傭兵種類

==========================================================================
帝國路線
==========================================================================
[レオン] 第8章
0xFBBF                  mp1
0xFBC0                  mp2
0xFBD7~0xFBD9           魔法
0xFBDA                  召喚
0x6639                  mp
0x6644                  可僱用傭兵數量
0x6645~0x664E           可僱用傭兵種類

[イメルダ] 第8章-第6回合加入
0xFC1F                  mp1
0xFC20                  mp2
0xFC37~0xFC39           魔法1~3
0xFC3A                  召喚
0x6681                  mp
0x668C                  可僱用傭兵數量
0x668D~0x6695           可僱用傭兵種類

[バルガス] 第12章
0xFC7F                  mp1
0xFC80                  mp2
0xFC97~0xFC99           魔法1~3
0xFC9A                  召喚
0x665D                  mp
0x6668                  可僱用傭兵數量
0x6669~0x6670           可僱用傭兵種類

[エグベルト] 第13章
0xFCDF                  mp1
0xFCE0                  mp2
0xFCF7~0xFCF9           魔法1~3
0xFCFA                  召喚
0x66A5                  mp
0x66B0                  可僱用傭兵數量
0x66B1~0x66B9           可僱用傭兵種類

[ソニア] 第18章
0xFD3F                  mp1
0xFD40                  mp2
0xFD57~0xFD59           魔法1~3
0xFD5A                  召喚
0x6615                  mp
0x6620                  可僱用傭兵數目
0x6621~0x6629           可僱用傭兵種類

==========================================================================
獨立路線
==========================================================================
[ロウガ] 第三章中途加入的修改位置
0xFB90                  裝備1
0xFB91                  裝備2
0xFBBF                  mp1
0xFBC0                  mp2                       
0x65F1                  mp
0xFBD7~0xFBD9           魔法
0xFBDA                  召喚
0x65FC                  可僱用傭兵數目
0x65FD~0X6605           可僱用傭兵種類  

[ソニア] 第12章加入的修改位置
0xFB90                  裝備1
0xFB91                  裝備2
0xFBBF                  mp1
0xFBC0                  mp2
0xFBD7~0xFBD9           魔法
0xFBDA                  召喚
0x6615                  mp
0x6620                  可僱用傭兵數目
0x6621~0x6629           可僱用傭兵種類

[エスト] 第12章加入的修改位置
0xFBF0                  裝備1
0xFBF1                  裝備2
0xFC1F                  mp1
0xFC20                  mp2
0xFC37 ~ 0xFC39         魔法
0xFC3A                  召喚
0x66C9                  mp
0x66D4                  可僱用傭兵數目
0x66D5~0x66DD           可僱用傭兵種類

[オスト] 第12章加入的修改位置
0xFC50                  裝備1
0xFC51                  裝備2
0xFC7F                  mp1
0xFC80                  mp2
0xFC97 ~ 0xFC99         魔法
0xFC9A                  召喚
0x66ED                  mp
0x66F8                  可僱用傭兵數目
0x66F9~0x6701           可僱用傭兵種類

==========================================================================
黑暗路線
==========================================================================
[リアナ] 第17章
0xFD3F                  mp1
0xFD40                  mp2
0xFD57~0xFD59           魔法1~3
0xFD5A                  召喚
0x64AD                  mp
0x64B8                  可僱用傭兵數量
0x64B9~0x64C1           可僱用傭兵種類

[ラーナ] 第17章
0xFCDF                  mp1
0xFCE0                  mp2
0xFCF7~0xFCF9           魔法1~3
0xFCFA                  召喚
0x65CD                  mp
0x65D8                  可僱用傭兵數量
0x65D9~0x65E1           可僱用傭兵種類

Zim capture

 Zim Capture 可以將Firefox中網頁中選擇的「文字」直接匯入到zim中的addon

另一個功能相同的Firefox addon

zim-clip

-----------------------------------------------------------------------------
var args = new Array("--       plugin","quicknote","text="+escaped_string,"namespace="+zimcapture.namespace,"encoding=url","option:url="+escaped_uri);
        process.run(false, args, args.length);

上面是 Zim Capture的程式碼,主要就是呼叫Quick Note這個Zim core plugin來達成。
不過Quick Note本身只支援「文字」啊。
-----------------------------------------------------------------------------
       
====== Quick Note ======
The "Quick Note" plugin offers a dialog for inserting quick notes into a notebook. It can be invoked from the commandline and can therefore easily be bound to keyboard shortcuts or used in scripts.

Dependencies: This plugin has no additional dependencies.

Commandline: zim --plugin quicknote [OPTIONS]

Options:
* notebook=URI          Select the notebook in the dialog
* namespace=STRING      Fill in the namespace in the dialog
* basename=STRING       Fill in the page name in the dialog
* text=TEXT             Provide the text directly
* input=stdin           Provide the text on stdin
* input=clipboard       Take the text from the clipboard
* encoding=url          url encoded utf-8 text
* encoding=base64       base64 encoded utf-8 text
* option:url=STRING     Set template parameter

幾個小工具

fc
===========================
Windows底下有個程式fc,可以比較兩個檔案的不同之處,並以16進位的方式輸出

Linux版:::

    cmp -l $1 $2 | awk '{printf "%08X %02X %02X\n", $1, strtonum(0$2), strtonum(0$3)}'

bwrite [filename] [offset(10進位)] [data] [data_size]
===========================
非常簡單的存檔修改法

    printf $3 | dd of="$1" bs=1 seek=$2 count=$4 conv=notrunc
   
10進位 > 16進位
===========================

     printf '%x\n' 346
   
16進位 > 10進位
===========================

    echo $((0xff))


Google Reader的替代方案

替代方案有兩種:
    * 給程式用的(OpenShift+ttrss)
    * 給人用的(Feedly)

給程式用的: 重複性任務(Google Reader沒有Gmail強大filter可用,所以撈特定資料還是要寫程式啊)
給人用的: 經常性的閱讀


OpenShift + Tiny Tiny Rss(ttrss)
=================================

優點:
    * ttrss有公開的API可以用來撈資料
    * OpenShift有免費方案可以使用(1Gear = 1GB Disk + 512MB RAM, 免費方案最多可以有3個Gear)
    * 資料可以直接透過postgresql撈出來
    * OpenShift可以透過瀏覽器一鍵佈署ttrss,從註冊Openshift到佈署完ttrss不需要花10分鐘
    * ttrss有filter可用,但只針對更新的項目

缺點:
    * OpenShift反應速度不算快(ping速度不錯,應該跟Gear有關)
    * ttrss對於某些網站提供的RSS解析會有問題,所以不是每個網站都能無痛匯入
    * OpenShift有些功能需要安裝client程式(gem install rhc)
    * OpenShift的Disk容量 = 程式 + 資料 + log,沒有設定quota的話,很容易爆掉=_=|||

Feedly
=================================

優點:
    * 一鍵匯入Google Reader的訂閱
    * 閱覽方式比Google Reader好很多(針對圖片,但顯示時會裁切掉圖片的一部份= =|||)

缺點:
    * 撈資料還是透過Google Reader API(這算偷接水管嗎?)
    * Firefox需要安裝add-ons(不懂需要額外安裝addon的理由)
    * 某些網站Google Reader已更新,而Feedly同個網站的feed還停留再3天前(bug?)
    * 有些排版會怪怪的


更新Fireofx addons: Automatic Save Folder後,會不斷跳出Update.xhml的問題



解決方法:

    1. 網址列輸入 about:config,進入設定頁面
    2. 新增 bool, [extensions.asf@mangaheart.org.install-event-fired]= false
    3. 設定 string value [extensions.asf.version] = 25(或更高)

這篇討論裡,主要的問題是 [extensions.asf.version]沒有設值,
但是每次開啟Firefox的時候會發送個XMLHTTPRequest去檢查版本....
然後Update.xhml就變成每次開啟Firefox時都出現了。
希望下個版本不要再出現了XD。

釣魚郵件

最近信箱收到兩封郵件,Google了一下,發現到對這類郵件的處理,建議都是直接刪除就好,不要好奇去點其中的連結。 避免下載到malware。
其中有篇文章有提到:
"""
If you are the recipient of this e-mail, your first thought most likely is that you have no idea what it's all about as you have not made a hotel reservation. So you think "delete it." Then you may think about responding, since there is the possibility someone may have gotten possession of your credit card number.
The correct action is to immediately delete it.
This is a scam. They are phishing for personal information (credit card number, etc.) for identity theft purposes.
"""

真是好奇心殺死貓啊~

一封是旅館的訂房的有問題,要求更新信用卡資料,否則會被扣$129當成是預約取消的懲罰(?)
"""
The hotel Arriva Hotel informed us that the data of given credit card was not accepted
(the reservation number GDJN89039343) .
It could happen because of several reasons:
  • Expiration date - end - does the expiration date of the card finish until the date arrival registration?
  • The reasonable balance - did the card have enough money on the card for reservation?
  • The type of the card - does the hotel accept such a type of the card?
You shouldnt worry about it. Your hotel reservation is actually.
However in order to guarantee its keeping, you have to refresh the credit card date during 36 hours after this message receiving.
Print the reservation, fill it in and fax to the hotel address.
If you do not update your credit card date, a penalty for reservation cancellation or prepayment of 129$, which is provided under the terms of booking will be imposed.
"""

根本沒訂房,哪來的有問題啊,更何況旅館還在英國......好遠啊

另一封則是是Fedex的包裹無法送達的通知
"""
Fed Ex
Order: SGH-2351-47268938 Order Date: Thursday, 17 January 2013, 11:10 AM
Dear Customer,
Your parcel has arrived at the post office at January 21.Our courier was unable to deliver the parcel to you.
To receive your parcel, please, go to the nearest office and show this receipt.
GET & PRINT RECEIPT
Best Regards, The FedEx Team.
"""

還有之前收到馬來文的詐騙簡訊 .... 真是亂槍打鳥啊
"""
Selamat Kpd. Pemilik no Reg. 457977 Anda mengdapatkan penghargaan dary BNP2-TKI cek tunai NT300000 info segera hubungi +6282349357799 Pengirim: BNP2-TKI
"""
參考: