| 前往頁面 ←上一頁 1 ... 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 ... 559 下一頁→
|
[h1]Fedora 17: Fedorax2017x20x86_64 does not exist - Install Failed[/h1]
[h2]症狀 Symptoms[/h2]
代碼:
ERROR: could not insert 'floppy': No such device
Loading Fedora 17 x86_64 installer...
dracut Warning: Unable to process initqueue
dracut Warning: /dev/disk/by-label/Fedorax2017x20x86_64 does not exist
dracut Warning: /dev/mapper/live-rw does not exist
Dropping to debug shell.
dracut:/#
[h2]解決方式[/h2]
1. 燒錄 FC17 DVD 時,請將 DVD Label 設定為 "FC17" ,也就是「不要有空格!」 "Label No Space (x20)"
(這有可能是 BIOS bug 的問題,也有可能是 Fedora Dracut 本身的 bug )
2. 然後在 Boot Disk Menu 畫面按下 "Tab",把 LABEL 從 "Fedora\x2017\x20x86_64" 改成 "FC17"
*NOTE*: 如果你用 USB 當成 ISO-DVD Boot Disk,那更簡單,使用 mtools/mlabel 改 USB Label,參考下面
代碼:
$ yum install mtools (or, apt-get install mtools)
$ sudo echo "mtools_skip_check=1" > ~/.mtoolsrc
$ sudo mlabel -i /dev/sdX1 ::FC17 (the '::' prefix is a must!)
(2014-06-29 16:02) |
|
[h1]嗶...戰鬥力只有5?雜碎![/h1](2014-06-25 00:37) |
|
[h1]X Window System 歡慶 30 週年 (June 2014)[/h1]
廣泛使用於 Linux, *BSD, SunOS, Iris, Solaris, Unix, 甚至是 Microsoft Windows 的「視窗主從架構系統」 "X"
或稱為 X-Windows, X Window System
在這個月 19 日 (2014/06/19) 正式歡慶 30 週年。
30 年前的這個時候 (1984/06/19),MIT 的 Bob Scheifler 宣布了 X Window System 的誕生。
X 視窗系統可說是最早期 Open Software / Free Software 的先驅者,
甚至比 Linux / BSD / Solaris / GPL / FSF / Apache / POSIX / C89 / C99 這些系統、標準、組織等,都來得早!
至今,經過三十年的演化,基於 X 視窗系統衍生出了 GNOME, KDE, XFCE, Unity, Enlightment 這麼多種的桌面環境,
廣泛的服務著數百萬以上的 Desktop GUI 桌面環境使用者。
(然而,這麼多 Desktop env 不知是好是壞...)
目前最新的 X Window System 版本為: X11 Release 7.7, 下個版本是 R7.8, 使用的是 MIT License
目前是由 X.org 基金會維護:
Xorg官網 => http://x.org/
Google+ => https://plus.google.com/102057777074369211973
(2014-06-23 15:56) |
|
Dear Kelly
麻煩請補一下薪資範圍!
Thank you
(2014-06-22 20:34) |
|
[h1]UI Template for the above Perl Codes[/h1]
代碼:
<h2>新增美術&插畫作品,歡迎參觀~</h2>
<h2>新增美術&插畫作品,一定要看看~</h2>
<h2>新增美術&插畫作品,讚的唷,要看喔!</h2>
<h2>新增美術&插畫作品,不看可惜!</h2>
<h2>新增美術&插畫作品,點選進入觀賞~</h2>
代碼:
<html>
<head>
<title>過去的事::美術、插畫、美術數位內容/News Archives/Fine Art Illustration/Fine Art Content</title>
<meta http-equiv="content-type" content="text/html; charset=big5">
<meta name="keywords" content="News Archives,Fine Art Content,Fine Art Illustration,插畫,小說插畫">
<meta name="description" content="Vovo2000.Com: 包含竹吟個人之插畫、漫畫、同人誌;駐站畫家之美術、藝術作品;另有線上繪圖版 PaintBBS, 繪圖聊天室 PaintChat, 討論區 PHPBB, 投稿區">
<meta name="ROBOTS" CONTENT="ALL">
<base target="_self">
<link rel="stylesheet" href="/style.css" type="text/css">
<STYLE TYPE='text/css'>
<!-- TextRollover-1 -->
a:link { color:#000000; text-decoration:none}
a:visited { color:#000000; text-decoration:none}
a:hover { color:#000000; text-decoration:none; background:#33CCFF}
a:active { color:#000000; text-decoration:none}
</STYLE>
</head>
<body background="/image/backround-1.gif" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table border="0" cellspacing="2" cellpadding="1">
<tr>
<td nowrap>
<H3>[ <a href="news.php" target="_self">Latest News Archive 最新動向過去的事</a> ] </H3>
<H2>News-2004</H2>
{V2K_NEWS_THISYEAR_DAYBYDAY}
<hr>
<H2><a href="/news/2003.htm">Vovo2000.Com News Archive :: News-2003</a></H2>
<H2><a href="/news/2002.htm">Vovo2000.Com News Archive :: News-2002</a></H2>
<H2><a href="/news/2001.htm">Vovo2000.Com News Archive :: News-2001</a></H2>
</td>
</tr>
</table>
<div>
<div align="center"><font color="333333">©All Rights Reserved by
<a href="http://vovo2000.Com/" target="_blank" class="nounderline">Vovo2000.Com</a>
| <a href="http://vovo2000.com/friend/about.php" target="_self" class="nounderline">About
Vovo2000</a>
| Last Update {UPDATE_TIME}</font> </div>
</div>
</body>
</html>
代碼:
<td>
<div align=center>
<a href='http://artist.vovo2000.com/{AUTH}#new'
title="Artist:{AUTH} {RNAME}, 插畫,美術插畫,美術數位內容, Image of Fine Art Artwork/Illustration/Content"
target='_self' onclick="window.open( 'http://artist.vovo2000.com/{AUTH}#new', '_self' )">
<table width=85 height=100 border=1 background="{NEWS-IMG-SRC}" class="everydaynews">
<tr><td> </td></tr>
</table>
</a>
<font size=-1>駐站畫家「<a href='http://artist.vovo2000.com/{AUTH}#new' target='_self'>{RNAME}</a>」
</font>
</div>
</td>
代碼:
<h2><a href="http://vovo2000.com/gallery/{A_GALLERY}/{A_PIC}"
target="_blank">
<img src="/gallery/albums/{A_GALLERY}/{A_PIC_THUMB}" border="1" width="100">
</a>
...<strong>#{NUM}</strong> by <a href="http://vovo2000.com/friend/{A_INDEX}" target="_rankit"><font color=black size=+1>{A_REALNAME}</font></a>
<font size="-1"> [
點閱 {A_CLICKS} 次 /
<a href="http://artist.vovo2000.com/{A_GALLERY}" target="_rankit">Gallery</a>
/
<a href="http://vovo2000.com/phpbb2/forum-{A_FORUM}.html" target="_rankit">Forum</a>
/
<a href="http://vovo2000.com/friend/{A_INDEX}" target="_rankit">Profile</a>
]</font> {HOT_IMG}</h2>
代碼:
<div align="center">
<table width="80%" border="0" cellpadding="8">
<tr>
<td>
<div align="right">
<p><font size="+2" face="Verdana, Arial, Helvetica, sans-serif"> [Artwork
Hits Rank] 作品點閱統計</font><br>
<font size=-1>(投稿園地排除)</font>
<br>
<strong>畫廊取樣作品:取 <font color=red>{HOWMUCH}</font> / 共 <font color=red>{TOTAL_PICS}</font> 張</strong><br>
最後更新時間:
<!-- #BeginDate format:Am1 --> {UPDATE_TIME} <!-- #EndDate -->
<br />
本名次排行依據畫廊點閱次數逐日自動統計,工作坊並不以此數據做為任何其他用途<br />
<font size="-1">This rank stat is just A-Gallery-FYR. Vovo2000.Com does not and will not use it for alternative usage.</font>
</p>
</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="but1"> <br>
{RANK_LIST}
</td>
</tr>
</table>
</div>
代碼:
<div align='left'>
{NEWS-DATE-TIME}
{WELCOME}
<table width='100%' border='0'>
{NEWS-IMG-ONLY}
</table>
<hr>
<div align="center"><font size="-1" face="Courier New, Courier, mono">
<a href="http://vovo2000.com/" style="color:#0000ff" target="_blank">(C)Vovo2000.Com</a></font>
</div>
</div>
代碼:
<tr><td>
<table width="100%">
<tr>
<td>
<a href="http://artist.vovo2000.com/{AUTH}" title="{AUTH}'s Art Gallery">
<img width="80" src="/gallery/albums/{AUTH}{HIGHLIGHT}">
</a>
</td>
<td>
<font size=-1>
<strong><a href="/gallery/{AUTH}">Artist: {RNAME}</a></strong><br>
<b></b>
<a href="http://artist.vovo2000.com/{AUTH}" alt="{AUTH}'s Art Gallery">個人畫廊</a><br />
<b></b>
<a href="/phpbb2/forum-{FNUM}.html" alt="{AUTH}'s Forum">個人論壇</a><br />
<b></b>
<a href="/friend/{FIDX}" alt="Intro to {AUTH}">畫家介紹</a><br />
</font>
</td>
</tr>
</table>
</td></tr>
</td></tr>
代碼:
<li><h2><font color="blue" size="+0" face="Verdana, Arial, Helvetica, sans-serif">
<a href="http://vovo2000.com/friend/{A_INDEX}" target="_blank" alt="Artist {A_REALNAME}">
<strong>{A_REALNAME}</strong></font> <font size=-2>(#{NUM}-畫家,插畫家,美術工作者)</font></a>
<br>
<font size="-2" face="Verdana, Arial, Helvetica, sans-serif"> [
美術、漫畫、插畫作品 {A_PCOUNT} 張 /
平均 {A_CLICKS} Hits /
總點閱 {T_CLICKS} Hits /
<font color=blue>
<a href="http://artist.vovo2000.com/{A_GALLERY}#new" target="_self" alt="個人畫廊 Personel Gallery">Gallery</a>
</font> /
<font color=blue>
<a href="http://vovo2000.com/phpbb2/forum-{A_FORUM}.html" target="_self" alt="個人討論區 Personel Forum">Forum</a>
</font> /
<font color=blue>
<a href="http://vovo2000.com/friend/{A_INDEX}" target="_self" alt="個人資訊 Personel Profile">Profile</a>
</font> ]</font> {HOT_IMG}</h2>
</li>
代碼:
<div align="center">
<table width="80%" border="0" cellpadding="8">
<tr>
<td>
<div align="right">
<p><font size="+2" face="Verdana, Arial, Helvetica, sans-serif"> [Artist
Hits Rank] 駐站畫家點閱統計</font><font size=-2>(投稿園地、社團排除)</font><br>
駐站畫家總數:共 {TOTAL_ROOMER} 位<br>
最後更新時間:
<!-- #BeginDate format:Am1 --> {UPDATE_TIME} <!-- #EndDate -->
<br />
本名次排行依據畫廊點閱次數逐日自動統計,工作坊並不以此數據做為任何其他用途<br />
<font size="-1">This rank stat is just A-Gallery-FYR. Vovo2000.Com does not and will not use it for alternative usage.</font>
</p>
</div>
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="but1"> <br>
{RANK_LIST}
</td>
</tr>
</table>
</div>
(2014-06-22 18:26) |
|
[h1]stat_Gallery_Top10.pl[/h1]
應該是取出 Top10 Gallery Hits
代碼:
#!C:/perl/bin/perl.exe
$directory = "D:/Apache2/htdocs/gallery/albums/";
$directory2 = "D:\\Apache2\\htdocs\\gallery\\albums\\";
$file_tmp = "D:/VovoUtil/tmp.file";
$file_artistHit = "D:/Apache2/Htdocs/friend/rank_artistHit{NUM}.htm";
$file_artistHit2 = "D:/Apache2/Htdocs/friend/rank_artistHit.txt";
$file_template1 = "template-artisthitrank.tpl";
$file_template2 = "template-artisthitrank-detail.tpl";
$file_roomer_list = "D:/Apache2/Htdocs/friend/roomer_list.txt";
@not_in_list = ( "18", "ClubTWCP", "friend", "distrib", "vovo2000" );
$per_page = 25; # 分頁
system( "dir $directory2 > $file_tmp" );
$i = 0;
$j = 0;
$hot_gap = 5;
$hot_imgrsc = "<img src=\"/image/hot.gif\"></img>";
$null_imgrsc = "<img src=\"/image/null.gif\"></img>";
#####################################
# 娶作家
#####################################
if ( open( FILE, "<$file_tmp" ) )
{
@a = <FILE>;
foreach( @a )
{
if ( index( $_, "<DIR>" ) > 0 )
{
($c1,$c2) = split( "<DIR>", $_ );
$c2 =~ s/^ //g;
$c2 =~ s/$\///g;
#if ( !($c2 in @not_in_list) )
#{
$addit = 1;
for ( $j=0; $j<scalar(@not_in_list); $j++)
{
if ( lc($not_in_list[$j]) eq lc($c2) )
{
$addit=0;
}
}
if ( $addit == 1 )
{
$subdirs[$i++] = $c2;
print "o";
}
print ".";
}
else
{
}
}
close( FILE );
}
$dfile = "photos.dat";
$dlimt = "clicks\";i:";
$plimt = "cached_photo_count\";i:";
$fileBuf = "";
$strbuf = "";
$strtmp = "";
@fdata = ();
%auth_kname;
%auth_rname;
%auth_pcount;
%auth_clicks;
####################################
# 名字到 %auth_rname,
# Forum 到 %auth_fnum,
# index 到 %auth_index
####################################
if ( open( FILE, "<$file_roomer_list" ) )
{
my @a=<FILE>;
$total_roomer = $.;
foreach( @a )
{
( $rname, $fnum, $com1 ) = split( ",", $_ );
( $kname, $com2 ) = split( "\/", $com1 );
$kname = lc($kname);
$auth_rname{$kname} = $rname;
$auth_fnum{$kname} = $fnum;
$auth_index{$kname} = $com1;
}
close( FILE );
}
#####################################
# 讀取 ClickCount / PCOUNT / # "clicks";i:XXXX;
#####################################
foreach( @subdirs )
{
$df = $_;
$fileBuf = $directory.$df."/".$dfile;
$df = lc($df);
if ( -e $fileBuf )
{
print $fileBuf.$/;
if ( open( FILE, $fileBuf ) )
{
$cntBuf = 0;
$artBuf = 0;
if ( open( FILE, $fileBuf ) )
{
$strbuf = join( "", <FILE> );
$strbuf =~ s/;/\n/g;
@a = split( "\n", $strbuf );
foreach( @a )
{
$zBuf = 0;
if ( index( $_, "i\:" ) != -1 && index( $last, "clicks" ) != -1 )
{
($zBuf,$zBuf) = split( ":", $_ );
$cntBuf += $zBuf;
++$artBuf;
}
$last = $_;
}
#print $cntBuf.$/;
#print $artBuf.$/;
}
$auth_pcount{$df} = $artBuf;
$auth_tclicks{$df} = $cntBuf;
$auth_clicks{$df} = sprintf( "%.2f", ($cntBuf/$artBuf));
close( FILE );
}
}
}
########################################## 把 template 讀進來,然後至換
$strbuf = "";
$strAll = "";
if ( open( FILE, "<$file_template1" ) )
{
$strTpl1 = join( "", <FILE> );
close( FILE );
}
if ( open( FILE, "<$file_template2" ) )
{
$strTpl2 = join( "", <FILE> );
close( FILE );
}
#print $strTpl2;
$j = 1;
$k = 0;
$l = 1;
$strAltAll="";
foreach $key (sort {$auth_clicks{$b} <=> $auth_clicks{$a}} keys %auth_clicks)
{
$strbuf = $strTpl2;
$strbuf =~ s/{A_REALNAME}/$auth_rname{$key}/g;
$strbuf =~ s/{A_PCOUNT}/$auth_pcount{$key}/g;
$strbuf =~ s/{A_CLICKS}/$auth_clicks{$key}/g;
$strbuf =~ s/{A_GALLERY}/$key/g;
$strbuf =~ s/{A_FORUM}/$auth_fnum{$key}/g;
$strbuf =~ s/{A_INDEX}/$auth_index{$key}/g;
$strbuf =~ s/{NUM}/$j/g;
$strbuf =~ s/{T_CLICKS}/$auth_tclicks{$key}/g;
$strAltAll .= $key.",".$auth_clicks{$key}.$/;
if ( $j <= $hot_gap )
{
$strbuf =~ s/{HOT_IMG}/$hot_imgrsc/g;
}
else
{
$strbuf =~ s/{HOT_IMG}//g;
}
$j++;
$l++;
$strAll .= $strbuf;
if ( $l > $per_page )
{
print " 換頁...$k ".$/;
$strAll[$k] = $strAll;
$l = 1;
$k++;
$strAll = "";
}
}
$strAll[$k] = $strAll;
print "========> ".$j.$/;
########################################## 寫進去
#if ( open( FILE, ">$file_artistHit" ) )
#{#
# print FILE ($strTpl1);
# close( FILE );
#}
print "========> ".scalar(@strAll).$/;
$strbuf = "";
$strtmp = "";
$i = 1;
foreach (@strAll)
{
$strbuf = $strTpl1;
$loct = localtime();
$strbuf =~ s/{RANK_LIST}/$_/;
$strbuf =~ s/{TOTAL_ROOMER}/$total_roomer/;
$strbuf =~ s/{UPDATE_TIME}/$loct/;
########################################## 寫進去
$strtmp = $file_artistHit;
$strtmp =~ s/{NUM}/$i/g;
$i++;
print "產生: $strtmp".$/;
if ( open( FILE, ">$strtmp" ) )
{
print FILE ($strbuf);
close( FILE );
}
}
#########################################
if ( open( FILE, ">$file_artistHit2" ) )
{
print FILE ($strAltAll);
close( FILE );
}
exit;
(2014-06-22 18:24) |
|
[h1]Perl Code: Perl Web Utilities decades ago (3) [/h1]
看不太懂這段的目的了...應該是當時駐站畫家的處理;
總之一樣和土法煉鋼 Image Gallery 有關。
代碼:
#!C:/Perl/bin/Perl.exe
use File::Find;
use Time:😜iece;
use LWP::Simple;
use POSIX qw(strftime);
$timeOneDay = 86400;
$dayMultipler = 1;
$ByteCount = 0;
$fileAll = 0;
$fileJpg = 0;
$fileYes = 0;
####### 總共查三個目錄 ToTra / ToHa (CG) / ToSFX (SFX)
$pathToTra = "D:/Apache2/htdocs/gallery/albums/";
$pathToHa = "D:/Apache2/htdocs/vovo-gallery/data/VovoCG/";
$pathToSFX = "D:/Apache2/htdocs/vovo-gallery/data/sfx/";
$thumbExt = ".thumb.jpg";
$contrib = "distrib";
$roomerlist = "D:/Apache2/htdocs/friend/roomer_list.txt";
$targetPath = "D:/Apache2/htdocs/news/2005/";
$targetExt = ".htm";
$template = "D:/vovoutil/template-gala.tpl";
$template_img = "D:/vovoutil/template-img.tpl";
$template_welcome = "D:/vovoutil/news_wordlist_welcome.tpl";
@auth=();
@fnam=();
@roomer_list=();
if ( open(FILE, $template_img) )
{
$strImg = join( "", <FILE>);
close( FILE );
}
if ( open(FILE, $roomerlist) )
{
@roomer_list = <FILE>;
close( FILE );
}
$roomer_count = scalar(@roomer_list);
$gt = localtime;
$t1 = $gt->epoch;
@ppp = ( $pathToHa, $pathToTra, $pathToSFX );
find(\&fileThumb, @ppp );
$gt = localtime;
$t2 = $gt->epoch;
print "Total KByte: ".($ByteCount/1024)."\n";
print "Total Scan: ".$fileAll."\n";
print "Total Jpeg: ".$fileJpg."\n";
print "Total Match: ".$fileYes."\n";
print "Total TimeCost: ".($t2-$t1)."\n";
## 產生 YYYYMMDD.htm
$strAll = "";
$bbCount = 0;
$lastAuth = "";
$piccount = 0;
for ( $i = 0; $i < scalar(@auth); $i++ )
{
print $auth[$i].$/;
if ( $bbCount == 0 )
{
$strAll .= "<tr>\n";
}
$strBuf = $strImg;
if ( $auth[$i] ne "VovoCG" && $auth[$i] ne "VovoSFX" )
{
$g_imag = "/gallery/albums/$auth[$i]/$fnam[$i]"."$thumbExt";
$g_view = "/gallery/view_photo.php?set_albumName=$auth[$i]&id=$fnam[$i]";
$strBuf =~ s/{NEWS-IMG-SRC}/$g_imag/g;
$strBuf =~ s/{NEWS-HREF}/$g_view/g;
$authBuf = findRealAuth($auth[$i]);
print $authBuf;
if ( $auth[$i] eq $contrib )
{
$strBuf =~ s/{AUTH}/$auth[$i]/g;
$strBuf =~ s/駐站畫家//g;
$strBuf =~ s/{RNAME}/投稿園地/g;
$strAll .= $strBuf;
$switch = 1;
}
else
{
$strBuf =~ s/{AUTH}/$auth[$i]/g;
$strBuf =~ s/{RNAME}/$authBuf/g;
if ( $lastAuth eq $auth[$i] )
{
$switch = 0;
$piccount++;
}
else
{
$strAll .= $strBuf;
$switch = 1;
$piccount=0;
}
}
}
else
{
if ( $auth[$i] eq "VovoCG" )
{
$gala_ha = "http://vovo2000.com/vovo-gallery/data/VovoCG";
$gala_ha2 = "http://vovo2000.com/vovo-gallery/VovoCG";
}
elsif ( $auth[$i] eq "VovoSFX" )
{
$gala_ha = "http://vovo2000.com/vovo-gallery/data/sfx";
$gala_ha2 = "http://vovo2000.com/vovo-gallery/sfx";
}
$g_imag = $gala_ha."/".$ha_p;
$g_view = $gala_ha2;
$strBuf =~ s/{NEWS-IMG-SRC}/$g_imag/g;
$strBuf =~ s/http:\/\/artist.vovo2000.com\/{AUTH}/$g_view/g;
$strBuf =~ s/駐站畫家//g;
$strBuf =~ s/{RNAME}/小哈美術插畫/g;
$strAll .= $strBuf;
$switch = 1;
print "=======".$fname[$i]."=========".$/;
}
$lastAuth = $auth[$i];
if ( $switch == 1 )
{
$bbCount++;
if ( $bbCount >= 4 )
{
$strAll .= "</tr>\n";
$bbCount = 0;
}
}
}
if ( $i >= 1 && ($bbCount != 0 && $bbCount !=4 ) )
{
$strAll .= "</tr>";
}
if ( $strAll ne "" )
{
$strAll .= "<\!-- ".scalar(localtime)." AutoCreated end-(thwu) \/\/-->";
if ( open(FILE, $template) )
{
$strTpl = join( "", <FILE>);
close( FILE );
}
$strTpl =~ s/{NEWS-IMG-ONLY}/$strAll/g;
$strBuf = $gt->ymd;
$strBuf =~ s/-//g;
$strToday = "<li>".($gt->ymd("/"))." (".$gt->wdayname.")</li><br>";
$strTpl =~ s/{NEWS-DATE-TIME}/$strToday/g;
### 歡迎 {WELCOME}
srand;
if ( open( FILE, "<$template_welcome" ) )
{
@tmp=<FILE>;
$strTpl =~ s/{WELCOME}/$tmp[rand($.)]/g;
close( FILE );
}
if( open(FILE, ">$targetPath".$strBuf.$targetExt ) )
{
print FILE ($strTpl);
close( FILE );
}
}
exit;
sub fileThumb
{
$fileAll++;
if ( (/thumb\.jpg$/) )
{
$fileJpg++;
my $lt = 0;
$lt = localtime;
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($_) or die "Unable to stat $_\n";
my $ctime_str = strftime "%Y-%m-%d", localtime($mtime);
my $nowcp_str = $lt->ymd("-");
if ( $ctime_str eq $nowcp_str )
{
my $tmp = $File::Find::name;
if ( index( $tmp, "VovoCG" ) == -1 )
{
if ( index( $tmp, "sfx" ) == -1 )
{
## 駐站
$tmp =~ s/$pathToTra//g;
($auth[$fileYes], $fnam[$fileYes])=split( "\/", $tmp );
$fnam[$fileYes] =~ s/$thumbExt//g;
$fileYes++;
print "駐站===".$tmp.$/;
}
else
{
## SFX
$tmp =~ s/$pathToSFX//g;
($auth[$fileYes], $fnam[$fileYes])=split( "\/", $tmp );
$ha_p = $auth[$fileYes];
$auth[$fileYes] = "VovoSFX";
$fileYes++;
print "哈哈===SFX".$tmp.$/;
}
}
else
{
$tmp =~ s/$pathToHa//g;
($auth[$fileYes], $fnam[$fileYes])=split( "\/", $tmp );
$ha_p = $auth[$fileYes];
$auth[$fileYes] = "VovoCG";
$fileYes++;
print "哈哈===".$tmp.$/;
}
}
}
}
sub findRealAuth
{
local($par) = shift(@_);
my $j=0;
for( $j = 0; $j < $roomer_count; $j++ )
{
$roomer_list[$j] =~ s/\n//g;
$roomer_list[$j] =~ s/\r//g;
( $a, $b, $c ) = split( ",", $roomer_list[$j] );
( $e, $f ) = split( "\/", $c );
if ( $par eq $e )
{
return $a;
}
}
return $par;
}
(2014-06-22 18:21) |
|
[h1]Perl Code: 十幾年前的 Vovo2000.Com Perl Web Utilities (2)[/h1]
[h2]stat_Gallery_HotPic[/h2]
這是 2003 年,土法煉鋼硬讀取 Gallery 1 資料庫,取出「最熱門作品」的 Perl Code
代碼:
#!C:/perl/bin/perl.exe
$directory = "D:/Apache2/htdocs/gallery/albums/";
$directory2 = "D:\\Apache2\\htdocs\\gallery\\albums\\";
$file_tmp = "D:/VovoUtil/tmp2.file";
$file_hotpicHit = "D:/Apache2/Htdocs/friend/rank_hotestPic{NUM}.htm";
$file_template1 = "template-hotpicrank.tpl";
$file_template2 = "template-hotpicrank-detail.tpl";
$file_roomer_list = "D:/Apache2/Htdocs/friend/roomer_list.txt";
#@not_in_list = ( "18", "ClubTWCP" , "friend", "distrib" );
@not_in_list = ( "friend", "distrib" );
system( "dir $directory2 > $file_tmp" );
$i = 0;
$j = 0;
$hot_gap = 5;
$stop_gap = 300;
$per_page = 15;
$hot_imgrsc = "<img src=\"/image/hot.gif\"></img>";
$null_imgrsc = "<img src=\"/image/null.gif\"></img>";
#####################################
# 娶作家
#####################################
if ( open( FILE, "<$file_tmp" ) )
{
@a = <FILE>;
foreach( @a )
{
if ( index( $_, "<DIR>" ) > 0 )
{
($c1,$c2) = split( "<DIR>", $_ );
$c2 =~ s/^ //g;
$c2 =~ s/$\///g;
$addit = 1;
for ( $j=0; $j<scalar(@not_in_list); $j++)
{
if ( lc($not_in_list[$j]) eq lc($c2) )
{
$addit=0;
}
}
if ( $addit == 1 )
{
$subdirs[$i++] = $c2;
}
#print $_;
}
else
{
}
}
close( FILE );
}
$dfile = "photos.dat";
$dlimt = "clicks\";";
$plimt = "\"image\":12:{s:4:\"name\";s:";
$fileBuf = "";
$strbuf = "";
$strtmp = "";
@fdata = ();
%auth_kname;
%auth_rname;
%auth_pcount;
%auth_clicks;
####################################
# 名字到 %auth_rname,
# Forum 到 %auth_fnum,
# index 到 %auth_index
####################################
if ( open( FILE, "<$file_roomer_list" ) )
{
my @a=<FILE>;
$total_roomer = $.;
foreach( @a )
{
( $rname, $fnum, $com1 ) = split( ",", $_ );
( $kname, $com2 ) = split( "\/", $com1 );
$kname = lc($kname);
$auth_rname{$kname} = $rname;
$auth_fnum{$kname} = $fnum;
$auth_index{$kname} = $com1;
}
close( FILE );
}
#####################################
# 讀取 ClickCount / PCOUNT
#####################################
$total_pics = 0;
foreach( @subdirs )
{
$df = $_;
$fileBuf = $directory.$df."/".$dfile;
$df = lc($df);
if ( -e $fileBuf )
{
print $fileBuf.$/;
if ( open( FILE, $fileBuf ) )
{
$strbuf = join("",<FILE>);
$strtmp = "";
( $i, $l, $k ) = split( ":", $strbuf );
$i = 0;
$a = "";
for( $k=0; $k<$l; $k++ )
{
$total_pics++;
##### 讀取作品數 到 %auth_pcount
$strtmp = "";
$i = index( $strbuf, $plimt, $i );
$i += length($plimt);
$strspc = substr( $strbuf, $i, 2 ); ## 取最多兩位
$strspc =~ s/://g;
$zz = ( $strspc eq substr( $strbuf, $i, 2 ) ? 2 : 1 );
$i += 2 + $zz;
for( $j=0; $j<int($strspc); $j++ )
{
$a = substr($strbuf, $i+$j, 1 );
if ( $a ne ";" )
{
$strtmp .= $a;
}
else
{
$j = 10;
}
}
$strtmp =~ s/\"//g;
$strtmp =~ s/://g;
#print "檔名: ".$strtmp.$/;
$fname = $strtmp;
##### 讀取總點擊數 到 %auth_clicks
$i = index( $strbuf, $dlimt, $i );
$i += length($dlimt);
$strtmp = "";
$a = "";
if ( substr($strbuf, $i, 1 ) ne "N" )
{
for( $j=2; $j<8; $j++ )
{
$a = substr($strbuf, $i+$j, 1 );
if ( $a ne ";" )
{
$strtmp .= $a;
}
else
{
$j = 10;
}
}
}
else
{
$strtmp = "0";
}
#print "點點: ".$strtmp.$/;
$auth_clicks{$df.":".$fname} = $strtmp;
close( FILE );
}
}
}
}
########################################## 把 template 讀進來,然後至換
$strbuf = "";
$strall = "";
@strAll = ();
if ( open( FILE, "<$file_template1" ) )
{
$strTpl1 = join( "", <FILE> );
close( FILE );
}
if ( open( FILE, "<$file_template2" ) )
{
$strTpl2 = join( "", <FILE> );
close( FILE );
}
#print $strTpl2;
$j = 1;
$l = 1;
$k = 0;
foreach $key (sort {$auth_clicks{$b} <=> $auth_clicks{$a}} keys %auth_clicks)
{
$strbuf = $strTpl2;
( $key1, $key2 ) = split( ":", $key );
$clicks = $auth_clicks{$key};
$pica = $key2.".thumb.jpg";
if ( $auth_rname{$key1} ne "" )
{
$strbuf =~ s/{A_REALNAME}/$auth_rname{$key1}/g;
}
else
{
$strbuf =~ s/{A_REALNAME}/[CLUB]-$key1/g;
}
#$strbuf =~ s/{A_PCOUNT}/$auth_pcount{$key1}/g;
$strbuf =~ s/{A_CLICKS}/$clicks/g;
$strbuf =~ s/{A_GALLERY}/$key1/g;
$strbuf =~ s/{A_FORUM}/$auth_fnum{$key1}/g;
$strbuf =~ s/{A_INDEX}/$auth_index{$key1}/g;
$strbuf =~ s/{A_PIC_THUMB}/$pica/g;
$strbuf =~ s/{NUM}/$j/;
$strbuf =~ s/{A_PIC}/$key2/g;
if ( $j <= $hot_gap )
{
$strbuf =~ s/{HOT_IMG}/$hot_imgrsc/g;
}
else
{
$strbuf =~ s/{HOT_IMG}//g;
}
$j++;
$l++;
$strAll .= $strbuf;
if ( $l > $per_page )
{
$strAll[$k] = $strAll;
$l = 1;
$k++;
$strAll = "";
}
if ( $j > $stop_gap ) { last; }
}
$loct = localtime();
$strbuf = "";
$strtmp = "";
$i = 1;
foreach (@strAll)
{
$strbuf = $strTpl1;
#print $_;
$strbuf =~ s/{RANK_LIST}/$_/;
$strbuf =~ s/{TOTAL_PICS}/$total_pics/;
$strbuf =~ s/{HOWMUCH}/$stop_gap/;
$strbuf =~ s/{UPDATE_TIME}/$loct/;
########################################## 寫進去
$strtmp = $file_hotpicHit;
$strtmp =~ s/{NUM}/$i/g;
$i++;
print "產生: $strtmp".$/;
if ( open( FILE, ">$strtmp" ) )
{
print FILE ($strbuf);
close( FILE );
}
}
exit;
代碼:
#!C:/perl/bin/perl.exe
$directory = "D:/Apache2/htdocs/gallery/albums/";
$directory2 = "D:\\Apache2\\htdocs\\gallery\\albums\\";
$file_tmp = "D:/VovoUtil/tmp.file";
$file_artistHit = "D:/Apache2/Htdocs/friend/rank_artistHit{NUM}.htm";
$file_artistHit2 = "D:/Apache2/Htdocs/friend/rank_artistHit.txt";
$file_template1 = "template-artisthitrank.tpl";
$file_template2 = "template-artisthitrank-detail.tpl";
$file_roomer_list = "D:/Apache2/Htdocs/friend/roomer_list.txt";
@not_in_list = ( "18", "ClubTWCP", "friend", "distrib", "vovo2000" );
$per_page = 25; # 分頁
system( "dir $directory2 > $file_tmp" );
$i = 0;
$j = 0;
$hot_gap = 5;
$hot_imgrsc = "<img src=\"/image/hot.gif\"></img>";
$null_imgrsc = "<img src=\"/image/null.gif\"></img>";
#####################################
# 娶作家
#####################################
if ( open( FILE, "<$file_tmp" ) )
{
@a = <FILE>;
foreach( @a )
{
if ( index( $_, "<DIR>" ) > 0 )
{
($c1,$c2) = split( "<DIR>", $_ );
$c2 =~ s/^ //g;
$c2 =~ s/$\///g;
#if ( !($c2 in @not_in_list) )
#{
$addit = 1;
for ( $j=0; $j<scalar(@not_in_list); $j++)
{
if ( lc($not_in_list[$j]) eq lc($c2) )
{
$addit=0;
}
}
if ( $addit == 1 )
{
$subdirs[$i++] = $c2;
print "o";
}
print ".";
}
else
{
}
}
close( FILE );
}
$dfile = "photos.dat";
$dlimt = "clicks\";i:";
$plimt = "cached_photo_count\";i:";
$fileBuf = "";
$strbuf = "";
$strtmp = "";
@fdata = ();
%auth_kname;
%auth_rname;
%auth_pcount;
%auth_clicks;
####################################
# 名字到 %auth_rname,
# Forum 到 %auth_fnum,
# index 到 %auth_index
####################################
if ( open( FILE, "<$file_roomer_list" ) )
{
my @a=<FILE>;
$total_roomer = $.;
foreach( @a )
{
( $rname, $fnum, $com1 ) = split( ",", $_ );
( $kname, $com2 ) = split( "\/", $com1 );
$kname = lc($kname);
$auth_rname{$kname} = $rname;
$auth_fnum{$kname} = $fnum;
$auth_index{$kname} = $com1;
}
close( FILE );
}
#####################################
# 讀取 ClickCount / PCOUNT / # "clicks";i:XXXX;
#####################################
foreach( @subdirs )
{
$df = $_;
$fileBuf = $directory.$df."/".$dfile;
$df = lc($df);
if ( -e $fileBuf )
{
print $fileBuf.$/;
if ( open( FILE, $fileBuf ) )
{
$cntBuf = 0;
$artBuf = 0;
if ( open( FILE, $fileBuf ) )
{
$strbuf = join( "", <FILE> );
$strbuf =~ s/;/\n/g;
@a = split( "\n", $strbuf );
foreach( @a )
{
$zBuf = 0;
if ( index( $_, "i\:" ) != -1 && index( $last, "clicks" ) != -1 )
{
($zBuf,$zBuf) = split( ":", $_ );
$cntBuf += $zBuf;
++$artBuf;
}
$last = $_;
}
#print $cntBuf.$/;
#print $artBuf.$/;
}
$auth_pcount{$df} = $artBuf;
$auth_tclicks{$df} = $cntBuf;
$auth_clicks{$df} = sprintf( "%.2f", ($cntBuf/$artBuf));
close( FILE );
}
}
}
########################################## 把 template 讀進來,然後至換
$strbuf = "";
$strAll = "";
if ( open( FILE, "<$file_template1" ) )
{
$strTpl1 = join( "", <FILE> );
close( FILE );
}
if ( open( FILE, "<$file_template2" ) )
{
$strTpl2 = join( "", <FILE> );
close( FILE );
}
#print $strTpl2;
$j = 1;
$k = 0;
$l = 1;
$strAltAll="";
foreach $key (sort {$auth_clicks{$b} <=> $auth_clicks{$a}} keys %auth_clicks)
{
$strbuf = $strTpl2;
$strbuf =~ s/{A_REALNAME}/$auth_rname{$key}/g;
$strbuf =~ s/{A_PCOUNT}/$auth_pcount{$key}/g;
$strbuf =~ s/{A_CLICKS}/$auth_clicks{$key}/g;
$strbuf =~ s/{A_GALLERY}/$key/g;
$strbuf =~ s/{A_FORUM}/$auth_fnum{$key}/g;
$strbuf =~ s/{A_INDEX}/$auth_index{$key}/g;
$strbuf =~ s/{NUM}/$j/g;
$strbuf =~ s/{T_CLICKS}/$auth_tclicks{$key}/g;
$strAltAll .= $key.",".$auth_clicks{$key}.$/;
if ( $j <= $hot_gap )
{
$strbuf =~ s/{HOT_IMG}/$hot_imgrsc/g;
}
else
{
$strbuf =~ s/{HOT_IMG}//g;
}
$j++;
$l++;
$strAll .= $strbuf;
if ( $l > $per_page )
{
print " 換頁...$k ".$/;
$strAll[$k] = $strAll;
$l = 1;
$k++;
$strAll = "";
}
}
$strAll[$k] = $strAll;
print "========> ".$j.$/;
########################################## 寫進去
#if ( open( FILE, ">$file_artistHit" ) )
#{#
# print FILE ($strTpl1);
# close( FILE );
#}
print "========> ".scalar(@strAll).$/;
$strbuf = "";
$strtmp = "";
$i = 1;
foreach (@strAll)
{
$strbuf = $strTpl1;
$loct = localtime();
$strbuf =~ s/{RANK_LIST}/$_/;
$strbuf =~ s/{TOTAL_ROOMER}/$total_roomer/;
$strbuf =~ s/{UPDATE_TIME}/$loct/;
########################################## 寫進去
$strtmp = $file_artistHit;
$strtmp =~ s/{NUM}/$i/g;
$i++;
print "產生: $strtmp".$/;
if ( open( FILE, ">$strtmp" ) )
{
print FILE ($strbuf);
close( FILE );
}
}
#########################################
if ( open( FILE, ">$file_artistHit2" ) )
{
print FILE ($strAltAll);
close( FILE );
}
exit;
(2014-06-22 18:17) |
|
[h1]Perl 維護 Web 程式碼: Vovo2000.Com Perl Web Utilities (1) [/h1]
這些 Perl code 是大約 2003 年使用 Windows Server 2003 + Apache 的 Web Server 維護程式 ... 各種老舊!
不過當時可 works,有部分還都一直用到 2007~2008 年左右!
貼出來的原因是,整理房間時,發現一個 8MB CF Card 裡面存了這些 code
(沒看錯, 8MB CF Made in Japan, Canon PowerShot A5Z 送的...)
這些 code 已經十幾年...目前完全沒使用了,若要拿去參考請小心。
[h2]Windows Server 備份 Apache Backup[/h2]
代碼:
#!c:/perl/bin/perl
use File::NCopy qw(copy);
use Time:😜iece;
$file_toBackup = "D:/Vovoutil/BackupUtil/toBackup.txt";
$pathTarget = "E:/backup/".localtime->wday;
$pathTarget = "E:\\backup\\".localtime->wday;
print $pathTarget;
if( open( FILE, $file_toBackup ) )
{
foreach( <FILE> )
{
$a = $_;
system( "mkdir $_" );
print "備份: ".$a.$/;
copy \1, $_, $pathTarget;
}
close( FILE );
}
[h2]Windows deltempfile.bat[/h2]
因為 Session File 會存在 Temp,定時清一下
代碼:
del /f /q c:\winnt\temp\*.*
[h2]Windows deltempfile.bat[/h2]
Goal: 因為 PHP/Apache2 Session File 會存在 Temp,定時清一下
代碼:
del /f /q c:\winnt\temp\*.*
[h2]Replace String in Files Perl Code[/h2]
這段 code 目的很簡單,就是把所有 Files 裡面的 "web.vovo.idv.tw" & "www.vovo2000.com" 改成 "vovo2000.com"
代碼:
#!C:/perl/bin/perl
use File::Find;
sub mysub(); # Our custom subroutine
@directories = ("D:/apache2/htdocs/");
$tar1 = "web.vovo.idv.tw";
$tar2 = "www.vovo.idv.tw";
find(\&mysub, @directories);
sub mysub()
{
my ($filename) = $_;
if ( ($filename =~ /\.htm$/) || ($filename =~ /\.html$/) || ($filename =~ /\.php$/) )
{
print "$filename ";
if( open( FILE, $filename ) )
{
$a = join( "", <FILE> );
close( FILE );
$r = 0;
if ( $a =~ /$tar1/ )
{
$r = 1;
}
if ( $a =~ /$tar2/ )
{
$r = 1;
}
if ( $r == 1 )
{
### 先備份
if ( open( FILE, ">$filename".".orig" ) )
{
print FILE ($a);
close(FILE);
}
### 至換
$a =~ s/$tar1/vovo2000.com/g;
$a =~ s/$tar2/vovo2000.com/g;
if ( open( FILE, ">$filename" ) )
{
print FILE ($a);
close(FILE);
}
print "=============>改".$/;
}
else
{
print "=>不改".$/;
}
}
}
}
[h2]DailyArist.pl Perl Code[/h2]
2000 ~ 2005 年,Vovo2000.com 還是採用 Gallery 1 or Gallery 2
這是產生每日投稿的 Perl Code(從 Gallery 目錄裡面硬 parse)
代碼:
#!C:/Perl/bin/Perl.exe
use File::Find;
use Time:😜iece;
use POSIX qw(strftime);
use Switch;
$timeOneDay = 86400;
$dayMultipler = 1;
$ByteCount = 0;
$fileAll = 0;
$fileJpg = 0;
$fileYes = 0;
$pathToTra = "D:/Apache2/htdocs/gallery/albums/";
$pathWebPreFix = "/gallery/albums/";
$thumbExt = ".thumb.jpg";
$contrib = "distrib";
$roomerlist = "D:/Apache2/htdocs/friend/roomer_list.txt";
$targetPath = "D:/Apache2/htdocs/news/";
$targetExt = "dailyArtist.htm";
$template = "D:/vovoutil/template-dailyArtist.tpl";
@fname=();
@roomer_list=();
if ( open(FILE, $template) )
{
$strTpl = join( "", <FILE>);
close( FILE );
}
if ( open(FILE, $roomerlist) )
{
@roomer_list = <FILE>;
close( FILE );
}
$roomer_count = scalar(@roomer_list);
## 產生 YYYYMMDD.htm
srand;
$intLuckGuy = int(rand()*$roomer_count);
( $a, $b, $c ) = split( ",", $roomer_list[$intLuckGuy] );
( $e, $f ) = split( "\/", $c );
print $e.$/;
print $e.$/;
print $e.$/;
$pathToTra = $pathToTra.$e;
find(\&fileHighLight, $pathToTra);
$img_high = $fname[int(rand()*scalar(@fname))];
print "We show this...: ".$img_high.$/;
$strTpl =~ s/{AUTH}/$e/g;
$strTpl =~ s/{RNAME}/$a/g;
$strTpl =~ s/{HIGHLIGHT}/$img_high/g;
$strTpl =~ s/{FNUM}/$b/g;
$strTpl =~ s/{FIDX}/$c/g;
#print $strTpl.$/;
if( open(FILE, ">$targetPath".$targetExt ) )
{
print FILE ($strTpl);
close( FILE );
}
exit;
sub fileHighLight
{
if ((/$thumbExt/) )
{
$tmp = $File::Find::name;
$tmp2 = $tmp;
$tmp2 =~ s/$pathToTra//g;
#($auth[$fileYes], $fnam[$fileYes])=split( "\/", $tmp2 );
#print $auth[$fileYes].$/;
$fname[$fileYes++] = $tmp2;
print $tmp.$/;
}
}
代碼:
#!C:/perl/bin/perl.exe
$directory2004 = "D:\\Apache2\\htdocs\\news\\2004\\2004*.htm";
$file_tmp = "D:/VovoUtil/tmparch.file";
$file_newsarchive = "D:/Apache2/htdocs/news/news_archives.htm";
$file_template1 = "template-newsArchives.tpl";
$file_roomer_list = "D:/Apache2/Htdocs/friend/roomer_list.txt";
system( "dir $directory2004 > $file_tmp" );
$i = 0;
$j = 0;
$template_str2003 = "[ <a href=\"/news/2004/{HTML}\" title=\"Vovo2000.Com Site News {DATE}\">{DATE}</a> ]";
#####################################
# 取出新聞
#####################################
if ( open( FILE, "<$file_tmp" ) )
{
@a = <FILE>;
foreach( @a )
{
#print $_;
if ( index( $_, ".htm" ) > 0 )
{
$strbuf = $template_str2003;
($c1,$c2,$c3,$c4) = split( / +/, $_ );
$c1 = $c4;
$c1 =~ s/-m//g;
$c1 =~ s/.htm//g;
$c1 = substr( $c1, 0, 4)."-".substr( $c1, 4, 2 )."-".substr( $c1, 6, 2 );
$strbuf =~ s/{DATE}/$c1/g;
$strbuf =~ s/{HTML}/$c4/g;
$strAll .= $strbuf;
if ( $i++ > 8 ) { $i = 0; $strAll .= "<BR />"; }
}
}
close( FILE );
}
print $strAll;
########################################## 把 template 讀進來,然後至換
if ( open( FILE, "<$file_template1" ) )
{
$strTpl1 = join( "", <FILE> );
close( FILE );
}
$loct = localtime();
$strTpl1 =~ s/{V2K_NEWS_THISYEAR_DAYBYDAY}/$strAll/;
$strTpl1 =~ s/{UPDATE_TIME}/$loct/;
#print $strTpl1;
########################################## 寫進去
if ( open( FILE, ">$file_newsarchive" ) )
{
print FILE ($strTpl1);
close( FILE );
}
exit;
[h2]Apache Log Rotate and Restart Perl Code[/h2]
這段 Code 是因為 2003 ~ 2004 年左右的 Apache "for Windows" LogRotate
功能還是很爛! 所以只好自己寫。
代碼:
#!C:/Perl/bin/Perl.exe
($sec,$min,$hour,$mday,$mon,$year,$wday)=(localtime)[0,1,2,3,4,5,6];
$year += 1900;
$mon += 1;
$logg = $year."-".$mon."-".$mday.".log";
print "Stopping APACHE2!\n";
system( "D:\\Apache2\\bin\\apache -k stop" );
print "Renaming!...\n";
system( "move D:\\Apache2\\logs\\access.log D:\\Apache2\\logs\\$logg" );
print "Restarting APACHE2!\n";
system( "D:\\Apache2\\bin\\apache -k start" );
(2014-06-22 18:10) |
| |
[h1]升級: Ubuntu 12.04 Upgrade 14.04 設定注意事項[/h1]
Ubuntu 12.04 LTS: Apache 2 Httpd 2.2.X with PHP 5.3
Ubuntu 14.04 LTS: Apache 2 Httpd 2.4.X with PHP 5.5
Ubuntu 14.04 LTS default package
(1) Apache2 Httpd: 由 2.2.X 升級為 2.4.X
(2) PHP5: 由 PHP 5.3 升級為 PHP5.5 (但,沒有守護神)
所以當你從 Ubuntu 12.04 LTS --> 升級 --> 14.04 LTS,
你馬上就面臨 Apache2 HTTPD 的大改版
請先看這幾份文件
參考文件
=> https://library.linode.com/web-servers/apache/2.2-2.4-upgrade
=> http://httpd.apache.org/docs/2.4/upgrading.html
=> http://tw.php.net/migration54
=> http://tw.php.net/migration55
幾個重點要注意! Main effort 在 Apache 2.2 -> 2.4 因為改的不算少
1. 先備份 /etc/apache2/* + /etc/php5/* BACKUP FIRST!
2. Apache 2.2 有些本來在 apache2.conf ,Apache 2.4 移到了 conf-available
3. Apache 2.4 sites-available/* 要多加 .conf 附檔名
4. Apache 2.4 Rewrite Rules 有點小修改,如果你的寫法比較老式,要多注意!
5. Apache 2.2 的 Allow/Disallow,在 Apache 2.4 寫法改成 Require ... Granted
6. PHP 5.3 --> 5.5 如果你 Code 寫法偏向保守,沒有用太多功能,則可無痛升級,注意一下 php.ini 即可。
(2014-06-21 21:45) |
|
[h1]讓 /bin/dd 有進度 (dd with progress Ubuntu/Fedora)[/h1]
有兩種方式達成:
[h2]1. 配合 "pv" 或 "pv -s SIZE" 使用[/h2]
代碼:
$ apt-get install pv (or, yum install pv)
$ dd if=/dev/zero bs=4096 | pv -s 2G | of=/tmp/file
(這裡的 -s 2G 取代 count=524288)
[h2]2. 或者直接安裝 "dcfldd" 配合 "time"[/h2]
代碼:
$ apt-get install dcfldd (or, yum install dcfldd)
$ man dcfldd
$ dcfldd if=/dev/zero bs=4096 of=/tmp/file count=524288 statusinterval=1
$ time dcfldd if=/dev/zero bs=4096 of=/tmp/file count=524288 statusinterval=1
(2014-06-21 21:29) |
|
[h1]手機版 Android/iOS 遊戲畫面[/h1]
手機版玩起來...
(1) 畫面比 PC 精緻(e.g. 場景景深)
(2) 處理碰撞比較寬鬆(也就是比較「不容易死 + 容易觸發加速」)
(3) 但,還是用玩 PC + 滑鼠玩比較有樂趣,容易得到高分。
(2014-06-21 21:28) |
|
[h1]2014 June Record[/h1]
Without any C.F.F. Special(2014-06-21 21:04) |
|
[h1]2014 June Record[/h1]
Without any Nanaca C.F.F. Special(2014-06-21 21:04) |
|
[h1]Linux Task Manager / IO Monitor / Network Monitor: "top, htop, iotop, jnettop"[/h1]
Common-Seen Task Manager: "top"
Interactive TaskManager: "htop"
I/O Monitor / Disk Monitor: "iotop"
Network Traffic Monitor: "jnettop"
[h2]1. Install tools at Fedora 20 / Ubuntu 14.04[/h2]
代碼:
$ ################################ Ubuntu 14.04
$ sudo apt-get install top
$ sudo apt-get install iotop
$ sudo apt-get install jnettop
$ sudo apt-get install htop
Or
$ ################################ Fedora 20
$
$ sudo yum install iotop
$ sudo yum install jnettop
$ sudo yum install top
$ sudo yum install htop
[h2]2. Just run them (iotop & jnettop require root permission)[/h2]
代碼:
$ htop
$ top
$ sudo jnettop
$ sudo iotop
(2014-06-20 15:05) |
|
[h1]日本語「乙」「xxx乙」是什麼意思(おつれさま)[/h1]
おつれさま = お疲れ様 = 辛苦了 = おつ (簡)
不管是微軟輸入法,或者 Google 輸入法,
只打「おつ」第一個選項就是「乙」
久而久之,偷懶的網友,對於辛苦奉獻的稱讚,
就變成打「某某某乙」或者「1F 乙」
(2014-06-20 00:02) |
|
[h1]Ubuntu 14.04 64-bit LTS on Acer E11 E3-111 (Bay Trail)[/h1]
1. 可裝 Ubuntu 14.04 LTS Desktop ==> OK, Ubuntu 認到的 Bay Trail Graphics
2. 可裝 Fedora 20 Desktop ==> OK
代碼:
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 55
model name : Intel(R) Celeron(R) CPU N2930 @ 1.83GHz
stepping : 8
microcode : 0x80c
cpu MHz : 830.000
cache size : 1024 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
apicid : 6
initial apicid : 6
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch ida arat epb dtherm tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips : 3666.81
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
[h1]Stream_omp Performance Test[/h1]
代碼:
root@Aspire-E3-111:/tmp#
root@Aspire-E3-111:/tmp# ./stream_omp
-------------------------------------------------------------
This system uses 8 bytes per DOUBLE PRECISION word.
-------------------------------------------------------------
Array size = 2000000, Offset = 0
Total memory required = 45.8 MB.
Each test is run 10 times, but only
the *best* time for each is used.
-------------------------------------------------------------
Your clock granularity/precision appears to be 1 microseconds.
Each test below will take on the order of 9145 microseconds.
(= 9145 clock ticks)
Increase the size of the arrays if this shows that
you are not getting at least 20 clock ticks per test.
-------------------------------------------------------------
WARNING -- The above is only a rough guideline.
For best results, please be sure you know the
precision of your system timer.
-------------------------------------------------------------
Function Rate (MB/s) Avg time Min time Max time
Copy: 4480.6452 0.0077 0.0071 0.0093
Scale: 4403.4688 0.0078 0.0073 0.0111
Add: 4713.2528 0.0110 0.0102 0.0144
Triad: 4840.6288 0.0108 0.0099 0.0142
-------------------------------------------------------------
Solution Validates
-------------------------------------------------------------
root@Aspire-E3-111:/tmp#
(2014-06-17 21:54) |
| |
[h2]Linux run executable file "No such file or directory" error found but file exists there in fact![/h2]
[h1]Case #1. First, Usually a permission and path issue[/h1]
How to resolve? Just chmod 777 or 755, and use "./xxx" to execute it
代碼:
$ cd <path contains the file>
$ chmod 755 ./executable
$ ./executable
[h1]Case #2. Second, 32-bit vs 64-bit issues (Share Library Incompatible)[/h1]
It is because either you run a 32-bit executable on a 64-bit ENV,
or, you run a 64-bit executable on a 32-bit ENV,
or, you run a glibc-compiled-application upon a uclibc ENV!
Solution: How to Resolve? Just make sure your application fit with the library/32-bit-Arch/64-bit-arch.
*WARNING*
A 64-bit Kernel may co-exist with 32-bits Glibc ENV,
so make sure to be careful to use 32-bit application executable in such ENV.
(2014-06-16 18:00) |
| 前往頁面 ←上一頁 1 ... 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 ... 559 下一頁→
|
|