installation.html 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <title></title>
  7. <!-- 2015-01-11 Sun 11:19 -->
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  9. <meta name="generator" content="Org-mode" />
  10. <meta name="author" content="Bob Mottram" />
  11. <meta name="description" content="Turn the Beaglebone Black into a personal communications server"
  12. />
  13. <meta name="keywords" content="freedombox, debian, beaglebone, red matrix, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber" />
  14. <style type="text/css">
  15. <!--/*--><![CDATA[/*><!--*/
  16. .title { text-align: center; }
  17. .todo { font-family: monospace; color: red; }
  18. .done { color: green; }
  19. .tag { background-color: #eee; font-family: monospace;
  20. padding: 2px; font-size: 80%; font-weight: normal; }
  21. .timestamp { color: #bebebe; }
  22. .timestamp-kwd { color: #5f9ea0; }
  23. .right { margin-left: auto; margin-right: 0px; text-align: right; }
  24. .left { margin-left: 0px; margin-right: auto; text-align: left; }
  25. .center { margin-left: auto; margin-right: auto; text-align: center; }
  26. .underline { text-decoration: underline; }
  27. #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  28. p.verse { margin-left: 3%; }
  29. pre {
  30. border: 1px solid #ccc;
  31. box-shadow: 3px 3px 3px #eee;
  32. padding: 8pt;
  33. font-family: monospace;
  34. overflow: auto;
  35. margin: 1.2em;
  36. }
  37. pre.src {
  38. position: relative;
  39. overflow: visible;
  40. padding-top: 1.2em;
  41. }
  42. pre.src:before {
  43. display: none;
  44. position: absolute;
  45. background-color: white;
  46. top: -10px;
  47. right: 10px;
  48. padding: 3px;
  49. border: 1px solid black;
  50. }
  51. pre.src:hover:before { display: inline;}
  52. pre.src-sh:before { content: 'sh'; }
  53. pre.src-bash:before { content: 'sh'; }
  54. pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  55. pre.src-R:before { content: 'R'; }
  56. pre.src-perl:before { content: 'Perl'; }
  57. pre.src-java:before { content: 'Java'; }
  58. pre.src-sql:before { content: 'SQL'; }
  59. table { border-collapse:collapse; }
  60. caption.t-above { caption-side: top; }
  61. caption.t-bottom { caption-side: bottom; }
  62. td, th { vertical-align:top; }
  63. th.right { text-align: center; }
  64. th.left { text-align: center; }
  65. th.center { text-align: center; }
  66. td.right { text-align: right; }
  67. td.left { text-align: left; }
  68. td.center { text-align: center; }
  69. dt { font-weight: bold; }
  70. .footpara:nth-child(2) { display: inline; }
  71. .footpara { display: block; }
  72. .footdef { margin-bottom: 1em; }
  73. .figure { padding: 1em; }
  74. .figure p { text-align: center; }
  75. .inlinetask {
  76. padding: 10px;
  77. border: 2px solid gray;
  78. margin: 10px;
  79. background: #ffffcc;
  80. }
  81. #org-div-home-and-up
  82. { text-align: right; font-size: 70%; white-space: nowrap; }
  83. textarea { overflow-x: auto; }
  84. .linenr { font-size: smaller }
  85. .code-highlighted { background-color: #ffff00; }
  86. .org-info-js_info-navigation { border-style: none; }
  87. #org-info-js_console-label
  88. { font-size: 10px; font-weight: bold; white-space: nowrap; }
  89. .org-info-js_search-highlight
  90. { background-color: #ffff00; color: #000000; font-weight: bold; }
  91. /*]]>*/-->
  92. </style>
  93. <link rel="stylesheet" type="text/css"
  94. href="http://sachachua.com/blog/wp-content/themes/sacha-v3/foundation/css/foundation.min.css"></link>
  95. <link rel="stylesheet" type="text/css" href="http://sachachua.com/org-export.css"></link>
  96. <link rel="stylesheet" type="text/css" href="http://sachachua.com/blog/wp-content/themes/sacha-v3/style.css"></link>
  97. <script type="text/javascript">
  98. /*
  99. @licstart The following is the entire license notice for the
  100. JavaScript code in this tag.
  101. Copyright (C) 2012-2013 Free Software Foundation, Inc.
  102. The JavaScript code in this tag is free software: you can
  103. redistribute it and/or modify it under the terms of the GNU
  104. General Public License (GNU GPL) as published by the Free Software
  105. Foundation, either version 3 of the License, or (at your option)
  106. any later version. The code is distributed WITHOUT ANY WARRANTY;
  107. without even the implied warranty of MERCHANTABILITY or FITNESS
  108. FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
  109. As additional permission under GNU GPL version 3 section 7, you
  110. may distribute non-source (e.g., minimized or compacted) forms of
  111. that code without the copy of the GNU GPL normally required by
  112. section 4, provided you include this license notice and a URL
  113. through which recipients can access the Corresponding Source.
  114. @licend The above is the entire license notice
  115. for the JavaScript code in this tag.
  116. */
  117. <!--/*--><![CDATA[/*><!--*/
  118. function CodeHighlightOn(elem, id)
  119. {
  120. var target = document.getElementById(id);
  121. if(null != target) {
  122. elem.cacheClassElem = elem.className;
  123. elem.cacheClassTarget = target.className;
  124. target.className = "code-highlighted";
  125. elem.className = "code-highlighted";
  126. }
  127. }
  128. function CodeHighlightOff(elem, id)
  129. {
  130. var target = document.getElementById(id);
  131. if(elem.cacheClassElem)
  132. elem.className = elem.cacheClassElem;
  133. if(elem.cacheClassTarget)
  134. target.className = elem.cacheClassTarget;
  135. }
  136. /*]]>*///-->
  137. </script>
  138. </head>
  139. <body>
  140. <div id="preamble" class="status">
  141. <a name="top" id="top"></a>
  142. </div>
  143. <div id="content">
  144. <h1 class="title"></h1>
  145. <div class="center">
  146. <div class="figure">
  147. <p><img src="./images/logo.png" alt="logo.png" />
  148. </p>
  149. </div>
  150. </div>
  151. <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  152. <colgroup>
  153. <col class="left" />
  154. <col class="left" />
  155. <col class="left" />
  156. <col class="left" />
  157. <col class="left" />
  158. </colgroup>
  159. <tbody>
  160. <tr>
  161. <td class="left"><a href="index.html">Home</a></td>
  162. <td class="left"><a href="#unnumbered-1">Download the code</a></td>
  163. <td class="left"><a href="#unnumbered-2">On a Beaglebone Black</a></td>
  164. <td class="left"><a href="#unnumbered-3">On a laptop/PC/netbook</a></td>
  165. <td class="left"><a href="#unnumbered-4">Internet Router</a></td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <div id="outline-container-unnumbered-1" class="outline-2">
  170. <h2 id="unnumbered-1">Download the code</h2>
  171. <div class="outline-text-2" id="text-unnumbered-1">
  172. <p>
  173. Firstly you'll need to download the code as follows:
  174. </p>
  175. <div class="org-src-container">
  176. <pre class="src src-bash">sudo apt-get install git
  177. git clone https://github.com/bashrc/freedombone
  178. <span class="org-builtin">cd</span> freedombone
  179. </pre>
  180. </div>
  181. </div>
  182. </div>
  183. <div id="outline-container-unnumbered-2" class="outline-2">
  184. <h2 id="unnumbered-2">On a Beaglebone Black</h2>
  185. <div class="outline-text-2" id="text-unnumbered-2">
  186. <p>
  187. To get started you will need:
  188. </p>
  189. <ul class="org-ul">
  190. <li>A Beaglebone Black
  191. </li>
  192. <li>A MicroSD card
  193. </li>
  194. <li>Ethernet cable
  195. </li>
  196. <li>Optionally a 5V 2A power supply for the Beaglebone Black
  197. </li>
  198. <li>Access to the internet via a router with ethernet sockets
  199. </li>
  200. <li>USB thumb drive (for backups or storing media)
  201. </li>
  202. <li>One or more subdomains created on <a href="https://freedns.afraid.org/">https://freedns.afraid.org/</a>
  203. </li>
  204. <li>A purchased domain name and SSL certificate (only needed for Red Matrix)
  205. </li>
  206. <li>A laptop or desktop machine with the ability to write to a microSD card (might need an adaptor)
  207. </li>
  208. </ul>
  209. <p>
  210. You will also need to know, or find out, the IP address of your internet router and have a suitable static IP address for the Beaglebone on your local network. The router should allow you to forward ports to the Beaglebone (often this is under firewall or "advanced" settings).
  211. </p>
  212. <p>
  213. Check that within <b>initial_setup.sh</b> the router IP address and static IP for the Beaglebone are set correctly.
  214. </p>
  215. <p>
  216. Plug the microSD card into your laptop/desktop and then run the <b>initial_setup.sh</b> script. For example:
  217. </p>
  218. <div class="org-src-container">
  219. <pre class="src src-bash">./initial_setup.sh /dev/sdX
  220. </pre>
  221. </div>
  222. <p>
  223. where <b>/dev/sdX</b> is the device name for the microSD card. Often it's <b>/dev/sdb</b> or <b>/dev/sdc</b>, depending upon how many drives there are on your system. The script will download the Debian installer and update the microSD card. It can take a while, so be patient.
  224. </p>
  225. <p>
  226. When the initial setup is done follow the instructions on screen to run the main Freedombone script. You can either edit the variables within the <b>install-freedombone.sh</b> script directly, or create a separate configuration file called <b>freedombone.cfg</b> which contains those variables. Variables which you might want to put into a <b>freedombone.cfg</b> file are:
  227. </p>
  228. <div class="org-src-container">
  229. <pre class="src src-bash"><span class="org-variable-name">MY_EMAIL_ADDRESS</span>=&lt;your email address&gt;
  230. <span class="org-variable-name">MY_NAME</span>=&lt;your name/nick/pseudonym&gt;
  231. <span class="org-variable-name">MY_BLOG_TITLE</span>=&lt;title of your blog&gt;
  232. <span class="org-variable-name">MY_BLOG_SUBTITLE</span>=&lt;subtitle of your blog&gt;
  233. <span class="org-variable-name">SSH_PORT</span>=2222
  234. <span class="org-variable-name">FULLBLOG_DOMAIN_NAME</span>=&lt;freedns subdomain for your blog&gt;
  235. <span class="org-variable-name">FULLBLOG_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your blog&gt;
  236. <span class="org-variable-name">MICROBLOG_DOMAIN_NAME</span>=&lt;domain name for your microblog&gt;
  237. <span class="org-variable-name">MICROBLOG_FREEDNS_SUBDOMAIN_CODE</span>=1234
  238. <span class="org-variable-name">REDMATRIX_DOMAIN_NAME</span>=&lt;domain name for your Red Matrix site&gt;
  239. <span class="org-variable-name">OWNCLOUD_DOMAIN_NAME</span>=&lt;freedns subdomain for your Owncloud site&gt;
  240. <span class="org-variable-name">OWNCLOUD_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your Owncloud site&gt;
  241. <span class="org-variable-name">WIKI_TITLE</span>=&lt;title of your wiki&gt;
  242. <span class="org-variable-name">WIKI_DOMAIN_NAME</span>=&lt;freedns subdomain for your wiki&gt;
  243. <span class="org-variable-name">WIKI_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your wiki&gt;
  244. <span class="org-variable-name">MY_GPG_PUBLIC_KEY</span>=&lt;exported public key filename&gt;
  245. <span class="org-variable-name">MY_GPG_PRIVATE_KE</span>=&lt;exported private key filename&gt;
  246. <span class="org-variable-name">PUBLIC_MAILING_LIST</span>=&lt;name of your mailing list&gt;
  247. <span class="org-variable-name">LOCAL_NETWORK_STATIC_IP_ADDRESS</span>=192.168.1.60
  248. <span class="org-variable-name">ROUTER_IP_ADDRESS</span>=192.168.1.254
  249. <span class="org-variable-name">ENABLE_CJDNS</span>=no
  250. </pre>
  251. </div>
  252. <p>
  253. The GPG public/private key variables are for the filenames of exported GPG keys, and if a private key filename is given then it will be automatically shredded after import.
  254. </p>
  255. <p>
  256. The <a href="https://freedns.afraid.org/">FreeDNS</a> subdomain codes can be found under "Dynamic DNS" and "quick cron example". On the last line it will be the string located between the '?' and the '==' characters.
  257. </p>
  258. <p>
  259. The syntax of the <b>install-freedombone.sh</b> script is:
  260. </p>
  261. <div class="org-src-container">
  262. <pre class="src src-bash">./install-freedombone.sh &lt;your wiki domain name&gt; &lt;your username&gt; &lt;your wiki FreeDNS domain code&gt; [optional variant type]
  263. </pre>
  264. </div>
  265. <p>
  266. If you don't specify a variant type with the final option then everything will be installed. If you have a <b>freedombone.cfg</b> file then it should be in the same directory as <b>install-freedombone.sh</b>.
  267. </p>
  268. <p>
  269. Installation is not quick, and depends upon which variant you choose and your internet bandwidth. Allow about three hours for a full installation on the Beaglebone Black. On the Beaglebone installation is in two parts, since a reboot is needed to enable the hardware random number generator and zram.
  270. </p>
  271. <p>
  272. When done you can ssh into the Freedombone with:
  273. </p>
  274. <div class="org-src-container">
  275. <pre class="src src-bash">ssh username@domain -p 2222
  276. </pre>
  277. </div>
  278. <p>
  279. Any manual post-installation setup instructions or passwords can be found in <b>/home/username/README</b>. You should remove any passwords from that file and store them within a password manager such as KeepassX.
  280. </p>
  281. </div>
  282. </div>
  283. <div id="outline-container-unnumbered-3" class="outline-2">
  284. <h2 id="unnumbered-3">On a laptop/PC/netbook</h2>
  285. <div class="outline-text-2" id="text-unnumbered-3">
  286. <p>
  287. It's also possible to install Freedombone onto other hardware, including other types of single board computer. Any system with a fresh installation of Debian Jessie will do. Just make sure that you change the variable INSTALLING_ON_BBB to "no" within <b>freedombone.cfg</b> or the <b>install-freedombone.sh</b> script. Obviously, you don't need to run the <b>initial_setup.sh</b> script on non-Beaglebone systems.
  288. </p>
  289. <ul class="org-ul">
  290. <li>Download the <a href="https://www.debian.org/devel/debian-installer">Debian Jessie "netinst" installer</a>
  291. </li>
  292. <li>Use <a href="https://apps.ubuntu.com/cat/applications/usb-creator-gtk/">Startup Disk Creator</a> or <a href="https://en.wikipedia.org/wiki/UNetbootin">Unetbootin</a> to copy the netinst image to a USB thumb drive
  293. </li>
  294. <li>Connect the machine to your internet router using an ethernet patch lead. Freedombone is a fully free (as in freedom) system and so wifi drivers may not work. A wired network connection will give better performance anyway.
  295. </li>
  296. <li>On the target machine boot from the USB drive and go through the installation. It's a good idea to use LVM and disk encryption together with a long passphrase which will be hard to crack by brute force methods. Keep a note of the passphrase in your password manager.
  297. </li>
  298. <li>Within the installer unselect the <b>print server</b> and select the <b>ssh server</b>
  299. </li>
  300. <li>After installation use ssh to access the machine and become the root user
  301. </li>
  302. </ul>
  303. <div class="org-src-container">
  304. <pre class="src src-bash">ssh username@192.168.1.60
  305. su
  306. </pre>
  307. </div>
  308. <ul class="org-ul">
  309. <li>If you have GPG keys you may wish to transfer them to the <b>/home/usernname</b> directory. If the machine has a second USB socket or an SD card slot then that may be the most secure way to do it.
  310. </li>
  311. <li>Run the following commands:
  312. </li>
  313. </ul>
  314. <div class="org-src-container">
  315. <pre class="src src-bash"><span class="org-builtin">cd</span> /home/&lt;username&gt;
  316. apt-get install git
  317. git clone https://github.com/bashrc/freedombone
  318. <span class="org-builtin">cd</span> freedombone
  319. nano freedombone.cfg
  320. </pre>
  321. </div>
  322. <ul class="org-ul">
  323. <li>Now create a configuration file, such as the following, filling in the details for your <a href="https://freedns.afraid.org/">FreeDNS subdomains</a>.
  324. </li>
  325. </ul>
  326. <div class="org-src-container">
  327. <pre class="src src-bash"><span class="org-variable-name">INSTALLING_ON_BBB</span>=no
  328. <span class="org-variable-name">MY_EMAIL_ADDRESS</span>=&lt;your email address&gt;
  329. <span class="org-variable-name">MY_NAME</span>=&lt;your name/nick/pseudonym&gt;
  330. <span class="org-variable-name">MY_BLOG_TITLE</span>=&lt;title of your blog&gt;
  331. <span class="org-variable-name">MY_BLOG_SUBTITLE</span>=&lt;subtitle of your blog&gt;
  332. <span class="org-variable-name">SSH_PORT</span>=2222
  333. <span class="org-variable-name">FULLBLOG_DOMAIN_NAME</span>=&lt;freedns subdomain for your blog&gt;
  334. <span class="org-variable-name">FULLBLOG_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your blog&gt;
  335. <span class="org-variable-name">MICROBLOG_DOMAIN_NAME</span>=&lt;domain name for your microblog&gt;
  336. <span class="org-variable-name">MICROBLOG_FREEDNS_SUBDOMAIN_CODE</span>=1234
  337. <span class="org-variable-name">REDMATRIX_DOMAIN_NAME</span>=&lt;domain name for your Red Matrix site&gt;
  338. <span class="org-variable-name">OWNCLOUD_DOMAIN_NAME</span>=&lt;freedns subdomain for your Owncloud site&gt;
  339. <span class="org-variable-name">OWNCLOUD_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your Owncloud site&gt;
  340. <span class="org-variable-name">WIKI_TITLE</span>=&lt;title of your wiki&gt;
  341. <span class="org-variable-name">WIKI_DOMAIN_NAME</span>=&lt;freedns subdomain for your wiki&gt;
  342. <span class="org-variable-name">WIKI_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your wiki&gt;
  343. <span class="org-variable-name">MY_GPG_PUBLIC_KEY</span>=&lt;exported public key filename&gt;
  344. <span class="org-variable-name">MY_GPG_PRIVATE_KE</span>=&lt;exported private key filename&gt;
  345. <span class="org-variable-name">PUBLIC_MAILING_LIST</span>=&lt;name of your mailing list&gt;
  346. <span class="org-variable-name">LOCAL_NETWORK_STATIC_IP_ADDRESS</span>=192.168.1.60
  347. <span class="org-variable-name">ROUTER_IP_ADDRESS</span>=192.168.1.254
  348. <span class="org-variable-name">ENABLE_CJDNS</span>=no
  349. </pre>
  350. </div>
  351. <ul class="org-ul">
  352. <li>Save and exit, then run:
  353. </li>
  354. </ul>
  355. <div class="org-src-container">
  356. <pre class="src src-bash">./install-freedombone.sh &lt;your wiki domain name&gt; &lt;your username&gt; &lt;your wiki FreeDNS domain code&gt;
  357. </pre>
  358. </div>
  359. </div>
  360. </div>
  361. <div id="outline-container-unnumbered-4" class="outline-2">
  362. <h2 id="unnumbered-4">Internet Router</h2>
  363. <div class="outline-text-2" id="text-unnumbered-4">
  364. <p>
  365. On your internet router, typically under firewall settings, open the following ports and forward them to the Freedombone.
  366. </p>
  367. <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  368. <colgroup>
  369. <col class="left" />
  370. <col class="right" />
  371. </colgroup>
  372. <thead>
  373. <tr>
  374. <th scope="col" class="left">Service</th>
  375. <th scope="col" class="right">Ports</th>
  376. </tr>
  377. </thead>
  378. <tbody>
  379. <tr>
  380. <td class="left">HTTP</td>
  381. <td class="right">80</td>
  382. </tr>
  383. <tr>
  384. <td class="left">HTTPS</td>
  385. <td class="right">443</td>
  386. </tr>
  387. <tr>
  388. <td class="left">SSH</td>
  389. <td class="right">2222</td>
  390. </tr>
  391. <tr>
  392. <td class="left">DLNA</td>
  393. <td class="right">1900</td>
  394. </tr>
  395. <tr>
  396. <td class="left">DLNA</td>
  397. <td class="right">8200</td>
  398. </tr>
  399. <tr>
  400. <td class="left">XMPP</td>
  401. <td class="right">5222..5223</td>
  402. </tr>
  403. <tr>
  404. <td class="left">XMPP</td>
  405. <td class="right">5269</td>
  406. </tr>
  407. <tr>
  408. <td class="left">XMPP</td>
  409. <td class="right">5280..5281</td>
  410. </tr>
  411. <tr>
  412. <td class="left">IRC</td>
  413. <td class="right">6697</td>
  414. </tr>
  415. <tr>
  416. <td class="left">IRC</td>
  417. <td class="right">9999</td>
  418. </tr>
  419. <tr>
  420. <td class="left">Git</td>
  421. <td class="right">9418</td>
  422. </tr>
  423. <tr>
  424. <td class="left">Email</td>
  425. <td class="right">25</td>
  426. </tr>
  427. <tr>
  428. <td class="left">Email</td>
  429. <td class="right">587</td>
  430. </tr>
  431. <tr>
  432. <td class="left">Email</td>
  433. <td class="right">465</td>
  434. </tr>
  435. <tr>
  436. <td class="left">Email</td>
  437. <td class="right">993</td>
  438. </tr>
  439. </tbody>
  440. </table>
  441. </div>
  442. </div>
  443. </div>
  444. <div id="postamble" class="status">
  445. <style type="text/css">
  446. .back-to-top {
  447. position: fixed;
  448. bottom: 2em;
  449. right: 0px;
  450. text-decoration: none;
  451. color: #000000;
  452. background-color: rgba(235, 235, 235, 0.80);
  453. font-size: 12px;
  454. padding: 1em;
  455. display: none;
  456. }
  457. .back-to-top:hover {
  458. background-color: rgba(135, 135, 135, 0.50);
  459. }
  460. </style>
  461. <div class="back-to-top">
  462. <a href="#top">Back to top</a> | <a href="mailto:bob@robotics.uk.to">E-mail me</a>
  463. </div>
  464. <script type="text/javascript">
  465. var offset = 220;
  466. var duration = 500;
  467. jQuery(window).scroll(function() {
  468. if (jQuery(this).scrollTop() > offset) {
  469. jQuery('.back-to-top').fadeIn(duration);
  470. } else {
  471. jQuery('.back-to-top').fadeOut(duration);
  472. }
  473. });
  474. </script>
  475. </div>
  476. </body>
  477. </html>