首頁 美術繪圖 | 美術設計 | 熱門標籤 | 首選 | 首頁宣傳 | 近期作品 論壇: 發表 | 美術工作 | 美術比賽 | 展覽活動 | 美術相關 | 一般討論 | 美術同好 CG 討論 :: Photoshop | Painter | 3D 行動 | AMP

【 立即註冊 】 : 更改個人資料 : : 登入

會員名稱: 登入密碼: 保持登入
Type(Type) 所有的發表文章

前往頁面 ←上一頁  1 ... 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 ... 561  下一頁→

[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)

[center]Landscape Concept 2014[/center]
##DIV##
[center]
[h1]場景設計/人物設定 Char Design & Landscape/Scene Concept - 波波 2014[/h1]
2014 什麼!?有埋伏!? - Watch Out, Trap!
深海魚怪 完成(小) 深海魚怪 - Deep Sea Giant Fish
白起 -4(小) 秦國名將:白起 - Bai Qi General
matte painting範例 場景練習 - LandScape Design
構圖練習-2 構圖練習-2 - LandScape Design 2
[hr]
More 波波(e04su3su6)'s Artoworks

http://vovo2000.com/paintbbs/art/e04su3su6/
http://vovo2000.com/artist/e04su3su6/tags/
MORE: http://vovo2000.com/phpbb2/viewtopic-355545.html (MORE!)
[hr]
See Also:
[url=http://vovo2000.com/tags/海/]
「海」相關創作 :: "Sea Fantasy" Artworks Creation
[/url]

[url=http://vovo2000.com/tags/場景/]
「場景」相關創作 :: "Scene/Landscape" Design
[/url]

[url=http://vovo2000.com/tags/機械/]
「機械」相關創作 :: "Machine/Robots" Creation Painting
[/url]

[url=http://vovo2000.com/tags/人設/]
「人設」相關創作 :: "Sci-fi Fantasy" Artworks Creation
[/url]



[/center](2014-06-21 23:12)

[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)

[h1]VOA-ACT 補助已經發出[/h1]


本次 VOA-ACT April 2014 共有兩人申請
兩人都獲得全額補助

1. (kUma)(redeyes41) http://vovo2000.com/artist/redeyes41/
2. Vita維塔 http://vovo2000.com/artist/w145468/

Thank you!

(2014-06-17 00:08)

[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)

花床場景設計 Flower Bed(2014-06-15 23:05)

按摩椅動畫展示 GIF(2014-06-15 23:05)

浴缸場景設計 Bathtub Landscape(2014-06-15 23:05)

眼鏡行場景設計 Opticians Shop Landscape(2014-06-15 23:05)

愛情城市 Love City Landscape Design(2014-06-15 23:05)

賞月場景設計 Moon Festival Landscape(2014-06-15 23:05)

餐廳場景設計 Landscape Design of Cafeteria(2014-06-15 23:05)

龍椅場景 Dragon Chair(2014-06-15 23:05)

前往頁面 ←上一頁  1 ... 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 ... 561  下一頁→