Search Results for 'opera'


Uncategorized30 Jul 2008 01:58 am

mysql> delete from wp_comments where comment_approved=’spam’;
Query OK, 1121292 rows affected (88.5 sec)

Other 30k comments are NOT filtered as spam , I’ve just approve 8 of them.
Other 29.992k comments where deleted by a huge bunch of SQL operation.


My bad, this old version of WP does not close comments for old post , in contrast to what I’ve expected.
SQL is always the real place to do admin….

( Why I’ve stopped to approve comments ? Imagine that after a holiday, you have some 1K comments waiting approval…
and WP show 1K of them at once in the admin page, no pagination, 99.9% spam … That was what I find after not adding new rules for spam fighting for a month.

1 year later, I have got such 30K pending and 1M filtered spam. Poor server, sorry guys….)

System & Nethood29 Jul 2008 09:34 pm

Last time I have shown a very simple/stupid user script to auto login hkej.com ( 信報財經新聞網站 )

In fact, what it does is not auto log in, but check if you are checked out and try to log-in once. It does not safe you ( me ) from cookie expires. Although it does re-log and so user can go back and click on the link to escape.

I find no way to manipulate cookie with GreaseMonkey directly. This is not too bad in terms of security. I don’t have to steal cookies. I just want to revive them.

1) The simplist trick is to reload the page:

window.setTimeout(window.location.reload,29min_later);

It works. But what if the user left some valuable words in forms ?
All such data will be vanished.

2) Do some minimal ajax load
I cannot sure why, but it does not work. It seems the ajax load within Greasemonkey is bounded by some shields.

3) Load some data into an iframe, and reload the iframe from time to time.
It works. Rather than expected, I can hide those iframe without anyharm.

So I rewrite the code a little bit. This time, I have also taken reference from a famous user script to handle username and password.

Wondering if I shall submit it to userscripts.org ….
Would do so if anyone interested.


// ==UserScript==
// @name Hacks on HKEJ
// @namespace info.bencrox
// @description Make life easier with hkej.com
// @include http://*.hkej.com/*
// @exclude http://*.hkej.com/*/adv/*
// @exclude http://*.hkej.com/*/login.jsp
// ==/UserScript==
	
// ! Private Credentials, BEWARE !
LOGIN_EMAIL = GM_getValue('ejregem','');
LOGIN_PASS = GM_getValue('ejregpw','');
	
// Note : lots FIXME
// by : lxb [at] hkday [dot] net
// ver : 0.1.013 [ 2008 Jul 25 20:00:04 ]
// ! Change Log !
// 0.1.000 [ 2008 Jul 25 18:01:12 ] : base GM + jQ ref htt://www.joanpiedra.com/jquery/greasemonkey
// 0.1.001 [ 2008 Jul 25 18:13:02 ] : add checkLogin() , use Google hosted jQuery
// 0.1.002 [ 2008 Jul 25 18:13:02 ] : checkLogin() add fail handling
// 0.1.003 [ 2008 Jul 27 19:02:13 ] : add excludes
// 0.1.004 [ 2008 Jul 27 22:04:20] : test window.location.reload  and GM Menu
// 0.1.005 [ 2008 Jul 27 22:07:56] : test with partial ajax reload, failed
// 0.1.006 [ 2008 Jul 27 22:13:28] : test with iframes, worked
// 0.1.007 [ 2008 Jul 28 17:35:44] : reload iframes in hidden div by setTimeout
// 0.1.008 [ 2008 Jul 29 21:50:13] : test with GM_setValue / getValue
// 0.1.009 [ 2008 Jul 30 16:02:32] : fixed GM_setValue by not using jQuery
// 0.1.010 [ 2008 Jul 30 16:04:58] : allow manual reset un/pw , blank pw  , ref : http://userscripts.org/scripts/review/16341
// 0.1.011 [ 2008 Jul 30 16:56:16]: fix re-bake loop by adding excludes and choosing better dummy pages
// 0.1.012 [ 2008 Jul 30 17:15:21]: test with extra styling / manual items
// 0.1.013 [ 2008 Jul 30 20:00:04]: clean up test codes
	
// - Change Log -
	
// Add jQuery
var GM_JQ = document.createElement('script');
GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js';
GM_JQ.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(GM_JQ);
	
// Check if jQuery's loaded
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
else { $ = unsafeWindow.jQuery; letsJQuery(); }
}
GM_wait();
	
//renewCookie by fetch the smallest pieces.
//FIXME: they are not quite small... seems idiot method...
    function renewCookie() {
	$('#webifm').attr('src','http://web.hkej.com/template/registration/jsp/login.jsp');
	$('#wwwifm').attr('src','http://www.hkej.com/template/registration/jsp/login.jsp');
    }
	
//call renew cookies every 25mins
    function cookieTimeout() {
	renewCookie();
	window.setTimeout(cookieTimeout,1500000);
    }
	
//provide some way to reset Creds stored in firefox
//FIXME: tell me if I can encrypt things ... -_-
    function resetCredentials(){
		if ((LOGIN_EMAIL = prompt('Registered Email:')) != null){
			GM_setValue('ejregem',LOGIN_EMAIL);
		} else return;
		if ((LOGIN_PASS = prompt('Password (leave blank to prompt every time):')) != null){
			GM_setValue('ejregpw',LOGIN_PASS);
		}
    }
	
// Provide a button to reset Creds if login failed
    function checkLogOK(){
// FIXME: Yes, this must lead to faults afterwards
	ts = document.getElementsByTagName('b')
      if(ts.len){
// FIXME: Cannot use jQuery (GM_setValue within unsafeWindow ) here,
	resetp = document.createElement('button');
	resetp.innerHTML='Reset';
	resetp.addEventListener('click',resetCredentials,true);
	ts[0].appendChild(resetp);
      }
    }
	
// Extract the Log in Operation for manual use
    function AutoLog() {
	if (LOGIN_EMAIL == '') resetCredentials;
	if (LOGIN_PASS == '') LOGIN_PASS = prompt('Password :');
	
// FIXME : this must fail afterward, yes, yes...
	$('#wrapper table:first td:eq(1)')
	  .load('/template/registration/jsp/_login_prg.jsp #regWrap b',
		{login:LOGIN_EMAIL,password:LOGIN_PASS},checkLogOK);
	
    }
	
// Check login
function checkLogin() {
// FIXME : it may not work if hkej update itself
	var login = $('img#Reg_Log').attr('src').indexOf('logout') + 1;
	if (!login) AutoLog();
	cookieTimeout();
}
	
// Hide the cookie ovens
    function Addiframe(){
	$('<div id= "hid"></div>').appendTo('body');
	$('<iframe name="webifm" id="webifm"></iframe>').appendTo('#hid');
	$('<iframe name="wwwifm" id="wwwifm"></iframe>').appendTo('#hid');
	$('#hid').hide();
    }
	
// All your GM code must be inside this function
function letsJQuery() {
	Addiframe();
	checkLogin();
}
	
GM_registerMenuCommand('Login', AutoLog);
GM_registerMenuCommand('Reset ID',resetCredentials);
	

Have fun!

System & Nethood23 Jan 2008 05:58 pm

很久沒有寫東西,近來都在煩程式開發。正在愁閉門造車有多不健康,就找到個機會做少許可以公開的指引。

剛先收到一位朋友的信,問我怎樣用 ,去做一個實驗,以偵察一大堆電話號碼,到底是機器應答 ( ),還是真人應答,定還是傳真機。他想把資料存入 MySQL ,以便稍後分析。

像這樣的做法,在電訊工程方面實在十分普遍,已經有很多人做過實例。是故只要問一問 Google 大神,應該很易得到指引。我在這裏只是用中文撮要一下,方便 Google 大神回答中文世界的懶人。

實作的前題,是要有一台安裝好 Asterisk ,插了 ATA / FXO 界面卡,駁好電話線,以及有一堆不介意被偵察的電話清單。

再提一次,要是亂槍打鳥而滋擾到本港用戶,基本上是犯法的。目前很多商業機構,都是透過委託非牟利團體,去做實則關乎商業利益的電話調查,以便隱藏來電線路。他們以為這樣子,就可以繞過了「在 發 送 商 業 電 子 訊 息 至 電 話 或 傳 真 號 碼 時 , 不 得 隱 藏 來 電 線 路 識 別 資 料」的規定,這實在是超糟糕的。

回到正題,一般新手去搞 Asterisk ,搞大輪安裝好了,也就只是知道怎樣接電話。要再下一城,弄出一個應用方案,關鍵就在於怎接連自己會寫的應用程式。

以電話類別偵察為例,運作的流程可能是這樣:

1. 定義電話號碼清單。
2. 定義撥號次序。(也許只是純粹順著清單撥打)
3. 撥打號碼。( 可能是多線進行)
4a. 號碼接通,辨別接聽端為何物。
4b. 未能接通,分辨原因。
5. 紀錄 4a/b 的相關資料
6. 提取下一個號碼,重複 3 ~ 5 ,直至沒有新號碼

由於開發工具不是一蹴即就,無關電訊運作的邏輯部份,亦即是 (1) (2) (6) 宜於抽出來編寫,只要用熟悉的 Scripting Language 便可以輕鬆搞定。

(5) 基本上也和電訊運作無關,只是其觸發點仍是以 (3) (4) 有結論為前提,用的資料也是由電訊邏輯提供,應用 Asterisk 的 API 更為簡單直接。譬如說,我的朋友打算用 MySql 存案,我提議他參考這個:

http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL

另一點,外部程式要使用 asterisk , 像是觸發 (3) ,則可以參這個:

http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out

最後,怎樣用 Asterisk 判別接聽端為何物呢?其實例子也挺多的,像是

這個分辨 Fax 機的插件程式
以及這個有關辨認人和應答系統的功能

至於如何把現有的東西改良,那當然要靠實際開發者的智慧了。

System & Nethood18 Jun 2007 02:12 am

我可不是貪玩的﹐做網上應用開發﹐就難免要照顧不同 Browser 的用戶。長時間來﹐我都會同時用兩至三個不同的 Browser ﹐平衡運作。

這有點方便的是﹐我可以在 Firefox 開 gmail 帳號甲﹐在 IE 開帳號乙﹐在 Opera / Safari 開帳號丙。

一般人都只會用到一個統一個帳號(尤其是對同一個 Portal 而言)﹐但是在管理專案或多線開發的工作者而言﹐這是未必夠用的。利用不同 Browser 存不同 cache / cookies 的好處﹐我覺得這樣做很方便。

還有的是﹐對於一個未去過﹐沒信心的網站﹐我多數都會另開一隻沒有登入任何帳號的 Browser (主要是指 Mozilla Minefield , 地雷陣!)去玩﹐那會較為安全﹐對於 XSS 和 Cookie cracking 都有更好的防守架式。

System & Nethood13 Jun 2007 01:55 pm

先是看到 Ajaxian 有關 SlickSpeed 作為 CSS 效能 Benchmarker 的文章﹐而後又看到 DK 大神列出他跑了幾個 Browser 得出來的結果。既然 DK 沒有用到 Minefield ﹐那就等我這個地雷陣熟客來「以身試法」吧! :P

ref: http://mootools.net/slickspeed/

留意﹐以下是一個 ﹐也就是按一下標題﹐正常的話會做 sorting ﹐不正常的話﹐就是我中伏了。

各 Browser 的詳細版本﹐應在 Tooltip 裏有說明。數字越小﹐代表反應越快﹐即越好。

Browser prototype 1.5.1 jQuery 1.1.2dev MooTools 1.2dev ext 1.1b1 cssQuery 2.02 dojo query
96 878 136 144 1257 215
72 1510 96 186 1576 92
128 5750 136 1517 7972 442
179 5948 184 1593 8716 519
156 5691 164 1436 7605 416
183 6520 219 1777 9030 500
1887 3847 1567 1190 7948 859
1891 3759 1544 1174 7904 854
1963 4005 1632 1245 8250 914
1872 3707 1530 1169 7845 850
1886 3778 1557 1198 7953 867

色塊說明.核心引擎:

Trident Gecko WebKit Other

測試環境:
P4 3.0Ghz 512Mb ram WinXp 國際英文版 with sp2 most updated

有趣的點子:

同樣是 IE core ﹐PCMan 2007 竟然比我最新版本的 IE 6.0.x 效能更好?任老大要樂翻了吧!

以上數據﹐並沒有加上測試失敗的參數﹐所以要知道實際情況﹐請自行試試吧。

扯平均來說﹐各 在檢 css elements 的表現﹐Dojo 略勝一籌!

警告:
一如以往﹐我對於太霸道的東西﹐一定會指罵。以上各款 Browser 中﹐Avant Browser 是最邪惡的﹐安裝後會偷搶註冊表的 Filetype control ﹐不易反安裝。沒有必要的話﹐也不要玩這種東西。

(我敢說 Avant 和 Maxthon 這兩個 IE 支系﹐開發組都有不少國內成員﹐他們的惡習都已涉入了程式之中﹐所以若有 Maxthon 支持者說 Avant 不好的話﹐恐怕只是五十步笑一百步。)

hkday& System & Nethood07 Jun 2007 01:30 am

作者: lxb (lxb) 看板: Web-weaving
標題: rel-tag -> Operator Extension (FF)
時間: 2007年6月7日 星期四 01:29:40

正在研究 , 剛好 Michael Kaply 釋出了 Operator 0.8a 版,
可以使 更方便地引用 microformats 來做 .

這裏有些 user scripts, 要是安裝 operator 0.8 版的話, 不妨玩玩.

另按﹐只要好好選 Options ﹐Operator 不單不會再秀出重複選項﹐更可以移位到 status bar ﹐佔更少地方。

※ 發信站: 香港地(hkday.net)
◆ From: 219.77.78.158

System & Nethood06 Jun 2007 04:40 pm

你還在用 Microsoft Internet Explorer 嗎?
Are you still using Microsoft Internet Explorer ?

如果你用 IE 又有用 GMail ﹐那小心所有資料外洩啊。(實則豈止 Gmail 受影響……)
If you are using IE ,even fully patched, to access GMail, beware IE leaks all your credentials.
( In fact the vulnerability does not only infect GMail…. )

Ref: Allows
( link: Google Blogoscoped by Philipp Lenssen )

那改用 Firefox 就會好一點嗎?
Then will it be better for firefox ?

單從這個案例就是﹐但近來 也很有問題。
Firefox is better in this case, but these days.

那何不
Then, why don’t you ?

按:我三種 Browser 都經常用﹐個人情感上傾向 Opera ﹐但用 Firefox 的時間的確長一點﹐IE 仍無法避免不用。
PS. I am still keep using all three browsers. I love opera, but spend much more time on firefox, and just could not avoid IE.

還有的是﹐我在 Dopod 818pro 上﹐再時有齊 ,
And in fact, my WM5 Dopod 818pro have got all three: , and

hkday02 Jun 2007 01:38 pm

作者: lxb (無想轉生) 看板: lxb
標題: Microformats
時間: Sat Jun 2 13:38:15 2007

下一份 project 的重頭戲啊…

現在正在玩 firefox extensions

1. Operator extension
- 不怎支援中文
- 主要是以 microformats 提供的資料, 再作 niche search

2. Tails Export extension
- 提取 Microformats 的資料, 在側欄排版.
- 目前的版本, 跟 John Allsopp 所介紹的較弱啊 ???

( 按﹐
: 原來還有一個由 Calvin Yu 做的 Tails extension,
: 並沒有放在 Mozilla 裏:
: http://blog.codeeg.com/tails-firefox-extension-03/
: 這就是 John Allsopp 示範的那個了.

http://code.google.com/p/tails-firefox-extension/

有源碼.
)


※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 219.77.78.158

hkday16 May 2007 04:27 pm

作者: lxb (lxb) 看板: VoIP
標題: [新版] WengoPhone 2.1.0
時間: 2007年5月16日 星期三 16:25:03

WengoPhone 2.1.0
2007-May-15

After a short 6 month release cycle, the next major upgrade to the WengoPhone is now available. This version is a vast improvement over the previous version in a number of areas:

Interoperability

終於可以容易互通 ast, ser 等等 sip server 了, 關鍵!

Support has been added to allow the easy configuration of a SIP account for platforms other than the Wengo platform. This long requested feature means that the user has total choice over the telephony platform they want to use, including their own private SER, OpenSER or Asterisk server. In addition, considerable effort has gone into improving the interoperability of the WengoPhone with other SIP clients.

Security

現在是 sRTP, 不知何時是 zRTP?

If your platform supports it, you can make secure PC to PC calls over sRTP with the WengoPhone, using the standard AES128 encryption algorithm. You can be sure that no-one is eavesdropping on your conversations if you see a little padlock in your call window.

Usability

少少改善啦, 總之, 好看了一點.

The entire interface has been the subject of a usability study. Hundreds of small touches make it a little nicer to use the WengoPhone. Tooltips have been added to all buttons, all buttons give visual feedback that they can be pressed. The interface is accessible using only the keyboard. Chat logs are saved, and you can see your recent discussions with someone when you start a new one.

Languages

未有中文, 我將去信問一下.

Thanks to the translation community at Launchpad, and OpenWengo’s translation team, this release is 100% translated in 13 languages - English, French, Spanish, Catalan, Italian, German, Portugese, Brazilian Portugese, Swedish, Turkish, Bulgarian, Czech and Polish. If your language isn’t there, then head on over to Launchpad and get started - it’ll be in 2.1.1.

Mac and Linux support

以前 wengo 只在 windows 玩得一下, 現在總算是較好地支援 alsa 了.
其實, 由 trac 去看 wengo 怎從 windows pref 轉營到 cross-platform,
也是個好的學習材料.

Mac and Linux are truly first class citizens in the project now. In the 2.0 release, we concentrated on features, and on stability on Windows. In this release, improvements in thread handling, the implementation of a pure ALSA back-end for Linux, and weeks focussed on stability on Linux have resulted in a truly cross-platform softphone. All that work has also contributed to making the WengoPhone rock solid on Windows.

You can get binaries at OpenWengo.org, and sources (and more information on how to contribute to the project) are available at our developer site.


※ 發信站: 香港地(hkday.net)
◆ From: 144.214.37.27
※ 編輯: lxb 來自: 144.214.37.27 (05/16 16:26)

hkday03 Apr 2007 01:04 am

作者: lxb (lxb) 看板: VoIP
標題: [新版] TrixBox 2.2 beta 4
時間: 2007年4月3日 星期二 01:02:51

Ref - http://tinyurl.com/2b73tw

這是個獨立的 bug-fix 版本, 據 KG 說是不能由之前的版本 upgrade 上去的.
但是, 之前已知道的大部份 bug 都在這個板本中解決了, 並加入了更多 hard
phone 支援設定檔. 據說, 網絡設置介面也改善了 (我未試, 只是抽出來譯)

還有一點題外的收獲, 就是這串討論, 間接地介紹了 ms 的免費虛擬電腦軟件

msvpc2007
http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx

另外, 估計 (即係靠估, 未證實) 2.2 b 4 會跟 0.27 版的 flash operator panel , 不妨留意一下.


※ 發信站: 香港地(hkday.net)
◆ From: 219.77.248.108


Listed on BlogShares