Posted by limuxy on 八月 14, 2010

BuddyPress活动记录RSS标题乱码的解决

狐狸窝装上BuddyPress后,将活动记录的RSS添加到了GR,却发现标题都是乱码。

解决方法如下:

請將 /buddypress/bp-activity/bp-activity-templatetags.php

第 910 行

$title = trim( strip_tags( html_entity_decode( utf8_encode( $content[0] ) ) ) );
轉為

$title = trim( strip_tags( html_entity_decode( $content[0] ) ) );
這問題早已送出 trac ticket, 但沒有相關跟進,可以暫時使用這方法解決。

http://trac.buddypress.org/ticket/1983

解决方法来自http://tw.buddypress.org/2010/05/23/1-2-x-rss-%E8%A3%A1%E7%9A%84%E6%A8%99%E9%A1%8C%E6%9C%83%E8%AE%8A%E6%88%90%E4%BA%82%E7%A2%BC/

Categories: 网络生活
Tags: , ,
Posted by limuxy on 七月 9, 2010

在Gmail中尽情Twitter吧!

Twitter在天朝却被墙阻隔在千里之外,各种三方客户端风起云涌。作为gmail的忠实用户,何不为它添加作为twitter客户端的功能呢~ Read the rest of this entry »

Categories: 网络生活
Tags: , ,
Posted by limuxy on 五月 4, 2010

动态域名转发的实现

公司内部的信息分享平台(用的是Windows SharePoint)最近被要求备案,虽然我不是IT,也瞎捣鼓了一下可能的解决方案。

域名是在1and1注册的,所以不备案其实也没关系。但其服务器是在我们办公室里,用的宽带连接到internet,所以IP是不固定的,于是想了一个自动更新IP的域名转发的办法。80端口是老早就被“有关部门”下令统统封掉了,我们用端口8080吧~当然,用花生壳的动态解析也会很方便,可谁叫我有点geek呢。好,动手~

准备工作

  • 域名一个(这个是废话)
  • 空间一个,免费的就可以
  • PHP+PYTHON+其他什么的编程基础一点点

空间上的工作

首先,我们需要一个文件来存储那个会变动的服务器的IP,当然用数据库也可以。假设是server.txt。

然后,需要一个PHP文件来把获得的IP写入server.txt。假设是record.php。代码如下

<?php
$ip=$_GET["ip"];
$f=fopen(“./server.txt”,”w”);
fwrite($f,$ip);
fclose($f);
?>

最后,一个简单的index.php读取server.txt中的IP地址并且转向。

<?
$fp = fopen(“server.txt”,”r”);
$buf = fread($fp,filesize(“ip.txt”));
fclose($fp);
$buf2 = file_get_contents(“ip.txt”);

$GoTo = “http://”.$buf2.”:8080/”;
header(sprintf(“Location: %s”, $GoTo));
?>

服务器上的工作

想了想还是用python来自动获取本机公网IP然后提交给空间里的server.txt。下面是get-ip.py的代码

import sys
import re
import urllib2
import urllib

ip = re.search(‘\d+\.\d+\.\d+\.\d+’,urllib2.urlopen(“http://www.whereismyip.com”).read()).group(0)
print ip

def addGETdata(url, data):
return url + ‘?’ + urllib.urlencode(data)

url = addGETdata(‘http://xxx.abc.com/record.php’, [('ip', ip)])

print ‘Using URL’, url
req = urllib2.Request(url)

fd = urllib2.urlopen(req)

while True:
data = fd.read(1024)
if not len(data):
break
sys.stdout.write(data)

当然以上代码参考了很多地方啦~用正则从whereismyip.com获得公网IP,然后提交到空间里的record.php写入server.txt。

最后的工作

这样每次IP变动之后在服务器上运行一下get-ip.py就可以了。对python的多线程实在不熟悉,本来想让它自动5分钟10分钟运行一次的,就不用手动了……

后来想到个笨办法,用py2exe把get-ip.py转成exe,然后用其他编程语言写个小程序定时调用就行了。比如最弱智的VB……其实wxpython用个timer控件貌似也可以,还没试过……

Categories: 网络生活
Tags:
Posted by limuxy on 十二月 7, 2009

开源twitter网页客户端

dabr: http://code.google.com/p/dabr/

奶瓶腿:http://code.google.com/p/netputer/

rabr: http://code.google.com/p/rabr/

twitese: http://code.google.com/p/twitese/

javatweet: http://code.google.com/p/javatweet/

添加中。。。。

Categories: 网络生活
Tags:
Posted by limuxy on 十月 5, 2009

Google发布Chrome新主题

Google最近在Chrome的主题列表中添加了不少由艺术家及设计师们设计的新主题。

加上原来Google官方发布的一些主题,Chrome现在的主题已经越来越丰富了,各种风格都包含其中。不管是简单图案、明星照片,还是更为复杂的设计,相信总能找到一款看得顺眼的~

我现在用的是这个:

thumb_at_tibi

Categories: 网络生活
Tags: , ,
Posted by limuxy on 十月 3, 2009

来自日本的免费VPN:PacketiX VPN

最近很多免费的VPN都托了“官方网”的福连不上了,这个来自日本的PacketiX VPN倒是运作的一切正常。相较于UltraVPN, PacketiX对64位的系统也提供了支持,这一点是不错的。PacketiX VP同时N支持windows和linux系统,用起来也很方便。

首先,打开 http://www.packetix.net/en/secure/install/

如果使用的是windows系统并且用IE打开这个页面,通过简单的ActiveX安装方式就能快速安装并设置好PacketX了。运行后就能直接使用了~

如果不能使用ActiveX的话,根据自己的系统下载客户端吧~ 装好之后有两种方法来设置。可以按照下面的表格手工设置:

Setting Item Value
VPN Server host name public.softether.com
VPN Server port number 443
Virtual Hub name PUBLIC
User name PUBLIC
User authentication anonymous

或者下载http://www.packetix.net/en/secure/secure.vpn这个文件,在软件的界面中导入就可以了。

个人感觉这个VPN速度一般~

Categories: 网络生活
Tags:
Posted by limuxy on 十月 2, 2009

Bit.ly URL Shortening Applet For Gnome

来自:http://webupd8.blogspot.com/2009/10/bitly-url-shortner-applet-for-gnome.html

gbitly-applet

gbitly-applet is an applet for Gnome which enables creation of short urls without logging into bit.ly. Its still in its development stage but alpha version is available.

How it works: you will need to right click your Gnome panel, select “Add to Panel” and add gbitly-applet, then right clicking the applet you will see a form in which you must fill in the long URL which you want to get shortened. Also, the applet automatically detects a long URL you previously copied (from the clipboard) and adds it to the long URL field.

You can download it from HERE

To install it is pretty easy. First, make sure you have libcurl-devel,panel-applet-devel and gtk-devel installed. For Ubuntu:

sudo apt-get install libcurl-devel panel-applet-devel gtk-devel

Then:

make
sudo make install