Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Sun May 17, 2009 23:30 Post subject: Possibility of adding perl to dd-wrt
I was looking at the thread relating to blocking ads coming through on a local network (Thread here.) It discusses the possibility of rerouting add sites to another computer running pixelserv. Looking through the pixelserv website, it seems to require perl. It also had links elsewhere to which I ran upon something labeled "microperl". It has a site here.
Anyone think they could use the microperl page to add perl scripting to dd-wrt? _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
There's optware packages for it and I've heard of people running it but they had trouble with missing perl modules. _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Mon May 18, 2009 1:16 Post subject:
What kind of modules are missing?
Essentially the reason I am asking this, I want to know how hard it would be to get pixelserv running on DDWRT. I know it requires changing default admin page to something other than port 80. Once that is done, starting up pixelserv should be relatively simple, as long as some basic perl is in place to run it properly.
I guess I am trying to determine if it would run as a basic experiment. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
I installed PERL on my ASUS WL-520GU. The reason was that I wanted to run HottProxy on my router. Never got it to run however. Could never resolve all of the needed components.
Apologies for digging up old thread, but the broken images in Internet Explorer when adblocking have irked me for years (Firefox with adblock much better!).
So I have patched together a simple c program based on the public domain server.c in
Copied to dd-wrt (latest BS Mega on wrt54g-tm, web admin on http port 80 disabled) it runs fine, daemonizes and only outputs to syslog (by design)
Code:
Sep 11 01:03:33 DD-WRT daemon.warn pixerlserv[6691]: socket: Address family not supported by protocol
Sep 11 01:03:33 DD-WRT daemon.notice pixerlserv[6691]: waiting for connections on port 80
Then any attempt to connect to the router IP i.e.
http:/192.168.1.1/anything
gets a blank page with a 1*1 Gif
Re the warning - presumably the second socket in the linked list it tries worked? I'm sure that could be fixed - there's also a half second sleep before closing the connection that I don't think should be necessary.
Source and dd-wrt binary attached any use?
[Note also compiles and runs on Ubuntu X64 and Windows XP Cygwin-1.7]
Last edited by mstombs on Mon Sep 14, 2009 21:29; edited 1 time in total
With this script you can start it and it will move the normal webserver away from 80 which is mandatory.
Code:
#!/bin/sh
if [ `nvram get http_lanport` -eq 80 ] ; then
nvram set http_lanport=88
commit
stopservice httpd
startservice httpd
fi
pixelserv
_________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Fri Sep 11, 2009 4:00 Post subject:
Interesting show. I may try to implement this in the near future. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
Easiest is just to disable web administration via http, https uses port 443.
Whatever suits your needs. There's no place in the webgui to do this and one may prefer to use http. I'm using remote http through my reverse-proxy. _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
I've fixed the warning message by restricting the program to try only IPV4 connections, and made a couple of other changes to try to avoid the need for a usleep - found a way to close the connection without sending a RST.
Also put a copy of the binary temporarily on my ISP website so interested users can:-
OK this is open message to frater - I know this is too late, and I see you have the other version now working fine via xinetd, but here is an attempt to satisfy your original requirements:-
Quote:
I prefer it to be implemented in C which will give a compact fast binary. A version which does both (socket & stdin/stdout) would be even better...
* pixelserv
* -- run pixelserv on port 80 of all interfaces
* pixelserv 192.168.1.1
* -- run on port 80 of 192.168.1.1
* pixelserv -i
* -- run pixelserv in stdin/stdout
Despite adding this I've also taken out what I now consider to be unnecessary code and using Tornado's latest toolchain (only for Linux 2.6?, but works for me in 2.4) I find can use the common compile/link options to produce a 6kB binaries - build script enclosed
[edit] don't use this version, it is single threaded and can hang waiting for a browser to acknowledge receipt of a blank gif and stop working until restarted.
Also a 'feature' of the toolchain used is that "printf"s are stripped from code, so no identifying version no or messages!
OK this is open message to frater - I know this is too late, and I see you have the other version now working fine via xinetd, but here is an attempt to satisfy your original requirements:-
Quote:
I prefer it to be implemented in C which will give a compact fast binary. A version which does both (socket & stdin/stdout) would be even better...
* pixelserv
* -- run pixelserv on port 80 of all interfaces
* pixelserv 192.168.1.1
* -- run on port 80 of 192.168.1.1
* pixelserv -i
* -- run pixelserv in stdin/stdout
Despite adding this I've also taken out what I now consider to be unnecessary code and using Tornado's latest toolchain (only for Linux 2.6?, but works for me in 2.4) I find can use the common compile/link options to produce a 6kB binaries - build script enclosed
Hi...
Yes I did a request on linuxquestions.org. I haven't been programming in C for 20 years. I wasn't even using any library functions back then (not even printf). I'm now using a stdin/stdout only version.
You totally satisfied my requirements (besides speed ).
I will propose your package to be included into optware.
I'm starting to like xinetd. My WD Worldbook is using it too for sshd and there it introduces an annoying wait, but I'm not noticing any downsides here....
Code:
# service pixelserv
xinetd manages port 80 on these IP's
192.168.10.1: /opt/bin/nc -w 1 192.168.10.1 88
169.254.255.1: /opt/bin/nc -w 1 192.168.10.1 88
127.0.0.1: /opt/bin/nc -w 1 192.168.10.1 88
10.63.63.1: /opt/usr/sbin/pixelserv
So you are crosscompiling? You do know you can compile on the router itself?
Yes, that was an old request of mine. We are not using perl for this one anymore....
http://svn.dd-wrt.com:8000/dd-wrt/ticket/1122 _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Thu Nov 05, 2009 6:36 Post subject:
Damn, I cannot believe someone actually dragged this old post up. Hah hah ... at least some people know how to ask the right questions.
@frater - I saw your 'optware' script frater. Since I now know it installs perl and pixelserv, I am going to consider using it on my router in the near future. I sort of have an attached usb hdd to my router, and honestly I am not really using it that much. At least your optware script will give it some "new" life. _________________ E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]
Try Dropbox for syncing files - get 2.5gb online for free by signing up.
Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
@frater - I saw your 'optware' script frater. Since I now know it installs perl and pixelserv, I am going to consider using it on my router in the near future.
You'll be surprised!
BTW. pixelserv is not dependent of perl anymore. I replaced it with a C-version. mstombs thought of that one. I had a problem with his version because it used all interfaces (just like DD-WRT's httpd ) so I'm now using a pixelserv which uses stdin/stdout.
In the mean time mstombs updated his... so it could be used instead... I can't really decide what to do with it now...
@mstombs can't you think of something to make yours do something special?
I will post mine... maybe you can see something which is not right....
http://pastebin.com/f2bad6d7e
BTW. It doesn't do anything with its stdin... Can this be a problem?
I've changed S45pixelserv so xinetd will use the -i parameter. This way it will work with both versions.... (binary has same name) _________________ Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge