diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-20 18:21:08 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2010-10-20 18:21:08 +0800 |
commit | 5fc33484688c42654a15843ae6f16e15ff0e23d7 (patch) | |
tree | 011f88f1984d6671dfc5961d085eb506c77ff0f9 | |
parent | f705fd378502d77768d6493472498fda9dbcf9d9 (diff) | |
download | pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar.gz pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar.bz2 pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar.lz pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar.xz pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.tar.zst pttbbs-5fc33484688c42654a15843ae6f16e15ff0e23d7.zip |
remove unused files
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5131 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/sample/crontab | 4 | ||||
-rw-r--r-- | pttbbs/sample/crontab.old | 2 | ||||
-rw-r--r-- | pttbbs/util/countalldice.c | 91 | ||||
-rw-r--r-- | pttbbs/util/opendice.sh | 10 | ||||
-rw-r--r-- | pttbbs/util/openvice.c | 46 | ||||
-rw-r--r-- | pttbbs/util/stock.perl | 32 | ||||
-rw-r--r-- | pttbbs/util/stock.sh | 5 |
7 files changed, 0 insertions, 190 deletions
diff --git a/pttbbs/sample/crontab b/pttbbs/sample/crontab index 49b04f55..66bf8e1c 100644 --- a/pttbbs/sample/crontab +++ b/pttbbs/sample/crontab @@ -51,15 +51,11 @@ 30 6 1 * * bin/mandex 30 6 2-31 * 2,4,6 bin/mandex -x -# 每天發票開獎 -40 6 * * * bin/openvice - # 每天砍掉點歌超過 5天檔案 0 7 * * * /usr/bin/find /home/bbs/etc/SONGO/M* -mtime +5 -exec rm -f {} ';' # 天氣, 股票 0 5,11,17,23 * * * bin/weather.sh -20 12 * * * bin/stock.sh # 每個月十號早上 3:50 , 將 BBS 系統中長度為零的檔案砍掉 50 3 10 * * /usr/bin/find /home/bbs/boards/*/ -size 0 -exec rm -f {} ';' ; /usr/bin/find /home/bbs/home/*/ -size 0 -exec rm -f {} ';' diff --git a/pttbbs/sample/crontab.old b/pttbbs/sample/crontab.old index edec7b89..5b00b63f 100644 --- a/pttbbs/sample/crontab.old +++ b/pttbbs/sample/crontab.old @@ -40,14 +40,12 @@ # 每天精華區index一次 index前砍掉deleted的精華區 15 6 * * * rm -rf man/boards/deleted 20 6 * * * bin/mandex > /dev/null -30 6 * * * bin/openvice > /dev/null # 每天砍掉點歌超過5天檔案 40 6 * * * ( find /home/bbs/etc/SONGO/M* -mtime +5 -exec rm -f {} ';' ) #天氣股票 0 5,11,17,23 * * * bin/weather.sh > /dev/null -20 12 * * * bin/stock.sh > /dev/null # 每個月一號早上 3:50 , 將 BBS 系統中長度為零的檔案砍掉 50 3 1 * * ( /usr/bin/find /home1/bbs -size 0 -exec rm -f {} ';' ) diff --git a/pttbbs/util/countalldice.c b/pttbbs/util/countalldice.c deleted file mode 100644 index 45944362..00000000 --- a/pttbbs/util/countalldice.c +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id$ */ - -/**********************************************/ -/*這個程式是用來計算賭骰子賺得錢跟賠的錢的程式 */ -/*用法就是直接打 countalldice 就可以針對所有人 */ -/*來計算他總共賺了多少 賠了多少............... */ -/*作者:Heat 於1997/10/2 */ -/**********************************************/ - -#include "bbs.h" - -#define DICE_WIN BBSHOME "/etc/windice.log" -#define DICE_LOST BBSHOME "/etc/lostdice.log" - -int total = 0; - -typedef struct dice -{ - char id[14]; - int win; - int lost; -} -dice; - -dice table[1024]; - -int find(char *name) -{ - int i = 0; - if (total == 0) - { - total++; - return 0; - } - for (i = 0; i < total; i++) - if (!strcmp(name, table[i].id)) - return i; - memset(&table[total++], 0, sizeof(dice)); - return total - 1; -} - -int main() { - int index, win = 0, lost = 0; - FILE *fpwin, *fplost; - char buf[256], *ptr, buf0[256], *name = (char *) malloc(15), *mon = (char *) malloc(5); - - fpwin = fopen(DICE_WIN, "r"); - fplost = fopen(DICE_LOST, "r"); - - if (!fpwin || !fplost) - perror("error open file"); - - while (fgets(buf, 255, fpwin)) - { - strcpy(buf0, buf); - name = strtok(buf, " "); - mon = strstr(buf0, "淨賺:"); - if ((ptr = strchr(mon, '\n'))) - *ptr = 0; - index = find(name); - strcpy(table[index].id, name); - table[index].win += atoi(mon + 5); - } - fclose(fpwin); - - while (fgets(buf, 255, fplost)) - { - strcpy(buf0, buf); - name = strtok(buf, " "); - mon = strstr(buf0, "輸了 "); - if ((ptr = strchr(mon, '\n'))) - *ptr = 0; - if ((index = find(name)) == total - 1) - strcpy(table[index].id, name); - table[index].lost += atoi(mon + 5); - } - - for (index = 0; index < total; index++) - { - printf("%-15s 贏了 %-8d 塊錢, 輸掉 %-8d 塊錢\n", table[index].id - ,table[index].win, table[index].lost); - win += table[index].win; - lost += table[index].lost; - } - index = win + lost; - printf("\n人數: %d\n總贏錢=%d 總輸錢=%d 總金額:%d\n", total, win, lost, index); - printf("贏的比例:%f 輸的比例:%f\n", (float) win / index, (float) lost / index); - printf("\n備註:輸贏是以使用者的觀點來看\n"); - fclose(fplost); - return 0; -} diff --git a/pttbbs/util/opendice.sh b/pttbbs/util/opendice.sh deleted file mode 100644 index 767e213a..00000000 --- a/pttbbs/util/opendice.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# $Id: opendice.sh,v 1.1 2002/03/07 15:13:46 in2 Exp $ - -bin/countalldice > etc/dice.dis -bin/post Record "骰子中獎名單" "[骰子報告]" etc/windice.log -bin/post Security "骰子失敗名單" "[骰子報告]" etc/lostdice.log -bin/post Security "骰子期望值" "[骰子報告]" etc/dice.dis -rm -f etc/windice.log -rm -f etc/lostdice.log -rm -f etc/dice.dis diff --git a/pttbbs/util/openvice.c b/pttbbs/util/openvice.c deleted file mode 100644 index 588fc41d..00000000 --- a/pttbbs/util/openvice.c +++ /dev/null @@ -1,46 +0,0 @@ -/* $Id$ */ -/* 發票開獎小程式 */ - -#include "bbs.h" - -#define VICE_SHOW BBSHOME "/etc/vice.show1" -#define VICE_BINGO BBSHOME "/etc/vice.bingo" -#define VICE_NEW "vice.new" -#define VICE_DATA "vice.data" -#define MAX_BINGO 99999999 - -int main(int argc, char **argv) -{ - char *TABLE[5] = {"一", "二", "三", "四", "五"}; - int i = 0, bingo, base = 0; - - - FILE *fp = fopen(VICE_SHOW, "w"), *fb = fopen(VICE_BINGO, "w"); - - // XXX: resolve_utmp(); - attach_SHM(); - - srandom(SHM->number); - /* FIXME 小站的 SHM->number 變化不大, 可能導致開獎號碼固定 */ - - if (!fp || !fb ) - perror("error open file"); - - - bingo = random() % MAX_BINGO; - fprintf(fp, "%1c[1;33m統一發票中獎號碼[m\n", ' '); - fprintf(fp, "%1c[1;37m================[m\n", ' '); - fprintf(fp, "%1c[1;31m特別獎[m: [1;31m%08d[m\n\n", ' ', bingo); - fprintf(fb, "%d\n", bingo); - - while (i < 5) - { - bingo = (base + random()) % MAX_BINGO; - fprintf(fp, "%1c[1;36m第%s獎[m: [1;37m%08d[m\n", ' ', TABLE[i], bingo); - fprintf(fb, "%08d\n", bingo); - i++; - } - fclose(fp); - fclose(fb); - return 0; -} diff --git a/pttbbs/util/stock.perl b/pttbbs/util/stock.perl deleted file mode 100644 index e9d57580..00000000 --- a/pttbbs/util/stock.perl +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# $Id: stock.perl,v 1.1 2002/03/07 15:13:46 in2 Exp $ -# -# 不能跑的話,看看 bbspost 的路徑是否正確。 -# 如果發出的 post 沒有氣象報告而是說 URL 找不到,則確定一下能不能看到 -# 中央氣象局的 WWW 及 URL 是否正確。 -# 理論上適用所有 Eagle BBS 系列。 -# -- Beagle Apr 13 1997 -open(BBSPOST, " >etc/stock.tmp"); - -# Header -# 內容 -my $url = 'http://sii.tse.com.tw/html/T31'; -open(WEATHER, "/usr/bin/lynx -dump $url |"); -while(<WEATHER>) { - next if $_ eq "\n"; - last if m/^References/; - - s/\[[0-9\]]*//g; - - print BBSPOST $_; -} -close WEATHER; - -# 簽名檔 -print BBSPOST "\n--\n"; -print BBSPOST "我是beagle所有可愛的小餅乾...跨海為Ptt服務\n"; -print BBSPOST "--\n"; -print BBSPOST "☆ [Origin: ◎果醬小站◎] [From: [藍莓鬆餅屋] ] "; - -close BBSPOST; - diff --git a/pttbbs/util/stock.sh b/pttbbs/util/stock.sh deleted file mode 100644 index 907ddb73..00000000 --- a/pttbbs/util/stock.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# $Id: stock.sh,v 1.1 2002/03/07 15:13:46 in2 Exp $ -# -bin/stock.perl -bin/post Record 今日股票收盤價 [股市小姐] etc/stock.tmp |