Skip to content

Instantly share code, notes, and snippets.

View xor-freenet's full-sized avatar

xor-freenet

View GitHub Profile
public class LogInWebInterfaceToadlet extends WebInterfaceToadlet {
protected LogInWebInterfaceToadlet(HighLevelSimpleClient client, WebInterface wi, NodeClientCore core, String pageTitle) {
super(client, wi, core, pageTitle);
}
/** Log an user in from a POST and redirect to the BoardsPage */
@Override
public void handleMethodPOST(URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, IOException, RedirectException {
if(!ctx.checkFullAccess(this))
public class LogInWebInterfaceToadlet extends WebInterfaceToadlet {
protected LogInWebInterfaceToadlet(HighLevelSimpleClient client, WebInterface wi, NodeClientCore core, String pageTitle) {
super(client, wi, core, pageTitle);
}
/** Log an user in from a POST and redirect to the BoardsPage */
@Override
public void handleMethodPOST(URI uri, HTTPRequest request, ToadletContext ctx) throws ToadletContextClosedException, IOException, RedirectException {
if(!ctx.checkFullAccess(this))
@xor-freenet
xor-freenet / 5757-benchmark.gnuplot
Last active September 15, 2015 13:38
Gnuplot script for processing output of "wotutil.sh -benchmarkRemoveTrustDestructive ..."
file_old="WebOfTrust.benchmark.seed1.old.5052.gp"
file_new="WebOfTrust.benchmark.seed1.new.5052.gp"
set xlabel "Trust value count"
set ylabel "Time for removing a single Trust value (seconds)"
set terminal wxt size 800,600
stats file_old using 1 prefix "oldcodex"
stats file_old using 2 prefix "oldcode"
stats file_new using 1 prefix "newcodex"
@xor-freenet
xor-freenet / run.sh
Last active September 21, 2015 21:37
Modified header for Freenet's run.sh so it can become an init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: Freenet
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Freenet
# Description: Freenet
### END INIT INFO
@xor-freenet
xor-freenet / 6636-benchmark.gnuplot
Created September 15, 2015 13:37
Gnuplot script for processing output of "wotutil.sh -benchmarkRemoveTrustDestructive ..."
file_old="WebOfTrust.benchmark.seed1.old.5052.gp"
file_new1="WebOfTrust.benchmark.seed1.issue5757.5052.gp"
file_new2="WebOfTrust.benchmark.seed1.issue6636.5052.gp"
set xlabel "Trust value count"
set ylabel "Time for removing a single Trust value (seconds)"
set terminal wxt size 800,600
stats file_old using 1 prefix "oldcodex"
stats file_old using 2 prefix "oldcode"
@xor-freenet
xor-freenet / find-latest-identity-files.sh
Last active May 18, 2016 20:05
WoT: Script for getting latest identity files from the IdentityFileDiskQueue archive directory (enable DEBUG logging for plugins.WebOfTrust.IdentityFileDiskQueue to get it)
#!/bin/bash
echo "WARNING: Do not use with dirs/files which contain newline characters!" >&2
prev_file=""
prev_id=""
for file in $(find WebOfTrust/IdentityFileQueue/Finished/ -type f | cut --delimiter=_ --fields=2,3 | sort) ; do
IFS='_' read -ra tokens <<< "$file"
@xor-freenet
xor-freenet / version-usage-statistics.sh
Last active September 19, 2015 21:56
WoT: Script for version usage histogram from the IdentityFileDiskQueue archive directory (requires https://gist.github.com/xor-freenet/5098d13fa1c990e6c81d)
#!/bin/bash
(
for file in $(./find-latest-identity-files.sh) ; do
# find-latest-identity-files.sh strips part of the filename, we must complete it again.
real_file=( WebOfTrust/IdentityFileQueue/Finished/*$file )
# Some XML files use Windows line breaks, which would confuse uniq.
# tr converts them to Unix.
egrep --text --max-count=1 '<WebOfTrust Version="([[:digit:]]*)">' "$real_file" | tr -d '\015'
@xor-freenet
xor-freenet / wot-version-usage-2015-09-23.txt
Created September 24, 2015 20:56
WOT version usage statistics 2015-09-23
Identities: 12374
Not fetched identities: 341
Number of identities with each version:
4 <WebOfTrust Version="1">
22 <WebOfTrust Version="2">
118 <WebOfTrust Version="3">
1 <WebOfTrust Version="4">
140 <WebOfTrust Version="5">
105 <WebOfTrust Version="6">
@xor-freenet
xor-freenet / wot-trustee-count-histogram-2015-09-23.txt
Created September 24, 2015 21:32
"wotutil.sh -trusteeCountHistogram" 2015-09-23
Identities: 12374
Not fetched identities: 341
Trusts: 226506
Trustee count histogram follows ...
0: 981
1: 2
2: 10
3: 17
4: 4017
5: 4033
@xor-freenet
xor-freenet / gist:3e698b87e32920a08906
Created October 19, 2015 15:34
Clarification on splitting freenet-ext.jar
Some excerpts on IRC log of 2015-09-19, infinity0 on freenet-ext splitting / Debian packages...
- Most important thing to take from this: freenet-ext *IS* split already, this is just not deployed.
This was a common misconception until he clarified it - many people thought freenet-ext splitting was not finished yet.
NOTICE: The full log contains much more relevant information, please do read it before you work on this.
[Saturday, September 19, 2015] [08:48:47 PM] <infinity0> [19:55:25] when i stopped working on this, the remaining work was all in fred
[Saturday, September 19, 2015] [08:48:47 PM] <infinity0> [19:55:29] to make it support multiple jars
[Saturday, September 19, 2015] [08:48:47 PM] <infinity0> [19:55:33] updating jars that is
[Saturday, September 19, 2015] [08:48:47 PM] <operhiem1> [19:55:45] It does support multiple jars now; Bouncy Castle is separate from freenet-ext.