百度首页 | 百度空间
 
文章列表
 
您正在查看 "杂项文章" 分类下的文章

2008-08-18 09:17
主要就是利用了 解压炸弹的原理
解压炸弹是什么 可以百度一下 不过要看avast网站给出的解释 百度知道上那个是扯淡

由于存在着这种解压炸弹
而http传输中又有个小漏洞 既服务器可以在浏览器允许的前提下发送gzip过的数据给浏览器 以减少带宽消耗
这是个好东西 可惜没有避免解压炸弹啊,因为主流的浏览器都默认支持gzip的 而且我还不知道如何关闭这个支持呢 呵呵 也许火狐的自定义http标头可以关闭 但是ie实在是找不到什么办法

我自己用lua程序自制了两个文件 一个100mb 一个1gb
都是填充一样的数据的 慢文件都是fffff
然后用gzip压缩
最后得到两个压缩后的文件 体积分别为 100kb 1mb
然后我找个了个支持php的空间
把这两个文件上传了上去
再写了两个php程序
主要就三句话
第一句 用file_get_contents读入整个文件的内容到字符串里
第二句 给浏览器发送一个header 告诉他接下来的内容是gzip过的
第三句 输出那个字符串的内容
这个字符串也不大 小则100k 多则1m
然后浏览器这边可就惨了
100k的内容解压以后是100mb
我测试过 我的火狐一打开 内存占用猛增300mb
ie似乎也是如此 基于这个结果 那个解压后会1g的文件我没测试 呵呵

测试地址在

http://tinybb.ekedns.com/test/1k.php

http://tinybb.ekedns.com/test/1m.php


第一个地址经实测会吃你300m的内存
第二个地址理论上会吃你3g的内存 所以 只好留给用于探索或者是最近装机的 拥有4g内存的人了

这个东西我觉得稍为改进下 修改下输出的mime 可以冒充图像文件 放到你的个人签名里 或者其他可以显示图片的地方 然后去你憎恶的论坛发贴 每个地方都去跟跟帖 当然要以你的评论还在第一页为准 那么其他访客就会都被赶走的
而你呢 可以事先设置浏览器不显示图片 这个是ie和ff都可以自由设定的 呵呵

祝好运
类别:杂项文章 | 评论(0) | 浏览()
 
2008-06-10 21:20
上次发布了个perl版的更新3322动态域名的程序 不过由于那个用到了lwp库 依赖太p烦了
所以只好打包成exe格式 但是exe格式嘛 文件体积就大了 不符合原意了

这次用lua重新实现了 用的是lua5.1+socket库
由于lua的依赖很简单 寻址也智能 所以可以绿色使用 因此发布的是源代码
体积很小 基本的socket和 mime的dll 和解释器 以及我的代码 加起来不过只有188k
里头带了luasocket库 这个库实现了socket http ftp smtp等 顺便我还放了个json库 呵呵
里头有个copas库 多线程也可以搞定(原理上说是假的 但我无所谓 我只追求效果上 呵呵)

总而言之是小之又小 好之又好
全部的环境和代码我已经打包了 可以去这里下载
http://webdisk.cech.com.cn/download/file_share_10986261.html

很显然 如前面所说 这里面其实包含了一个比较有用的lua环境和一些库
事实上我还用这个写了个irc bot 当然 还在完善中
如果感兴趣的 可以利用这个小环境学习lua 写程序 我觉得带socket和http库 对于写一些校内工具是足够了 无需担心跨平台问题 事实证明 我的irc bot在一个centos的环境中运行情况与win中无二

如果只想看看代码 可以看这里

我的代码如下

package.cpath = "./lib/?.so;./lib/?.dll;./lib/?.dylib;"

local http = require"socket.http"
local mime = require"mime"


function getip()
local ip=http.request("http://www.3322.org/dyndns/getip")
return string.gsub(ip, "%s", "")
end

function setdyn(u,p,n,ip)
local t={}
r,c=http.request{
          url="http://www.3322.org/dyndns/update?system=dyndns&hostname="..n.."&myip="..ip,
          user = u,
          password = p,
          sink=ltn12.sink.table(t),
          redirect=false
          }
if not(r) then
    return "ERORR: the data has not send correctly!"
end
if c~="200" then
    return "SUCCESS! Your Dynamic name "..n.." has been set to "..ip
else
    return "ERORR: an unexpectant value has been got\n"..c
end
end

user,pwd,name=arg[1],arg[2],arg[3]
if not(user and pwd and name) then
print("you don't put the right arguments\npress ENTER to quit")
io.read()
os.exit()
end

print("This script is powered by jyf1987 ( http://hi.baidu.com/jyf1987 )")
print("and public under bsd lisence,so you can do anythings to it as you wish\n\n")
print("now getting your public ip...")
local ip=getip()
print("got it!\nupdating your dynamic name...\n\n")
print(setdyn(user,pwd,name,ip).."\npress ENTER to quit")
io.read('*l')
类别:杂项文章 | 评论(0) | 浏览()
 
2008-04-12 21:03
10. LOLCODE语言 http://lolcode.com/
国外流行一种lolcat图片,经常出现在论坛的头像和签名图里。lolcat图片里有一只很乖的小动物(通常是小猫),旁边写几句很可爱的话(比如故意的语法错误、拼写错误、近似发音或者网络缩略语)。很多web 2.0的宕机页面就是一张lolcat图片。LOLCODE就是用这种可爱的猫猫语言来写程序。LOLCODE的代码通俗易懂,写起来非常可爱,比如看看下面这段代码:
复制内容到剪贴板
代码:
HAI
CAN HAS STDIO?
I HAS A VAR
GIMMEH VAR
IZ VAR BIGGER THAN 10?
YARLY
       BTW this is true
       VISIBLE "BIG NUMBER!"
NOWAI
       BTW this is false
       VISIBLE "LITTLE NUMBER!"
KTHX
KTHXBYE
9. BrainFuck语言 http://www.muppetlabs.com/~breadbox/bf
BrainFuck语言是最简单的程序语言之一,只有8个有效字符,每个字符都有一个特定的含义。这8个字符控制一个指针在线性表里进行移动、读写、循环等操作。所有其它的字符都当作注释处理。我的Blog里曾对BrainFuck有过专门的介绍。
我很喜欢这个语言,甚至下载了它的编译器,写出不少BrainFuck程序。例如,下面这段代码可以输出我的网站域名“matrix67.com”:
复制内容到剪贴板
代码:
++++++++++[>+++++++++++<-]>-.
<+++[>----<-]>.<+++++[>++++<-]>-.--.
<+++[>---<-]>.<+++++[>+++<-]>.
>+++++[>+++++++++++<-]>-.+.<+++[>---<-]>.<<
<+++++[>----<-]>-.<+++[>++++<-]>.--.
BrainFuck语言有很多扩展。用不同的单词来代替这8个符号可以得到更多好玩的程序语言,有一些语言竟是把BrainFuck程序编码成图片或音乐作为程序代码。

8. Malbolge语言 http://www.lscheffer.com/malbolge.shtml
Malbolge是最早的一个以代码丑陋为目标而设计出的程序语言,你几乎不可能读懂Malbolge的代码。它共有8条指令,所有运算都基于3进制,控制程序流的唯一指令是无条件跳转。它的Hello World程序如下:
复制内容到剪贴板
代码:
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
7. Whitespace语言 http://compsoc.dur.ac.uk/whitespace/
很多语言在编译时都会自动忽 略空格、换行和Tab,而Whitespace语言正好相反,这个语言的有效字符只有三个(就是前面提到的三个空白符号),其它字符一律当作注释处理。这 个语言对于机密工作者尤其有用,你可以把一个完整的Whitespace程序插入到一篇普通的文章中,谁也不会知道这里面竟然隐藏了一个机密代码。 Whitespace也可以防止别人打印出源代码盗走。Whitespace源码的扩展名为.ws(转载者:果然畏缩啊),单击这里是一个Whitespace的Hello World程序。

6. Befunge语言 http://quadium.net/funge/spec98.html
Befunge的代码是二维的。它用 < > v ^ 这四个符号来控制一个指针在代码中移动,指针经过一个字符或数字则把它压入一个栈,四则运算符号的功能就是弹出栈顶两个元素进行计算后把结果压回去。用 _ 和 | 来表示有条件的方向选择:当栈顶元素为0时向右(上)走,否则向左(下)走。& 和 ~ 分别用于读入数字或字符并压入栈,句号和逗号分别表示将栈顶元素作为整数或字符输出。最后以一个@符号表示程序结束。Befunge代码的注释不需要任何 符号标明,你可以把注释写在程序的任何地方,只要运行时指针不会经过它就行了。你甚至可以把注释写在程序正中间,然后写代码时绕开注释写成一圈。 Befunge的Hello World程序如下:
复制内容到剪贴板
代码:
                v
>v"Hello world!"0<
,:
^_25*,@
看一个复杂的例子。我找了一个算圆周率的Befunge程序,看起来非常壮观。
复制内容到剪贴板
代码:
aa*       v                +------------------------+
vp*9920p*9930<                | Pi generator in Bef-97 |
>:09a*pa*3/1+19a*p09a*g:09b*v |                      |
v_@# g*b90 p*b910        < p< | 7/2/1997, Kevin Vigor   |
>19a*g:+1-29b*p19a*g::09v    +------------------------+
v*a90g*b90*g*b91: _v#p*9<
>g-#v_ 2a*+\$   v   :$
>\1-aa*ga*+v   p
v1:/g*b92p*991:<   *
>9b*p29b*g*199*g\v9
v*b92p*aa-1g*990-<9
>g2-29b*p099*g1-:0^
v -9p*b92:%ag*991   <
>#v_ 299*g1+299*p>    ^
   >09b*g:#v_$v
v93p*b90-1<
>9*g199*ga/+.v
    v:g*992 <p*9 92-<
v_29b*g399*p ^
>09b*g:#v_v    1
vp*b90-1 < $    g
>199*g9`#v_'9,v    *
      >'0, >' ,299^
通常被认为Befunge是第一个基于“二维控制流”的语言,后来衍生出的一大批类似的语言都是受的Befunge影响。例如PingPong语言就是把Befunge的四种箭头符号换成正反斜杠,控制指针移动方向90度旋转,起一个反弹的作用。

5. TMMLPTEALPAITAFNFAL语言 http://p-nand-q.com/humor/programming_languages/tmmlpteal.html
你没看错,上面这一排毫无意义的字母是一个语言的名称。它是The Multi-Million Language Project To End All Language Projects And Isn't That A Fine Name For A Language的缩写。TMMLPTEALPAITAFNFAL语言没有固定的语法规则,每一天都是不同的语法。例如,2000年10月13日你可以使 用DIV但不能使用MOD;到了10月14日时你可以使用MOD了但DIV又不能用了。因此,你今天写的程序运行起来完全正常,但是到了明天就无法编译 了。下面是一个TMMLPTEALPAITAFNFAL的Hello World程序,当然现在已经无法编译了。
复制内容到剪贴板
代码:
DECLARE CELL 100 AS READPOS
DECLARE 10 AS NEWLINE
WRITE CHAR NEWLINE
COPY "Hello, World" TO CELL 0
COPY 0 TO READPOS
WHILE READPOS INDIRECT DO GOSUB 300
WRITE CHAR NEWLINE
RETURN
LINE 300: WRITE CHAR READPOS INDIRECT
ADD 1 TO READPOS
RETURN
4. l33t语言 http://web.archive.org/web/20050 ... epages.com/l33t.htm
Leetspeak是国外网络上曾经流行的一种字母书写方式。很多电影和 美剧的名字也是Leetspeak,比如se7en、numb3rs、s1m0ne等等。l33t程序的代码故意仿照这种风格。它的代码中只有0到9这九 个数字是有意义的,其它的字符都没用。因此,你可以先写好一篇文章,然后依次把里面出现的字母替换成你的l33t代码,让一段Leetspeak文字中隐 藏一个小程序。下面就是一个Hello World示例程序:
复制内容到剪贴板
代码:
// "Hello World" by Stephen McGreal.
// Note that the views expressed in this source code do not necessarily coincide with those of the author :o)

Gr34t l33tN3$$?
M3h...
iT 41n't s0 7rIckY.

l33t sP33k is U8er keWl 4nD eA5y wehn u 7hink 1t tHr0uGh.
1f u w4nn4be UB3R-l33t u d3f1n1t3lY w4nt in 0n a b4d4sS h4xX0r1ng s1tE!!!;p
w4r3Z c0ll3cT10n2 r 7eh l3Et3r!

Qu4k3 cL4nS r 7eh bE5t tH1ng 1n teh 3nTIr3 w0rlD!!!
g4m3s wh3r3 u g3t to 5h00t ppl r 70tAl1_y w1cK1d!!
I'M teh fr4GM4stEr aN I'lL t0t41_1Ly wIpE teh phr34k1ng fL00r ***j3d1 5tYlE*** wItH y0uR h1dE!!!!L0L0L0L!
t3lEphR4gG1nG l4m3rs wit mY m8tes r34lLy k1kK$ A$$

l33t hAxX0r$ CrE4t3 u8er- k3wL 5tUff lIkE n34t pR0gR4mm1nG lAnguidGe$...
s0m3tIm3$ teh l4nGu4gES l00k jUst l1k3 rE41_ 0neS 7o mAkE ppl Th1nk th3y'r3 ju$t n0rMal lEE7 5pEEk but th3y're 5ecRetLy c0dE!!!!
n080DY unDer5tAnD$ l33t SpEaK 4p4rT fr0m j3d1!!!!!
50mE kId 0n A me$$4gEb04rD m1ghT 8E a r0xX0r1nG hAxX0r wH0 w4nT2 t0 bR34k 5tuFf, 0r mAyb3 ju5t sh0w 7eh wAy5 l33t ppl cAn 8E m0re lIkE y0d4!!! hE i5 teh u8ER!!!!
1t m1ght 8E 5omE v1rus 0r a Pl4ySt4tI0n ch34t c0dE.
1t 3v3n MiTe jUs7 s4y "H3LL0 W0RLD!!!" u ju5t cAn'T gu3s5.
tH3r3's n3v3r anY p0iNt l00KiNg sC3pT1c4l c0s th4t, be1_1Ev3 iT 0r n0t, 1s whAt th1s 1s!!!!!

5uxX0r5!!!L0L0L0L0L!!!!!!!
3. Java2K语言 http://p-nand-q.com/humor/programming_languages/java2k.html
Java2K是一种非确定性的语言,程序正常运行是有一定概率的。很多时候程序并不能按照你的意愿去运行,即使是系统函数也不会总是去做它该做的事。所有的函数都有两种不同的解释,程序运行时会随机选择一个作为实际调用的函数。
几乎所有的系统函数返回正确结果都只有90%的可能性,因此程序运行的最终结果或多或少都和预期结果不同。写出正确率尽量高的Java2K程序是一个非常有趣的挑战。

2. Chef语言 http://www.dangermouse.net/esoteric/chef.html
一个完整的Chef程序代码分为三个部分:程序名、变量声明和一系列栈操作。所有的操作都写成食谱的样子。例如,Put x into the mixing bowl就表示把变量x压入栈中,而Stir for 2 minutes则表示把栈顶元素向下移两格。下面的程序打印出前100个Fibonacci数。
复制内容到剪贴板
代码:
Fibonacci Numbers with Caramel Sauce.

Ingredients.
100 g flour
250 g butter
1 egg

Method.
Sift the flour. Put flour into mixing bowl. Serve with caramel sauce. Stir for 2 minutes. Remove egg. Rub the flour until sifted. Stir for 2 minutes. Fold the butter into the mixing bowl. Pour contents of the mixing bowl into the baking dish.

Serves 1.

Caramel Sauce.

Ingredients.
1 cup white sugar
1 cup brown sugar
1 vanilla bean

Method.
Fold white sugar into mixing bowl. Put white sugar into mixing bowl. Fold brown sugar into mixing bowl. Clean mixing bowl. Put white sugar into mixing bowl. Remove vanilla bean. Fold white sugar into mixing bowl. Melt white sugar. Put vanilla bean into mixing bowl. Refrigerate. Heat white sugar until melted. Put white sugar into mixing bowl. Remove vanilla bean. Fold white sugar into mixing bowl. Caramelise white sugar. Put vanilla bean into mixing bowl. Refrigerate. Cook white sugar until caramelised. Put white sugar into mixing bowl. Serve with caramel sauce. Fold brown sugar into mixing bowl. Put white sugar into mixing bowl. Add vanilla bean. Serve with caramel sauce. Add brown sugar.
1. Shakespeare语言 http://shakespearelang.sourceforge.net/
在所有的另类语言中,Shakespeare语言可能是最搞笑的了,并且难以置信的是它居然是SourceForge.net的一个项目。 Shakespeare的代码完全模仿莎士比亚的戏剧。它也是一个基于栈的程序语言,程序中出场的每一个人物都代表一个栈。Shakespeare的代码 自由度很高,因此同一个程序你可以写出完全不同的代码出来。Shakespeare的Hello World代码如下:
复制内容到剪贴板
代码:
The Infamous Hello World Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


                   Act I: Hamlet's insults and flattery.

                   Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!

You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!

You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.

Speak your mind!

[Exit Romeo]

                   Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!

[Exit Juliet]

                   Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:
Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!

Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]


                   Act II: Behind Hamlet's back.

                   Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
Speak your mind. You are as worried as the sum of yourself and the
difference between my small smooth hamster and my nose. Speak your
mind!

Juliet:
Speak YOUR mind! You are as bad as Hamlet! You are as small as the
difference between the square of the difference between my little pony
and your big hairy hound and the cube of your sorry little
codpiece. Speak your mind!

[Exit Romeo]

                   Scene II: Juliet and Ophelia's conversation.

[Enter Ophelia]

Juliet:
Thou art as good as the quotient between Romeo and the sum of a small
furry animal and a leech. Speak your mind!

Ophelia:
Thou art as disgusting as the quotient between Romeo and twice the
difference between a mistletoe and an oozing infected blister! Speak
your mind!

[Exeunt]
转自 http://www.matrix67.com


顺便要说下 还有许多 只不过我懒得自己写文章总结
类别:杂项文章 | 评论(2) | 浏览()
 
2008-03-05 18:52
刚做了一个web开发的迷你包
shttpd+perl+php5
仅供娱乐
下载地址
http://webdisk.cech.com.cn/download/file_share_9662171.html
名字就仿乔楚那个wamp 叫SPP
呵呵 为什么仅供娱乐呢?因为shttpd不支持并发 :<
类别:杂项文章 | 评论(4) | 浏览()
 
     
 
 
文章分类
 
     
 
文章存档
 
 
 
 
 
 
 
 
 
 
 
 
     
 
最新文章评论
   
 

如果俩U盘互相copy 速度虽然是飞,但你资源从哪来呢。。哈哈
 

Chinglish !~ hoho
 
 
 
     


©2008 Baidu