fox II/IDEC networks | Login |
pkgname=('ii-net') pkgver=('03') pkgdesc=("russian fido-like messaging system with web interface") pkgrel=1 arch=('any') depends=('python2') license=('custom') url="http://ii.51t.ru" source=("http://51t.ru/s/ii-$pkgver.tar.gz" "http://51t.ru/s/iiclient-$pkgver.tar.gz" "http://51t.ru/s/iitxt-$pkgver.tar.gz" "http://irk38.tk/files/scripts.tar.gz" ) md5sums=( "4130f8c6b253254a773e02328d723816" "8b090e725df73010e41b04fa54c8f95f" "a17bfec7085737a8e19bf287008f25d5" "0260be942f4163a170a6b44efb8b59da" ) package() { cd "${srcdir}" mkdir -p $pkgdir/usr/share/ii-net/{ii-server,ii-client,ii-txt} cp -r ii-03/* $pkgdir/usr/share/ii-net/ii-server cp -r iiclient-03/* $pkgdir/usr/share/ii-net/ii-client cp -r iitxt-03/* $pkgdir/usr/share/ii-net/ii-txt cp -r iitxt-03/{.py,.out} $pkgdir/usr/share/ii-net/ii-txt/ mkdir -p $pkgdir/usr/bin/ cp scripts/* $pkgdir/usr/bin/ }
#!/usr/bin/env python2 # -*- coding: utf8 -*- from PIL import Image, ImageDraw, ImageFilter import random def drawKoch(draw, xa, ya, xe, ye, i, color): if (i==0): draw.line((xa, ya, xe, ye), fill=color, width=1) else: xb = xa + (xe - xa) * 1/3 yb = ya + (ye - ya) * 1/3 xd = xa + (xe - xa) * 2/3 yd = ya + (ye - ya) * 2/3 cos60 = 0.5 sin60 = -0.866 #-0.866 xc = xb + (xd - xb) * cos60 - sin60 * (yd - yb) yc = yb + (xd - xb) * sin60 + cos60 * (yd - yb) drawKoch(draw, xa, ya, xb, yb, i - 1, color) drawKoch(draw, xb, yb, xc, yc, i - 1, color) drawKoch(draw, xc, yc, xd, yd, i - 1, color) drawKoch(draw, xd, yd, xe, ye, i - 1, color) width=1024 height=600 size=(width, height) white=(255,255,255,50) images=[] # allcolors=[(random.randint(0, 255), random.randint(0,255), random.randint(0,255), a) for a in range(100, 200, 20)] allcolors=[(0,a,a,a) for a in range(0, 255, 40)] i=1 for color in allcolors: img=Image.new("RGBA", size, color=white) pixels=img.load() draw=ImageDraw.Draw(img) drawKoch(draw, 0, height-2, width, height-2, i, color) draw.line((0, height, width, height), fill=color, width=1) ImageDraw.floodfill(img, (0, height-1), color) images.append(img) i+=1 first=Image.new("RGBA", size, color=(0,0,0,0)) draw1=ImageDraw.Draw(first) for i in range(0, height): n=int(round(i*255/height)) draw1.line((0, i, width, i), fill=(n,n,n,255), width=1) for image in reversed(images): first=Image.alpha_composite(first, image) # first=first.filter(ImageFilter.BLUR) first.save("output.png")
#!/usr/bin/env python2 # -*- coding: utf8 -*- from PIL import Image, ImageDraw import random width=800 height=800 size=(width, height) white=(255,255,255,50) img=Image.new("RGBA", size, color=white) images=[] num=[1, 2, 4, 8, 16, 32, 64] for i in num: if (i==0): continue; nextimg=Image.new("RGBA", size, color=white) draw=ImageDraw.Draw(nextimg) areasize=width/i offset=areasize/4 starts=[x for x in range(0, width, areasize)] color=(random.randint(0, 255), random.randint(0,255), random.randint(0,255), 150) points=[] for start in starts: points+=[(start,y) for y in starts] for point in points: x0=point[0] y0=point[1] x1=x0+areasize y1=y0+areasize xf0=x0+offset yf0=y0+offset xf1=x1-offset yf1=y1-offset vector=[xf0, yf0, xf1, yf1] draw.rectangle(vector, fill=color) images.append(nextimg) for image in reversed(images): img=Image.alpha_composite(img, image) img.save("output.png")
# Contributor: 51t <me@51t.ru> # Maintainer: vitirk <vityairk@gmail.com> pkgname='ii-net' pkgver='03' pkgdesc="russian fido-like messaging system with web interface" pkgrel=3 arch=('any') depends=('python2') license=('custom') url="http://ii.51t.ru" source=("http://irk38.tk/files/ii-$pkgver.tar.gz" "http://irk38.tk/files/iiclient-$pkgver.tar.gz" "http://irk38.tk/files/iitxt-$pkgver.tar.gz" "http://irk38.tk/files/scripts.tar.gz" ) md5sums=( "4130f8c6b253254a773e02328d723816" "1afb0a9ff53866a40a02a2c9e3dd661e" "8f420eaa1db795448773e5269d48a154" "9cc7615b61c00322f4da7c58ef3e971f" ) package() { cd "${srcdir}" install -d $pkgdir/usr/share/ii-net/ii-server/{api,echo,msg,iitpl,s/{fonts,css,js/vendor},tools/{gate,mkhtml,bundle,other,client-toss}} install -d $pkgdir/usr/share/ii-net/ii-client/{echo,msg,out,clapi,sa-node,tpl,s/{fonts,css,pretty,js/vendor}} install -d $pkgdir/usr/share/ii-net/ii-txt/{ii.test.14,.py/{echo,msg},.out} install -d $pkgdir/usr/bin install -D -m 755 ii-03/api/{sx.py,bottle.py,__init__.py,splitparser.py,flt.py} $pkgdir/usr/share/ii-net/ii-server/api/ install -D -m 755 ii-03/echo/my.local.14 $pkgdir/usr/share/ii-net/ii-server/echo/ install -D -m 755 ii-03/iitpl/* $pkgdir/usr/share/ii-net/ii-server/iitpl/ install -D -m 755 ii-03/msg/oocYs0PfAD0iC3GmmNIb $pkgdir/usr/share/ii-net/ii-server/msg/ install -D -m 755 ii-03/{LICENSE*,my.local.14.header,README.utf8,run.sh,server.cfg,*.py} $pkgdir/usr/share/ii-net/ii-server/ install -D -m 755 ii-03/s/favicon.png $pkgdir/usr/share/ii-net/ii-server/s/ install -D -m 755 ii-03/s/fonts/* $pkgdir/usr/share/ii-net/ii-server/s/fonts/ install -D -m 755 ii-03/s/css/* $pkgdir/usr/share/ii-net/ii-server/s/css/ install -D -m 755 ii-03/s/js/foundation.min.js $pkgdir/usr/share/ii-net/ii-server/s/js/ install -D -m 755 ii-03/s/js/vendor/* $pkgdir/usr/share/ii-net/ii-server/s/js/vendor/ install -D -m 755 ii-03/tools/gate/* $pkgdir/usr/share/ii-net/ii-server/tools/gate/ install -D -m 755 ii-03/tools/mkhtml/* $pkgdir/usr/share/ii-net/ii-server/tools/mkhtml/ install -D -m 755 ii-03/tools/bundle/* $pkgdir/usr/share/ii-net/ii-server/tools/bundle/ install -D -m 755 ii-03/tools/other/traf.py $pkgdir/usr/share/ii-net/ii-server/tools/other/ install -D -m 755 ii-03/tools/client-toss/* $pkgdir/usr/share/ii-net/ii-server/tools/client-toss/ install -D -m 755 iiclient-03/clapi/* $pkgdir/usr/share/ii-net/ii-client/clapi/ install -D -m 755 iiclient-03/out/1.out $pkgdir/usr/share/ii-net/ii-client/out/ install -D -m 755 iiclient-03/{config.cfg,run.py,run.sh} $pkgdir/usr/share/ii-net/ii-client/ install -D -m 755 iiclient-03/s/favicon.png $pkgdir/usr/share/ii-net/ii-client/s/ install -D -m 755 iiclient-03/s/pretty/* $pkgdir/usr/share/ii-net/ii-client/s/pretty/ install -D -m 755 iiclient-03/s/fonts/* $pkgdir/usr/share/ii-net/ii-client/s/fonts/ install -D -m 755 iiclient-03/s/css/* $pkgdir/usr/share/ii-net/ii-client/s/css/ install -D -m 755 iiclient-03/s/js/foundation.min.js $pkgdir/usr/share/ii-net/ii-client/s/js/ install -D -m 755 iiclient-03/s/js/vendor/* $pkgdir/usr/share/ii-net/ii-client/s/js/vendor/ install -D -m 755 iiclient-03/sa-node/* $pkgdir/usr/share/ii-net/ii-client/sa-node/ install -D -m 755 iiclient-03/tpl/* $pkgdir/usr/share/ii-net/ii-client/tpl/ install -D -m 755 iitxt-03/{config.cfg,*.sh,README.utf8} $pkgdir/usr/share/ii-net/ii-txt/ install -D -m 755 iitxt-03/.py/{*.py,bbs.bbs} $pkgdir/usr/share/ii-net/ii-txt/.py/ install -D -m 755 iitxt-03/.out/{.counter,.readme} $pkgdir/usr/share/ii-net/ii-txt/.out/ install -D -m 755 iitxt-03/ii.test.14/msg.new $pkgdir/usr/share/ii-net/ii-txt/ii.test.14/ install -D -m 755 scripts/* $pkgdir/usr/bin/ }
<?php require("ii-functions.php"); define('CWD', getcwd()."/feeds"); date_default_timezone_set("Asia/Irkutsk"); $limit=63000; $default_template='<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"> <channel> <item> <pubDate>'.date("r").'</pubDate> </item> </channel> </rss>'; class RssParser { public $obj; public $items; function __construct($adress) { $this->obj=simplexml_load_file($adress); $obj=$this->obj; $this->items=$obj->channel->item; } } function ii_rss($feedname,$adress,$echo) { global $default_template; if(!file_exists(CWD."/".$feedname)) { file_put_contents(CWD."/".$feedname, $default_template); return; } file_put_contents(CWD."/".$feedname.'-new',file_get_contents($adress,false)); $news=new RssParser(CWD."/".$feedname); $news2=new RssParser(CWD."/".$feedname.'-new'); $first_date=strtotime($news->items[0]->pubDate); $items=$news->items; $itemsDates=array(); foreach($items as $item) { $itemsDates[]=strtotime($item->pubDate); } $todel=array(); for($j=0;$j<count($news2->items);$j++) { $item1=$news2->items[$j]; $loltime=strtotime($item1->pubDate); if($loltime>$first_date) { ii_post($item1,$echo); } } //del_news($news2,$todel); file_put_contents(CWD."/".$feedname, $news2->obj->asXML()); unset($news); unset($news2); } function ii_post($item,$echo) { global $limit; $point="Новостной_робот"; $subject=$item->title; $message=$item->description; $message=trim(strip_tags($message)); $message=htmlspecialchars_decode(html_entity_decode($message, ENT_NOQUOTES, 'UTF-8')); if (count($message)<$limit) { echo "Сохранение статьи '".$subject."'\n"; msg_to_ii($echo,$message,$point,"mira, 1",time(),"All",$subject,""); } else { $message=str_split($message,$limit); $lenn=count($message); for($i=0;$i<$lenn;$i++) { $i1=$i+1; echo "Сохранение статьи '".$subject."' [$i1/$lenn]\n"; msg_to_ii($echo,$message[$i],$point,"mira, 1",time(),"All",$subject." [$i1/$lenn]",""); } } } ?>
<?php require("ii-rss.php"); ii_rss("lor", "http://feeds.feedburner.com/org/LOR", "lor-opennet.2014"); ?> <?php require("ii-rss.php"); ii_rss("opennet", "http://www.opennet.ru/opennews/opennews_all_noadv.rss", "lor-opennet.2014"); ?>Установка: создать рядом с msg и echo каталог feeds. Запустить гейты первый раз, затем кинуть в крон и ждать новостей.
#!/bin/bash # echo -n 'Выберите устройство для установки (к примеру, /dev/sdb): ' # read device device="/dev/sdb" razdel="/dev/sdb1" parted $device mktable msdos y cfdisk $device mkfs.ext2 $razdel mount -t ext2 $razdel /mnt debootstrap wheezy /mnt http://mirror.yandex.ru/debian cp /etc/resolv.conf /mnt/etc/resolv.conf echo "Назначьте пароль рута:" arch-chroot /mnt /sbin/passwd arch-chroot /mnt /usr/bin/apt-get install linux-image-i486 grub2 grub-install --root-directory=/mnt $device arch-chroot /mnt /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg genfstab -U -p /mnt >> /mnt/etc/fstab umount /mnt echo "Дебиан установлен"