你应该辞职去创业吗?

你应该辞职去创业吗?

leiphone.com | Nov 30th -0001

【编者按】本文的作者是Amir Khella,他是一位著名的用户体验设计师,也是创业顾问和企业家。在过去的三年里,他成功的打造了十几家公司,其中不少还被大企所收购,比如说Google收购了他的DocVerse,LimeLight Networks收购了他的Delve Networks,Rovi收购了他的SideReel等。在创业面前,他是一个经验丰富的人物。在这篇文章里面,结合自身的经历告诫旁人在什么情况下应该继续工作,什么情况下可以投身创业。如果你为此感到困惑,不妨阅读一下。

在过去的几年里,我常被两种建议弄得左晃右摆:有人劝我要继续工作,因为没有人能保证自己的想法是对的,而工作能带来稳定的收入;有人却觉得工作是创业的障碍,因为工作会分散注意力,甚至变成失败的理由之一。一直以来,我陆陆续续目睹身边的朋友离开工作岗位去追求自己的创业梦。他们很多人坚持不了几个月就被打回原形,不过大部分人并没有后悔当初的决定。

以自身的案例来说,我甚至连一个想法都没有就辞去了工作。主要是因为公司耗光了我的精力,使我觉得离开是个正确的选择。我之所以能够轻易的做出这样的决定,也是因为自己没有还贷和家庭的压力。在我的想法产生收入之前,我扎扎实实熬了三年,其中还做过几个失败的产品。不过这三年来我并没有完全抛开工作,我还偶尔给一些公司做咨询支持。这样的自由工作让我在生活上得到了保障,也使得自己可以更全神专注于产品。

回顾过去,我的确做了人生最好的选择。但是对于旁人,我还是这样建议:就算你有一个想法或者计划,不要轻易辞掉自己的工作,你得非常谨慎。

你应该在什么情况下继续工作呢?

你需要固定的收入来维持现有的生活,比如说还贷款、供子女读书等。

你的想法不够清晰,或者它没有被市场验证过。

现有的工作还能增加自己的业务水平,而且对你的想法有利。

工作之后的剩余时间(晚上和周末)足以应付自己想法的需求,而且整个进展良好,并看到了胜利的曙光。

有时候时间不够并不见得是坏事,因为你的注意力反而会更加集中,而且行动起来更有效率。在这种情况下,你有可能会明智地不去阅读新闻和参加活动,把时间用在刀刃上。

你什么时候应该辞职而去创业呢?

公司把你的精力都耗个精光了,你没有时间做自己的事。

你已经有一笔丰富的储蓄或者其他收入渠道,而且它们完全可以支撑你去创业,直到获得收入或者融资。

像我一样去一些公司做咨询等自由职业。这是一个很好的折中方案,因为你完全可以自由地控制时间。

你能快速实现自己的部分想法,并产生足够的利润来支持产品的改进和扩大。这是最理想的状态,一来你的想法已被市场验证,二来你不再需要在产品和工作之间折腾。

在我的项目里面,Keynotopia发布不够一周就能获得盈利,这给我带来了很大的震撼。随后我把它独立出来,并为之策划更大的市场。

在收笔之前,我想再啰嗦两句。其实是否辞掉工作并不重要,重要的是你有把自己的想法付诸于现实。如果你能非常信任自己的产品并保持激情澎湃,你总会挤出时间的。

Via:amirkhella

相关文章:

Original Page: http://www.leiphone.com/1030-ce6093-startup.html

Shared from Pocket

[HowTo]Aria2 Torrent, FTP, HTTP downloader with Webinterface

[HowTo]Aria2 Torrent, FTP, HTTP downloader with Webinterface

This howto describes howto install an excellent Linux-downloader with Torrent, FTP and HTTP capabilities and worldwide remote access.
Sometimes I missed a good downloadmanager for my router. Therefore I installed many different tools & apps in order to download different files. All of them worked fine, but they all have too much restrictions.
Then I found ARIA2 in our optware repository and some php-code called aria2web for a remote control of aria2.
There is some other code for a remote control out there, but far too complicated and too slow for a RT-N16.
A big advantage of aria2 is the very low needed cpu-resource and memory used for downloads. And it’s ultrafast….
Disadvantages: You need Firefox on your Computer, with IE you have to tweak the php-code.
For IE, there are some suggestions for instance here: http://forum.synology.com/enu/viewto…p?f=38&t=26662 Tested with Webbrowser: Firefox, Iceweasel, Epiphany, OperaLet’s start……..
Preconditions: RT-N16 or better (will run on a Wl500gP too, but slow)
Installation according Wengi’s HowTo
Installed and running lighttpd and PHP according WPTE’s HowTo
installed unzip on your router (or do a ‘ipkg install unzip’)
WinSCPAria2 is very easy to install, just adjust the line below with your download-folder as you like:

Code:

ipkg update
ipkg install aria2
mkdir -p /opt/var/log/aria2
mkdir -p /opt/etc/aria2
mkdir -p /tmp/mnt/disca_3/Downloads
touch /opt/etc/aria2/aria2.conf

vi /opt/etc/aria2/aria2.conf  ###SWITCH TO INSERT MODE WITH 'i' ######
daemon=true
enable-rpc=true
rpc-listen-port=6800
rpc-listen-all=true
####### your download folder, ensure that this folder exist! ##########
dir=/tmp/mnt/disca_3/Downloads
#where is your logfile located
log=/opt/var/log/aria2/aria2.log
log-level=warn
dht-listen-port=6801
auto-save-interval=30
#seed ratio and seed time in minutes
seed-ratio=1.0
seed-time=1460
max-upload-limit=20K
event-poll=select
####end of file aria2.conf####
### Enter 'ESC' and ':wq' to store and leave vi ###

Consider, there are so many options – you can use much more when needed.

Here you can read more: http://linux.die.net/man/1/aria2c

And here you can find a Wiki: http://sourceforge.net/apps/trac/aria2/wiki

Now we start aria2 at every startup

Code:

touch /opt/etc/init.d/S85aria2
vi /opt/etc/init.d/S85aria2
###SWITCH TO INSERT MODE WITH 'i' ######
# For Olegs & Ily's FW for Asus Routers
# store this script in /opt/etc/init.d if you've installed optware

# Prgmname=/full_path/Prgmname
prgmname1="/opt/bin/aria2c"
shortname="aria2c"

#one option 
options="--conf-path="

# configfile=/full_path/configfile
configfile="/opt/etc/aria2/aria2.conf"

start() {
        # Code here to start the program
        logger -t ARIA2C "Starting aria2c daemon "
        ${prgmname1} ${options}${configfile}
	sleep 5
        return 0
}

stop() {
        # Code here to stop the program and check it's dead
        if [ -n "`pidof $shortname`" ]; then
           logger -t ARIA2C "Shutting down aria2c daemon "
            /usr/bin/killall $shortname
           sleep 5
        fi
        return 0
}
##########################start here##########################
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        logger -t ARIA2C "$shortname restart, executed from $(whoami)"
        stop
        sleep 2
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
sleep 1
exit
#### end of file S85aria2 ####
### Enter 'ESC' and ':wq' to store and leave vi ###

chmod 755 /opt/etc/init.d/S85aria2
reboot

Well, if there is no command ‘whoami’ on your router, just remove the part above ‘executed from $(whoami)’

Consider, when you change something of your /opt/etc/aria2/aria2.conf file you must enter a:

Code:

/opt/etc/init.d/S85aria2 restart

If you don’t want to install a webinterface for some reason, you can install a remote gui for aria on your PC.

For instance: with a Wl500gP you can save resources – no lighttpd, no php aso is necessary to run aria2.

Just move ahead with the next post. Consider, you can install a webinterface and a remote_gui, provided you do not access aria2 at the same time.

Further, you have to configure your firewall as stated below. When an older FW is used with Kernel 2.4, use as Path /tmp/mntdisc0_3 instead of disca_3

Now we install the webinterface-part: (assumed, that your webservers document root is /opt/share/www)

Code:

wget http://sourceforge.net/projects/aria2web/files/latest/download
mkdir -p /opt/share/www/aria2web
unzip Aria2Web_0.1.zip -d /opt/share/www/aria2web
rm /opt/share/www/aria2web/config.php
touch /opt/share/www/aria2web/config.php 
vi /opt/share/www/aria2web/config.php  ###SWITCH TO INSERT MODE WITH 'i' ######
<?php
/**
* @version		$Id: config.php 8 2010-01-21 16:05:04Z soeren_nb $
* @package	aria2web
* @copyright	Copyright (C) 2010 soeren. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Aria2Web is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* http://sourceforge.net/projects/aria2web/
*/
defined( '_ARIA2WEB' ) or die();
// to run Aria2web in "local" mode means it's installed on the same machine as aria2, so we can start the aria2c executable through PHP
// when Aria2web is run in "web" mode, it's assumed that it's installed on a different machine and won't (be able to) start the aria2c executable
$aria2_mode = 'web'; 
$aria2_xmlrpc_host = 'localhost';
$aria2_xmlrpc_uripath = '/rpc';

$aria2_executable = '/opt/bin/aria2c'; // Location of the aria2c executable
$aria2_parameters = array();

// If aria2web is in local mode, it will try to start aria2c in XMl-RPC mode using the following additional parameters
$aria2_parameters['xml_rpc_listen_port'] = 6800;
$aria2_parameters['xml_rpc_username'] = '';
$aria2_parameters['xml_rpc_password'] = '';
$aria2_parameters['xml_rpc_listen_all'] = 'true';
$aria2_parameters['dir'] = '/tmp/mnt/disca_3/Downloads'; // The directory to store the downloaded file. 
$aria2_parameters['log'] = '/opt/var/log/aria2/aria2.log'; // The location of the log file.
$aria2_parameters['http_user']= ''; //Set HTTP user. This affects all URLs. 
$aria2_parameters['http_passwd']= '';//Set HTTP password. This affects all URLs. 
$aria2_parameters['load_cookies']= ''; //Load Cookies from FILE using the Firefox3 format (SQLite3) and the Mozilla/Firefox(1.x/2.x)/Netscape format. 
$aria2_parameters['user_agent']= ''; //Set user agent for HTTP(S) downloads. Default: aria2/$VERSION, $VERSION is replaced by package version. 

?>

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Well, that’s it – start your Firefox-browser and enter: http://ip.of.your.asus/aria2web

When you can see your aria2web-interface, you can configure your firewall

Now the firewall: (open the ports below)

The port numbers that aria2 uses by default are 6881-6999 and 6801 (dht) for TCP and UDP

(and port 6800 for xml_rpc for external Remote Control – when needed you should read/set a rtc-user&passwd)

Now the last step – we have to protect directory ‘aria2web’ of your webservers document root.

Code:

touch /opt/etc/htpassw

vi /opt/etc/htpassw   ###SWITCH TO INSERT MODE WITH 'i' ######
myusername:mypassword

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Now only one thing remains, we have to tell lighhtpd to use a password for your aria2web directory.

Code:

vi /opt/etc/lighttpd/lighttpd.conf

and activate the "mod_auth" by removing the comment sign ‘#’

Further, at the end of the lighttpd.conf you have to insert this:

Code:

##################################authentification for directories####################################
auth.debug = 2
auth.backend = "plain"
auth.backend.plain.userfile = "/opt/etc/htpassw"
  auth.require = (
      "/aria2web/"   =>  ("method" => "basic", "realm" => "Password protected area of aria2", "require" => "user=myusername")
  )
#########################################################################################################

# Configuration from other optware packages
include_shell "cat /opt/etc/lighttpd/conf.d/*.conf"

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Restart your webserver:

Code:

/opt/etc/init.d/S80lighttpd restart

References:

http://aria2.sourceforge.net/README.html

http://aria2.sourceforge.net/aria2c.1.html

http://sourceforge.net/apps/trac/ari…i/UsageExample

https://github.com/tomhennigan/arial

http://martin-achern.de/wgetgui/aria2gui.html

Well, thats all so far – enjoy!!

Below you can find a screenshot…..

Any kind of improvements, suggestions aso. are greatly appreciated.

Newbiefan

Last edited by newbiefan; 07-01-2012 at 09:45.

Alle HowTo’s, all howto’s RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB; HP4L
—————————————————————–
WL500gP 1.9.2.7-rtn-r3497, Samba, Huawei E220 UMTS
—————————————————————–
WL500gP 1.9.2.7-rtn-4051, Entware

Optware – Hacking WD MyBook World Ed

Hacking WD MyBook World Ed

Optware is software package repositories (aka feeds) maintained by NSLU2 project. They offer access to hundreds of precompiled packages with the latest and greatest software, all at your fingertips, just a command and few seconds away!

bzhou:

/../Seriously, people happy with optware should consider donate to nslu2-linux. That’s how we can pull resource together./../

Using feeds is the recommended way to install and maintain software on your device – this way, you can easily get security and bugfixes, uninstall, and query software database – in other words, get all the service which is core feature of any Linux distribution. Note: it’s highly recommended to use only feeds to install the software, and not mix feeds and manual installs from the source. This is the same rule of thumb as for any other Linux distribution. Note2: This may be impractical, as not all software is available in feeds; but at least try to stick to library packages from feeds, if you don’t want to create shlib hell for yourself.

There are now two types of MyBook with different hardware, and thus requiring different feeds, as well as the newest MyBookLive.

For original MyBook (with front lights arranged into circle) the feed is ‘gumstix1151’.(this feed was originally designed for the gumstix devices – if there is enough interest in optware from this community it will be renamed to match the compilation configuration rather than the single target device, or a new feed perfectly tuned for the MBWE will be created). The main page for the feed is here: http://www.nslu2-linux.org/wiki/Optware/Gumstix . This page does not try to duplicate it, but provide the quick instructions on setting up the feed on MyBook. Please read the original page for more info.
We now have ‘mbwe-bluering’ feed. If you already have optware installed and use the ‘gumstix1151’ feed, look here for instructions on "moving" to the new feed. Also consider installing ldso-runpath-enabled-firmware for best optware experience.

For new MyBook (with front lights arranged in line) the feed is ‘cs05q1armel’.

For the newest MyBookLive the feed is ‘ds101g’.

NSLU2 project is not responsible for any damage that optware causes.

Setup

To start using feed, you need first to install package manager. Optware uses ipkg, which is standard package manager for many embedded distributions. Following commands manually bootstrap ipkg from the feed. They must be run as root.

Installation of optware package manager on MyBook Live:

As root, run following commands:

# wget http://mybookworld.wikidot.com/local--files/optware/setup-mybooklive.sh
# sh setup-mybooklive.sh

Alternatively, run following commands one by one:

# feed=http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/
# ipk_name=$(wget -qO- $feed/Packages | awk '/^Filename: ipkg-opt/ {print $2}')
# wget $feed/$ipk_name
# tar -xOvzf $ipk_name ./data.tar.gz | tar -C / -xzvf -
# echo "src/gz optware ${feed}" >> /opt/etc/ipkg.conf
# mv /opt/bin/ipkg /opt/bin/ipkg.bin
# echo '#!/bin/sh' > /opt/bin/ipkg
# echo 'PATH=/opt/bin:$PATH /opt/bin/ipkg.bin $@' >> /opt/bin/ipkg
# chmod +x /opt/bin/ipkg

User binaries will be installed to /opt/bin and admin binaries in /opt/sbin. To run applications in /opt/bin and /opt/sbin without having to type # /opt/bin/<whatever> or # /opt/sbin/<whatever> every time, either execute this command every time you login:

# export PATH=$PATH:/opt/bin:/opt/sbin

or add the above command to the bottom of /root/.bashrc and /etc/profile. An easy way to do that is by issuing these commands:

# echo "export PATH=$PATH:/opt/bin:/opt/sbin" >> /root/.bashrc
# echo "export PATH=$PATH:/opt/bin:/opt/sbin" >> /etc/profile

(you must logout and re-login for these changes to take effect).

In any case, if you don’t ensure that /opt/bin is in your path before using ipkg to install packages, update-alternatives will not work for sym-linking newly installed executables in /opt/bin

You may also add . (i.e. current directory) to the path – this prevents you from having to prefix shell scripts in the current directory with "./" to run them.
If you choose to do this then make the line you add to /root/.bashrc and /etc/profile

export PATH=$PATH:/opt/bin::/opt/sbin:.

Then it’s all fun:

Update local feed lists – you need to issue this from time to time to get package updates:

# /opt/bin/ipkg update

A good first thing to install would be an alternative text editor like Nano. So follow the instructions here to install nano and test that you have the optware feed up and running properly.

See what’s available, short descriptions included:

# /opt/bin/ipkg list

See what’s already installed:

# /opt/bin/ipkg list_installed

Install or upgrade packages:

# /opt/bin/ipkg install <foo> <bar>

This will download packages from the net with all the required dependencies. Note: there’s the same command for installing and upgrading to a new version of package.

Deinstall packages:

# /opt/bin/ipkg remove <foo> <bar>

Again, Bluerings owners, unless they use ldso-runpath-enabled-firmware, may need to run # ldconfig after package installation, if it complains that it can’t find shared libraries, and possibly update /etc/ld.so.conf to add required libs (e.g., add line ‘/opt/lib/sasl2’ for packages relying on libgsasl to work):

## echo "/opt/lib/<something>" >> /etc/ld.so.conf #if needed
# ldconfig

Also note that without LDSO_RUNPATH support, some packages (like dialog) won’t work even after doing so, because of conflicting stock and optware shared libraries (like ncurses).

Launching Optware programs on startup

If you install something that uses initialization and termination scripts (/opt/etc/init.d/*), you should also do this to run them on startup and terminate on halt:
1. Download the script that will do all the work:

# wget -P /etc/init.d http://mybookworld.wikidot.com/local--files/optware/optware.sh

Alternately, create /etc/init.d/optware.sh yourself:

#!/bin/sh

start() {
if [ -d /opt/etc/init.d ]; then
  echo "Launching Optware initialization scripts"
  for f in /opt/etc/init.d/S* ; do
    [ -x $f ] && $f start
  done
else
  echo "error: /opt/etc/ini.d directory not found" >&2
  exit 1
fi
}

stop() {
if [ -d /opt/etc/init.d ]; then
  echo "Launching Optware termination scripts"
  for f in /opt/etc/init.d/K* ; do
    [ -x $f ] && $f stop
  done
else
  echo "error: /opt/etc/ini.d directory not found" >&2
  exit 1
fi
}

restart() {
    stop
    start
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        restart
    ;;
    cleanup)
    ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit $?

2. Make it executable:

# chmod +x /etc/init.d/optware.sh

Now you can run optware initialization and termination scripts using it:

# /etc/init.d/optware.sh start #this launches the initialization scripts
# /etc/init.d/optware.sh stop #this launches the termination scripts
# /etc/init.d/optware.sh restart #and this first launches the termination scripts and then the initialization scripts

3. Create symlinks for the script to be properly called on startup/halt:

##for MBWE stock fw:
# ln -s optware.sh /etc/init.d/S90optware #this will launch optware initialization scripts on startup
# ln -s optware.sh /etc/init.d/K01optware #and this will launch optware termination scripts on halt
##Debian way (for MyBook Live):
# update-rc.d optware.sh defaults 90 01

Backing up "clean" Optware setup and making sure all your Optware hacks survive a firmware upgrade

1. Back up /opt to somewhere off the machine or to the data partition. This way you will be able to quickly restore optware to "virgin state" in case you mess something up. For example

# DATA=/shares/internal#for bluerings
## or
# DATA=/shares/private#for whitelight
# tar -czvf ${DATA}/optware.orig.tar.gz /opt

To restore this backup, just issue:

# rm -rf /opt
# tar -xzvf /shares/internal/optware.orig.tar.gz -C /#for bluerings
## or
# tar -xzvf /shares/private/optware.orig.tar.gz -C /#for whitelight

2. If you upgrade your firmware, all data stored on the root filesystem will be lost, so it is a good idea to move optware to the data partition. Also, you probably should back up the optware init script:

# mv -f /opt ${DATA}
# ln -s ${DATA}/opt /opt
# tar -czvf ${DATA}/opt.init.tar.gz /etc/init.d/optware.sh /etc/init.d/S90optware /etc/init.d/K01optware

After a firmware upgrade you’ll just have to do this to restore all you optware hacks:

(don’t forget to set DATA variable according to what MBWE edition you have)

# rm -rf /opt
# ln -s ${DATA}/opt /opt
# tar -xzvf ${DATA}/opt.init.tar.gz -C /

Footnotes

1 . Until you get Optware running and can install a easier-to-use editor like Nano at least

[HowTo]Aria2 Torrent, FTP, HTTP downloader with Webinterface

[HowTo]Aria2 Torrent, FTP, HTTP downloader with Webinterface

This howto describes howto install an excellent Linux-downloader with Torrent, FTP and HTTP capabilities and worldwide remote access.
Sometimes I missed a good downloadmanager for my router. Therefore I installed many different tools & apps in order to download different files. All of them worked fine, but they all have too much restrictions.
Then I found ARIA2 in our optware repository and some php-code called aria2web for a remote control of aria2.
There is some other code for a remote control out there, but far too complicated and too slow for a RT-N16.
A big advantage of aria2 is the very low needed cpu-resource and memory used for downloads. And it’s ultrafast….
Disadvantages: You need Firefox on your Computer, with IE you have to tweak the php-code.
For IE, there are some suggestions for instance here: http://forum.synology.com/enu/viewto…p?f=38&t=26662 Tested with Webbrowser: Firefox, Iceweasel, Epiphany, OperaLet’s start……..
Preconditions: RT-N16 or better (will run on a Wl500gP too, but slow)
Installation according Wengi’s HowTo
Installed and running lighttpd and PHP according WPTE’s HowTo
installed unzip on your router (or do a ‘ipkg install unzip’)
WinSCPAria2 is very easy to install, just adjust the line below with your download-folder as you like:

Code:

ipkg update
ipkg install aria2
mkdir -p /opt/var/log/aria2
mkdir -p /opt/etc/aria2
mkdir -p /tmp/mnt/disca_3/Downloads
touch /opt/etc/aria2/aria2.conf

vi /opt/etc/aria2/aria2.conf  ###SWITCH TO INSERT MODE WITH 'i' ######
daemon=true
enable-rpc=true
rpc-listen-port=6800
rpc-listen-all=true
####### your download folder, ensure that this folder exist! ##########
dir=/tmp/mnt/disca_3/Downloads
#where is your logfile located
log=/opt/var/log/aria2/aria2.log
log-level=warn
dht-listen-port=6801
auto-save-interval=30
#seed ratio and seed time in minutes
seed-ratio=1.0
seed-time=1460
max-upload-limit=20K
event-poll=select
####end of file aria2.conf####
### Enter 'ESC' and ':wq' to store and leave vi ###

Consider, there are so many options – you can use much more when needed.

Here you can read more: http://linux.die.net/man/1/aria2c

And here you can find a Wiki: http://sourceforge.net/apps/trac/aria2/wiki

Now we start aria2 at every startup

Code:

touch /opt/etc/init.d/S85aria2
vi /opt/etc/init.d/S85aria2
###SWITCH TO INSERT MODE WITH 'i' ######
# For Olegs & Ily's FW for Asus Routers
# store this script in /opt/etc/init.d if you've installed optware

# Prgmname=/full_path/Prgmname
prgmname1="/opt/bin/aria2c"
shortname="aria2c"

#one option 
options="--conf-path="

# configfile=/full_path/configfile
configfile="/opt/etc/aria2/aria2.conf"

start() {
        # Code here to start the program
        logger -t ARIA2C "Starting aria2c daemon "
        ${prgmname1} ${options}${configfile}
	sleep 5
        return 0
}

stop() {
        # Code here to stop the program and check it's dead
        if [ -n "`pidof $shortname`" ]; then
           logger -t ARIA2C "Shutting down aria2c daemon "
            /usr/bin/killall $shortname
           sleep 5
        fi
        return 0
}
##########################start here##########################
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        logger -t ARIA2C "$shortname restart, executed from $(whoami)"
        stop
        sleep 2
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac
sleep 1
exit
#### end of file S85aria2 ####
### Enter 'ESC' and ':wq' to store and leave vi ###

chmod 755 /opt/etc/init.d/S85aria2
reboot

Well, if there is no command ‘whoami’ on your router, just remove the part above ‘executed from $(whoami)’

Consider, when you change something of your /opt/etc/aria2/aria2.conf file you must enter a:

Code:

/opt/etc/init.d/S85aria2 restart

If you don’t want to install a webinterface for some reason, you can install a remote gui for aria on your PC.

For instance: with a Wl500gP you can save resources – no lighttpd, no php aso is necessary to run aria2.

Just move ahead with the next post. Consider, you can install a webinterface and a remote_gui, provided you do not access aria2 at the same time.

Further, you have to configure your firewall as stated below. When an older FW is used with Kernel 2.4, use as Path /tmp/mntdisc0_3 instead of disca_3

Now we install the webinterface-part: (assumed, that your webservers document root is /opt/share/www)

Code:

wget http://sourceforge.net/projects/aria2web/files/latest/download
mkdir -p /opt/share/www/aria2web
unzip Aria2Web_0.1.zip -d /opt/share/www/aria2web
rm /opt/share/www/aria2web/config.php
touch /opt/share/www/aria2web/config.php 
vi /opt/share/www/aria2web/config.php  ###SWITCH TO INSERT MODE WITH 'i' ######
<?php
/**
* @version		$Id: config.php 8 2010-01-21 16:05:04Z soeren_nb $
* @package	aria2web
* @copyright	Copyright (C) 2010 soeren. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Aria2Web is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* http://sourceforge.net/projects/aria2web/
*/
defined( '_ARIA2WEB' ) or die();
// to run Aria2web in "local" mode means it's installed on the same machine as aria2, so we can start the aria2c executable through PHP
// when Aria2web is run in "web" mode, it's assumed that it's installed on a different machine and won't (be able to) start the aria2c executable
$aria2_mode = 'web'; 
$aria2_xmlrpc_host = 'localhost';
$aria2_xmlrpc_uripath = '/rpc';

$aria2_executable = '/opt/bin/aria2c'; // Location of the aria2c executable
$aria2_parameters = array();

// If aria2web is in local mode, it will try to start aria2c in XMl-RPC mode using the following additional parameters
$aria2_parameters['xml_rpc_listen_port'] = 6800;
$aria2_parameters['xml_rpc_username'] = '';
$aria2_parameters['xml_rpc_password'] = '';
$aria2_parameters['xml_rpc_listen_all'] = 'true';
$aria2_parameters['dir'] = '/tmp/mnt/disca_3/Downloads'; // The directory to store the downloaded file. 
$aria2_parameters['log'] = '/opt/var/log/aria2/aria2.log'; // The location of the log file.
$aria2_parameters['http_user']= ''; //Set HTTP user. This affects all URLs. 
$aria2_parameters['http_passwd']= '';//Set HTTP password. This affects all URLs. 
$aria2_parameters['load_cookies']= ''; //Load Cookies from FILE using the Firefox3 format (SQLite3) and the Mozilla/Firefox(1.x/2.x)/Netscape format. 
$aria2_parameters['user_agent']= ''; //Set user agent for HTTP(S) downloads. Default: aria2/$VERSION, $VERSION is replaced by package version. 

?>

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Well, that’s it – start your Firefox-browser and enter: http://ip.of.your.asus/aria2web

When you can see your aria2web-interface, you can configure your firewall

Now the firewall: (open the ports below)

The port numbers that aria2 uses by default are 6881-6999 and 6801 (dht) for TCP and UDP

(and port 6800 for xml_rpc for external Remote Control – when needed you should read/set a rtc-user&passwd)

Now the last step – we have to protect directory ‘aria2web’ of your webservers document root.

Code:

touch /opt/etc/htpassw

vi /opt/etc/htpassw   ###SWITCH TO INSERT MODE WITH 'i' ######
myusername:mypassword

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Now only one thing remains, we have to tell lighhtpd to use a password for your aria2web directory.

Code:

vi /opt/etc/lighttpd/lighttpd.conf

and activate the "mod_auth" by removing the comment sign ‘#’

Further, at the end of the lighttpd.conf you have to insert this:

Code:

##################################authentification for directories####################################
auth.debug = 2
auth.backend = "plain"
auth.backend.plain.userfile = "/opt/etc/htpassw"
  auth.require = (
      "/aria2web/"   =>  ("method" => "basic", "realm" => "Password protected area of aria2", "require" => "user=myusername")
  )
#########################################################################################################

# Configuration from other optware packages
include_shell "cat /opt/etc/lighttpd/conf.d/*.conf"

Enter ‘ESC’ and ‘:wq’ to store and leave vi

Restart your webserver:

Code:

/opt/etc/init.d/S80lighttpd restart

References:

http://aria2.sourceforge.net/README.html

http://aria2.sourceforge.net/aria2c.1.html

http://sourceforge.net/apps/trac/ari…i/UsageExample

https://github.com/tomhennigan/arial

http://martin-achern.de/wgetgui/aria2gui.html

Well, thats all so far – enjoy!!

Below you can find a screenshot…..

Any kind of improvements, suggestions aso. are greatly appreciated.

Newbiefan

Last edited by newbiefan; 07-01-2012 at 09:45.

Alle HowTo’s, all howto’s RT-N16 1.9.2.7-rtn-r3121, Samba, VSFTP, Lightthpd, PHP, Perl, MySQL, Serendipity, Aria2web, HDD 640GB; HP4L
—————————————————————–
WL500gP 1.9.2.7-rtn-r3497, Samba, Huawei E220 UMTS
—————————————————————–
WL500gP 1.9.2.7-rtn-4051, Entware

My Book Live脱机BT/PT下载改造教程 之一 – 脱机BT、电驴专版 – 恩山WIFI论坛 – Powered by Discuz!

1)启用ssh权限。
将My Book Live接上路由,确保路由是正常能连上物联网的,然后访问你的My Book Live,例如我的My Book Live IP是192.168.0.5,则在浏览器中输入:
http://192.168.0.5/ui/ssh
然后再“启用ssh”选项打勾,启用。

2)利用putty软件登录你的My Book Live,Putty可以从http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html下载。下载后运行,以 root 用户名登录,密码 welc0me

3)将以下命令行全部拷贝后,切换到putt窗口,然后鼠标右键粘贴,程序会自动下载软件包安装。

  1. cd /root;wget -q http://highlevelbits.free.fr/download-MBLIVE/fpinstaller/fpkmgr_install.sh -O /root/fpkmgr_install.sh;sh /root/fpkmgr_install.sh

复制代码

安装完成后putty会提示安装成功(sucessfully),这时可以关闭Putty窗口了。
4)打开浏览器,按照你的My Book Live IP地址输入以下网址,例如我的是:
http://192.168.0.5/fpkmgr
打开的页面,登录密码输入 welc0me

登录进去后,点击网页左上角第三个花瓣型的图标,之后找到Transmission,点击Intall,之后等待一会软件会自动,安装完成后页面会刷新。

安装完成后就可以点击Transmission 条目下的Configure进行设置了。在浏览器里输入http://mybookliveIP:9091打开transmission主界面进行下载。

Cookie, iframe 与 P3P 的那点事儿 – DBA Notes

Cookie, iframe 与 P3P 的那点事儿

且说我使用有些网络服务的时候常常能遇到比较怪异的问题。昨天在某个页面遇到个 Redirect Loop 错误提示:

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

同样的问题,同样的页面,同样是 Firefox 浏览器,以前就遇到过,提交给相关负责人之后没了响应,后来也忘掉了。同事说是我浏览器版本的问题,后来发现这和"是否接受第三方 Cookie" 的设置有关:

[x] Accept cookies from sites
    [ ] Accept third-party cookies

我的浏览器不接受第三方 Cookie。设置接收后该页面显示正常。

搜索了一下,发现之所以该页面是这样,还是因为页面用了 iframe 而导致的问题,比较通用的办法是设置 p3p http header

这个 P3P(Platform for Privacy Preferences Project),要搞明白,可真是有点小孩没娘,说来话长。简单的说,就是个协议,通过其声明它是好人,允许我收集浏览器用户行为吧… 可现实中,大家都可以说自己是好人,背地里没准儿干啥坏事呢。这就是其分歧所在。[参考] 国内多数网站,都不关注这个 P3P。隐私问题可能没国外(微软的隐私声明)重视吧。

再说 Firefox ,过去的几个大版本中,对 Cookie 的处理方式还是有很大变化的。

这个问题影响最大的还是 Facebook 等开放平台的应用,使用了 iframe 就会遇到(eg: FriendFeed 遇到过,估计还比较头疼)。

对于浏览器来说,第三方 Cookie ,默认情况下,浏览器接受与否,是个大问题。如果不接受,会给很多用户带来混淆,如果接受,则在隐私问题上,有很大的挑战。

实际上,Firefox 的开发者在这个地方的处理方式也在摇摆当中(参见), 不过能确定的是 "the ability to make decisions based on p3p policies was removed for firefox 3"。

各家浏览器在这个地方都可能有 Bug。比如 IE7 曾经有的 Cookie 问题,IE8 Beta 也有类似问题

或许,最好的办法就是别去种这个 Cookie 了… 网站开发者,你们愿意么?

–EOF–

更多阅读:Windows Internet Explorer (Pre-Release Version 8) Privacy Statement微软 Cookie 说明

另请参见文本后面 axis 同学的留言。