1
0
mirror of https://github.com/mbirth/wiki.git synced 2024-09-19 06:23:25 +01:00

Various changes.

This commit is contained in:
Markus Birth 2014-05-13 11:47:05 +02:00
parent dcdc070fcb
commit 96bfea8f0c
27 changed files with 10061 additions and 23 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/Gemfile.lock
/bower_components/*/src/
/bower_components/*/doc/
/bower_components/*/docs/
/_site/

View File

@ -1,7 +1,8 @@
name: "mbirth wiki"
description: "All you hacking stuff"
name: "wiki.mbirth.de"
description: "All you never wanted to know"
url: "http://wiki.mbirth.de"
#url: "http://wiki.mbirth.de"
url: ""
#paginate: 10
@ -18,4 +19,4 @@ github:
project_tagline: "Experimental Wiki with Jekyll"
redcarpet:
extensions: []
extensions: ["autolink"]

View File

@ -4,11 +4,16 @@
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="{{ site.url }}/css/stylesheet.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{{ site.url }}/css/pygment_trac.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{{ site.url }}/css/print.css" media="print" />
<title>{{ page.title }} :: {{ site.name }}</title>
<script src="{{ site.url }}/bower_components/jquery/dist/jquery.min.js" type="text/javascript"></script>
{% if page.toc %}
<script src="{{ site.url }}/bower_components/jquery.toc/jquery.toc.js" type="text/javascript"></script>
{% endif %}
</head>
<body>
@ -25,13 +30,15 @@
</section>
</div>
</header>
<div class="container">
<h1 id="pagetitle">{{ page.title }}</h1>
<section id="main_content">
{{ content }}
{% if page.toc %}
<ul data-toc="#main_content"></ul>
{% endif %}
{{ content }}
</section>
</div>
</body>
</html>
</html>

21
bower.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "wiki.mbirth.de",
"version": "0.0.0",
"homepage": "https://github.com/mbirth/wiki",
"authors": [
"Markus Birth <mbirth@gmail.com>"
],
"main": "index.html",
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery.toc": ""
}
}

21
bower_components/jquery.toc/.bower.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
"name": "jquery.toc",
"version": "0.3.5",
"main": "./jquery.toc.js",
"dependencies": {
"jquery": ">=1.6.3"
},
"devDependencies": {
"bootstrap": "~2.3.1"
},
"homepage": "https://github.com/ndabas/toc",
"_release": "0.3.5",
"_resolution": {
"type": "version",
"tag": "v0.3.5",
"commit": "a5c7784cfd4878d8c68af831d504e676b6a4b439"
},
"_source": "git://github.com/ndabas/toc.git",
"_target": "*",
"_originalSource": "jquery.toc"
}

View File

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

11
bower_components/jquery.toc/.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
# Bower components
components/
# NPM components
node_modules/
# Build atrifacts
docs/assets/
docs/css/*.min.css
docs/lib/jquery.toc/
docs/_site/

View File

@ -0,0 +1,67 @@
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
dist: {
files: {
"docs/lib/jquery.toc/jquery.toc.js": "jquery.toc.js"
}
}
},
jshint: {
files: ["gruntfile.js", "jquery.toc.js"],
options: {
globals: {
curly: true,
eqeqeq: true,
immed: true,
indent: 4,
latedef: true,
quotmark: "double",
undef: true,
trailing: true
}
}
},
uglify: {
dist: {
files: {
"docs/lib/jquery.toc/jquery.toc.min.js": ["jquery.toc.js"]
}
},
options: {
banner: "/*! Table of Contents jQuery Plugin - jquery.toc * Copyright 2013 Nikhil Dabas * http://www.apache.org/licenses/LICENSE-2.0 */\n"
}
},
compress: {
dist: {
options: {
archive: "docs/assets/jquery.toc.zip"
},
files: [
{expand: true, cwd: "docs/lib/jquery.toc/", src: ["*"], dest: "jquery.toc/"}
]
}
},
less: {
docs: {
options: {
yuicompress: true
},
files: {
"docs/css/docs.min.css": "docs/css/docs.less"
}
}
}
});
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks('grunt-contrib-less');
grunt.registerTask("default", ["copy", "jshint", "uglify", "compress", "less"]);
};

202
bower_components/jquery.toc/LICENSE vendored Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

90
bower_components/jquery.toc/README.md vendored Normal file
View File

@ -0,0 +1,90 @@
# Table of Contents jQuery Plugin - jquery.toc
A minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the
page.
The generated TOCs are semantic, nested lists (`ul` or `ol`) with hash-link anchors to the headings.
## Usage
You can [download the latest release](http://ndabas.github.com/toc/assets/jquery.toc.zip), or
install with Twitter's [Bower](http://twitter.github.com/bower): `bower install jquery.toc`.
Include jQuery (>= 1.6) and jquery.toc.js/jquery.toc.min.js on your page. The plugin can then be
used either via HTML5 data attributes, or via the programmatic API. See below for the available
options.
### Via data attributes
Minimal example:
<ul data-toc></ul>
With options:
<ol data-toc="div.container" data-toc-headings="h2,h3,h4"></ol>
### Via the JavaScript programmatic API
Minimal example:
<ul id="toc"></ul>
...
<script type="text/javascript">
$("#toc").toc();
</script>
With options:
<ul id="toc"></ul>
...
<script type="text/javascript">
$("#toc").toc({content: "div.container", headings: "h2,h3,h4"});
</script>
### Options
<ul data-toc="content" data-toc-headings="headings"></ul>
$(...).toc({content: "body", headings: "h1,h2,h3"});
The plugin has two options:
* `content` is a selector where the plugin will look for headings to build up the TOC. The default
value is `"body"`.
* `headings` is a string with a comma-separated list of selectors to be used as headings, in the
order which defines their relative hierarchy level. The default value of `"h1,h2,h3"` will select
all `h1`, `h2`, and `h3` elements to build the TOC, with `h1` being a level 1, `h2` a level 2, and
so on. You can use any valid list of jQuery selectors; for example, if you just want `h1` tags
with a specific class, and no `h3` tags, you could use `"h1.title,h2"` for this parameter.
In addition, the plugin will create nested lists of the same type (`ul` or `ol`) as the element that
it is called on.
### Automatic ID generation
The plugin generates hash-links to the headings on the page, to allow users to jump to the heading
by clicking in the generated table of contents. This feature requires that the headings have IDs
assigned; if they do not, the plugin will generate and assign IDs automatically.
The generated IDs are based on the text inside the headings, and uses two simple rules:
* The ID must begin with a letter; so any non-letter (`[^A-Za-z]`) characters are discarded from the
beginning of the string.
* For the rest of the ID, only letters and numbers are used from the heading text; all other
characters (`[^A-Za-z0-9]`) are converted to underscores.
For example, a heading like `<h2>Heading 2.1</h2>` will get the ID `Heading_2_1`.
## Alternatives
If you're looking for a jQuery plugin that does more than just generate a minimal table of contents,
the project wiki [lists some more plugins](https://github.com/ndabas/toc/wiki/Alternatives).
## License
Licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
## Credits
Created by [Nikhil Dabas](http://www.nikhildabas.com/).

View File

@ -0,0 +1,11 @@
{
"name": "jquery.toc",
"version": "0.3.5",
"main": "./jquery.toc.js",
"dependencies": {
"jquery": ">=1.6.3"
},
"devDependencies": {
"bootstrap": "~2.3.1"
}
}

View File

@ -0,0 +1,93 @@
/*
* Table of Contents jQuery Plugin - jquery.toc
*
* Copyright 2013 Nikhil Dabas
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations
* under the License.
*/
(function ($) {
"use strict";
// Builds a list with the table of contents in the current selector.
// options:
// content: where to look for headings
// headings: string with a comma-separated list of selectors to be used as headings, ordered
// by their relative hierarchy level
var toc = function (options) {
return this.each(function () {
var root = $(this),
data = root.data(),
thisOptions,
stack = [root], // The upside-down stack keeps track of list elements
listTag = this.tagName,
currentLevel = 0,
headingSelectors;
// Defaults: plugin parameters override data attributes, which override our defaults
thisOptions = $.extend(
{content: "body", headings: "h1,h2,h3"},
{content: data.toc || undefined, headings: data.tocHeadings || undefined},
options
);
headingSelectors = thisOptions.headings.split(",");
// Set up some automatic IDs if we do not already have them
$(thisOptions.content).find(thisOptions.headings).attr("id", function (index, attr) {
// Generate a valid ID: must start with a letter, and contain only letters and
// numbers. All other characters are replaced with underscores.
return attr ||
$(this).text().replace(/^[^A-Za-z]*/, "").replace(/[^A-Za-z0-9]+/g, "_");
}).each(function () {
// What level is the current heading?
var elem = $(this), level = $.map(headingSelectors, function (selector, index) {
return elem.is(selector) ? index : undefined;
})[0];
if (level > currentLevel) {
// If the heading is at a deeper level than where we are, start a new nested
// list, but only if we already have some list items in the parent. If we do
// not, that means that we're skipping levels, so we can just add new list items
// at the current level.
// In the upside-down stack, unshift = push, and stack[0] = the top.
var parentItem = stack[0].children("li:last")[0];
if (parentItem) {
stack.unshift($("<" + listTag + "/>").appendTo(parentItem));
}
} else {
// Truncate the stack to the current level by chopping off the 'top' of the
// stack. We also need to preserve at least one element in the stack - that is
// the containing element.
stack.splice(0, Math.min(currentLevel - level, Math.max(stack.length - 1, 0)));
}
// Add the list item
$("<li/>").appendTo(stack[0]).append(
$("<a/>").text(elem.text()).attr("href", "#" + elem.attr("id"))
);
currentLevel = level;
});
});
}, old = $.fn.toc;
$.fn.toc = toc;
$.fn.toc.noConflict = function () {
$.fn.toc = old;
return this;
};
// Data API
$(function () {
toc.call($("[data-toc]"));
});
}(window.jQuery));

View File

@ -0,0 +1,26 @@
{
"name": "jquery.toc",
"version": "0.3.5",
"description": "A minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the page.",
"main": "jquery.toc.js",
"repository": {
"type": "git",
"url": "https://github.com/ndabas/toc.git"
},
"author": "Nikhil Dabas",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-uglify": "~0.1.2",
"grunt-contrib-jshint": "~0.2.0",
"grunt-contrib-copy": "~0.4.0",
"grunt-contrib-compress": "~0.4.1",
"grunt-contrib-less": "~0.5.0"
}
}

View File

@ -0,0 +1,35 @@
{
"name": "toc",
"title": "Table of Contents jQuery Plugin",
"description": "jquery.toc is a minimal, tiny jQuery plugin that will generate a table of contents, drawing from headings on the page.",
"keywords": [
"toc",
"table",
"contents",
"headings"
],
"version": "0.3.5",
"author": {
"name": "Nikhil Dabas",
"url": "http://www.nikhildabas.com/"
},
"maintainers": [
{
"name": "Nikhil Dabas",
"url": "http://www.nikhildabas.com/"
}
],
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"bugs": "https://github.com/ndabas/toc/issues",
"homepage": "http://ndabas.github.com/toc/",
"docs": "http://ndabas.github.com/toc/",
"download": "http://ndabas.github.com/toc/assets/jquery.toc.zip",
"dependencies": {
"jquery": ">=1.6"
}
}

37
bower_components/jquery/.bower.json vendored Normal file
View File

@ -0,0 +1,37 @@
{
"name": "jquery",
"version": "2.1.1",
"main": "dist/jquery.js",
"license": "MIT",
"ignore": [
"**/.*",
"build",
"speed",
"test",
"*.md",
"AUTHORS.txt",
"Gruntfile.js",
"package.json"
],
"devDependencies": {
"sizzle": "1.10.19",
"requirejs": "2.1.10",
"qunit": "1.14.0",
"sinon": "1.8.1"
},
"keywords": [
"jquery",
"javascript",
"library"
],
"homepage": "https://github.com/jquery/jquery",
"_release": "2.1.1",
"_resolution": {
"type": "version",
"tag": "2.1.1",
"commit": "4dec426aa2a6cbabb1b064319ba7c272d594a688"
},
"_source": "git://github.com/jquery/jquery.git",
"_target": ">=1.6.3",
"_originalSource": "jquery"
}

21
bower_components/jquery/MIT-LICENSE.txt vendored Normal file
View File

@ -0,0 +1,21 @@
Copyright 2014 jQuery Foundation and other contributors
http://jquery.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

27
bower_components/jquery/bower.json vendored Normal file
View File

@ -0,0 +1,27 @@
{
"name": "jquery",
"version": "2.1.1",
"main": "dist/jquery.js",
"license": "MIT",
"ignore": [
"**/.*",
"build",
"speed",
"test",
"*.md",
"AUTHORS.txt",
"Gruntfile.js",
"package.json"
],
"devDependencies": {
"sizzle": "1.10.19",
"requirejs": "2.1.10",
"qunit": "1.14.0",
"sinon": "1.8.1"
},
"keywords": [
"jquery",
"javascript",
"library"
]
}

9190
bower_components/jquery/dist/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@ body {
.container {
width: 90%;
max-width: 600px;
max-width: 900px;
margin: 0 auto;
}
@ -43,20 +43,23 @@ header {
margin: 0 0 40px 0;
}
header h1 {
header h1, #pagetitle {
font-size: 30px;
line-height: 1.5;
margin: 0 0 0 -40px;
font-weight: bold;
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
color: #b5e853;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1),
0 0 5px rgba(181, 232, 83, 0.1),
0 0 10px rgba(181, 232, 83, 0.1);
letter-spacing: -1px;
-webkit-font-smoothing: antialiased;
}
header h1 {
letter-spacing: -1px;
margin: 0 0 0 -40px;
}
header h1:before {
content: "./ ";
font-size: 24px;
@ -74,8 +77,7 @@ header h2 {
margin: 0;
}
/* Main Content
*/
/* Main Content */
#main_content {
width: 100%;
@ -96,7 +98,7 @@ h1, h2, h3, h4, h5, h6 {
}
#main_content h1 {
font-size: 30px;
font-size: 28px;
}
#main_content h2 {
@ -149,10 +151,18 @@ blockquote {
border-left: 1px dotted #666;
}
code {
padding: 3px;
white-space: nowrap;
}
pre {
padding: 10px;
}
pre, code {
background: rgba(0, 0, 0, 0.9);
border: 1px solid rgba(255, 255, 255, 0.15);
padding: 10px;
font-size: 14px;
color: #b5e853;
border-radius: 2px;
@ -163,6 +173,15 @@ pre {
overflow-y: hidden;
}
/* Reset styles if code is inside pre
(This is what you get from re-using CSS!)
*/
pre > code {
border: 0 none;
white-space: pre;
padding: 0;
}
table {
width: 100%;
margin: 0 0 20px 0;
@ -185,8 +204,7 @@ hr {
color: #b5e853;
}
/* Buttons
*/
/* Buttons */
.btn {
display: inline-block;
@ -244,4 +262,4 @@ a {
.cf {
zoom:1;
}
}

View File

@ -0,0 +1,33 @@
---
title: ASUS WL-300g
layout: default
created: 2009-02-02 23:18:42 +0100
toc: true
---
# Install DD-WRT
**Download:** [dd-wrt.com](http://www.dd-wrt.com/dd-wrtv2/down.php?path=downloads%2Fv24-sp1%2FConsumer%2FAsus%2FWL300g/)
## Patching firmware
Older versions of DD-WRT didn't provide a firmware file for the WL-300g, but only for the WL-500gx. So I had to patch it for the WL-300g to accept.
The router ID was found quick: In the `dd-wrt.v23_asus.trx` at `0x356fc4`, there's the string
```
57 4c 35 30 30 67 78
```
which is `WL500gx`. After changing it to `WL300g ` (with a space after the "g" to fill up the digit), the router didn't reject the firmware directly, but initiated the update, then rebooted quickly after that and showed the old firmware again.
According to the [DD-WRT manual for the WL-500g](http://www.dd-wrt.com/wiki/index.php/Installation#Asus_WL500G</u>.28Original.29), the router should have a recovery mode which you can enable by holding the Reset button while powering on the device. But seems this mode wasn't there in my router.
So there has to be some sort of checksum which tells the router whether the firmware file is corrupt or not. In the DD-WRT forums I read somewhere, that there are only some informational bytes different between a normal DD-WRT binary firmware and the ASUS TRX format - maybe the ID-string at the end.
Therefore I compared the two files `dd-wrt.v23_asus.trx` and `dd-wrt.v23_generic.bin` and voilà: Besides the few bytes at the end of the file, there were 4 additional bytes different at position `0x08`. This HAD to be the checksum. The remaining question was, from which bytes it was calculated. Since the seemingly compressed data began at `0x28`, I tried from there to the end and used [Hex-Workshop](http://www.hexworkshop.com/) to calculate different checksums, but nothing matched what was in these 4 bytes. The next try was from `0x10` but also no match. Then I tried starting directly after the checksum in the header, from `0x0c` and bang: The CRC32 checksum matched that in the header.
![Hex Workshop Screenshot](hexworks.png)
So I calculated the CRC32 of my modified file and changed the header - and now I could upload the DD-WRT file using the normal firmware upgrade of the original firmware. After installing v23, you can easily update to v24 using the DD-WRT web interface.
![DD-WRT Version Info](ddwrt.png)

View File

@ -0,0 +1,107 @@
---
title: AVM Fritz!Box 7270
layout: default
created: 2009-12-19 18:40:34 +0100
toc: true
---
**Homepage:** http://www.avm.de/de/Produkte/FRITZBox/FRITZ_Box_Fon_WLAN_7270/index.php
Fritz Fun
=========
If you want to receive facsimilies (fax) via your Fritz!Box, you can do that via the internal fax receiver. If you want to **send** faxes from Ubuntu, you can install the [ffgtk](http://wiki.ubuntuusers.de/ffgtk)-package. The original homepage of the project is [tabos.org](http://www.tabos.org/ffgtk/). With it installed, you will get a new "Fax" printer to send faxes and it can also receive faxes directly to your PC.
VPN
===
You can set up your FB to accept VPN connections. As a client, you can use the free [Shrew Soft VPN Client](http://www.shrew.net/). How to set up the client is explained in the [AVM VPN portal](http://www.avm.de/de/Service/Service-Portale/Service-Portal/index.php?portal=VPN) (see bottom right box).
Static DHCP
===========
The FB only supports "static DHCP" in the way that you can mark devices so that they keep their currently (via DHCP) assigned IP address. You can not manually set the IP address you want.
So you could now go the easy way and enable *Telnet access* to the device and change the DHCP table directly. But this way you won't get any support from AVM and also you will get a nasty warning message in the web interface.
Another way is to export the configuration and change the entries there. If you know how to update the checksum, you can use any text editor program. But if you just want to make a few changes without learning how to calculate the checksum, there's a Java program called [FBEditor](http://www.ip-phone-forum.de/showthread.php?t=79513).
Just download it, enter the IP and password of your FB and there you go. Any changes you make inside the program will automatically update the checksum so that the FB will accept your changes.
So now it's easy to change the `dhcpserver` => `statics` section or the `landevices` => `landevices`.
<note important>If you make any changes to the *Network* settings in the web interface, the changes you made by editing the file will probably be deleted. At least if the third byte of an IP address doesn't match the FB's one. (e.g. if you have a class B network)</note>
Generate static DHCP configuration from a file
----------------------------------------------
If you have several devices in your home network and the FB keeps deleting them from their settings, you can create a file with all your devices and generate the appropiate FB settings from it.
So first, create a file `static.list` which looks like this (fill in the data of your own hosts):
```
00:21:85:C0:FF:EE mypc 172.16.1.1
00:16:D4:C0:FF:EE wife-pc 172.16.1.2
00:18:39:C0:FF:EE slug 172.16.254.253
00:25:00:C0:FF:EE iphone 172.16.1.10
00:1E:A9:C0:FF:EE wii 172.16.1.11
00:22:69:C0:FF:EE netbook 172.16.1.3
00:C0:EB:C0:FF:EE printsvr 172.16.254.252
```
Then you only need this little Python script (and *[Python](http://www.python.org/)*, of course):
```python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "mbirth"
__date__ = "$2009-12-19 17:37:38$"
f = open( "static.list", "rt" )
entries = []
for line in f:
line = line.strip(" \n")
( mac, sep, post ) = line.partition(' ')
post = post.strip()
( host, sep, ip ) = post.partition(' ')
ip = ip.strip()
entries.append( ( mac, host, ip ) )
print( "%i hosts found." % len( entries ) )
statics = " statics"
for entry in entries:
statics += " {\n"
statics += " macaddr = " + entry[0] + ";\n"
statics += " ipaddr = " + entry[2] + ";\n"
statics += " }"
print( "#### dhcpserver > statics" )
print( statics )
landevs = " landevices"
for entry in entries:
landevs += " {\n"
landevs += " ip = " + entry[2] + ";\n"
landevs += " name = \"" + entry[1] + "\";\n"
landevs += " mac = " + entry[0] + ";\n"
landevs += " medium = medium_ethernet;\n"
landevs += " }"
print( "#### landevices > landevices" )
print( landevs )
```
Custom DNS
==========
To use custom DNS entries instead of those given by your ISP, use the [FBEditor](http://www.ip-phone-forum.de/showthread.php?t=79513) and find the entries
overwrite_dns1 = 0.0.0.0;
overwrite_dns2 = 0.0.0.0;
Now just insert your desired DNS servers, upload the changed config and you should be set. (Info found on [ip-phone-forum.de](http://www.ip-phone-forum.de/showthread.php?t=86191&page=2).)

BIN
know-how/hacking/ddwrt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -7,8 +7,15 @@ layout: default
**Hello world!**
```
```bash
#!/bin/bash
echo "Test!"
```
```php
<?php
echo phpinfo();
?>
```