2011年4月15日 星期五

Ubuntu 煩人的BADSIG 40976EAF437D05B5錯誤解決辦法

[Ubuntu]GPG Ubuntu Jaunty Archive Error,點擊進入
Bug #24061 in update-manager (Ubuntu): “GPG error with apt-get (BADSIG 40976http://ubuntuforums.org/showthread.php?t=1152619EAF437D05B5)”,點擊進入

錯誤提示:

W: 驗證簽名時發生了一個錯誤。 軟件倉庫將不會更新並將使用先前的索引文件。 GPG 錯誤。 http://archive.ubuntu.com karmic-proposed Release: 下列簽名無效: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key

解決方法:

第一步:

$ wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -

第二步:

sudo bash

apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update

這樣煩人的
“BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key”就消失了:)

來源 : http://solomon.athost.net/?p=372

.
分享

2011年3月28日 星期一

Ubuntu 10.04 Partial Upgrade 後不能上網

在升級到 Ubuntu 10.04 之後,按了如下圖的 Partial Upgrade,結果發現不能上網,而且右上角的網路圖示也不見了


之後才發現原來他會把Network Manager給移除掉




所以我就去下載 network-managernetwork-manager-gnome ,再安裝,就可以正常上網了,而且右上角的網路圖示又再度出現了。
分享

2010年6月14日 星期一

Java 讀檔亂碼

在 Java 中要讀檔案時
通常會這樣寫

BufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream("c:/test.txt")));

可是當文字檔儲存的格式為 ANSI 時
在中文繁體的系統需要指定讀進來的格式
不然會產生亂碼
只要將上述程式碼修改為以下即可

BufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream("c:/test.txt", "Big5"));
分享

Android 模擬器不能連網路

最近在試玩 Android 時
要利用模擬器連網路卻沒辦法連
產生了 Android Permission denied 的錯誤訊息
原來是在 AndroidManifest.xml 裡面
需要加入一行文字
<uses-permission android:name="android.permission.INTERNET" />

加入之後 Android 模擬器就可以正常連上網了
分享

Apache 不顯示檔案列表

在撰寫 PHP 網站時
若不想讓網站的目錄結構被看到
可以在 Apache 目錄裡的 conf 資料夾中
找到一個 httpd.conf 的檔案
用記事本打開後
在裡面找到下面的這段設定

<directory "C:/AppServ/www">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks MultiViews ExecCGI

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

</Directory>

<directory "C:/AppServ/www"> 代表是此 C:/AppServ/www 目錄的設定
在下面的 Options Indexes FollowSymLinks MultiViews ExecCGI
將 Indexes 拿掉
變成 Options FollowSymLinks MultiViews ExecCGI
其它人就看不到網站的目錄結構了
分享

2010年1月27日 星期三

Windows XP 旋轉

今天早上開機時,螢幕莫名奇妙旋轉90度,重開機也沒用,我以為是中毒了,我就上網 Google 一下,發現 Windows XP 有個熱鍵是可以旋轉螢幕的,只要按 Ctrl + Alt + Arrow(方向鍵),就可以轉旋螢幕,例如按 Ctrl + Alt + →,就會將螢幕向右轉90度,這個功能還有趣的,大家可以試看看
分享

2009年12月16日 星期三

網頁轉址方法

1. HTML 轉址方式

<meta http-equiv="refresh" content="5;url=http://tw.yahoo.com" />
其中的content=5,是指五秒後自動轉到 http://tw.yahoo.com/,可自行修改秒數

2.1 JavaScript 轉址方式1

<script language="JavaScript">
location.href= ("http://tw.yahoo.com");
</script>"
2.2 JavaScript 轉址方式2

<script type="text/javascript">
//設定倒數秒數
var t = 10;
//顯示倒數秒收
function showTime()
{
t -= 1;
document.getElementById('div1').innerHTML= t;

if(t==0)
{
location.href='http://tw.yahoo.com';
}

//每秒執行一次,showTime()
setTimeout("showTime()",1000);
}
//執行showTime()
showTime();
</script>
3. PHP 轉址方式

<?php
 header ("Location:  http://tw.yahoo.com");
?>
4. JSP 轉址方式

<%
response.sendRedirect("tw.yahoo.com");
%>
分享