? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

BinChan's ZeroNotes

Messy Notes about using ZeroNet and other things
All code published here are under CC-BY-SA licence, if not compatible, then MIT license X)

Follow in NewsfeedFollowing

TOC by date
TOC by tag
View in light theme

Latest comments:

uMatrix for Helping Understand the Truth of Clearnet

on Apr 05, 2018 · 2 min read ·
4 comments

tag: tutorial clearnet

uMatrix is a Firefox/Chrome/... addon/extension, from A uMatrix guide for Firefox:

The extension is developed and maintained by Raymond Hill (Gorhill), the developer of uBlock Origin, a popular content blocker that is also available for various browsers including Firefox.

Why two extensions and not just one? While both extensions can be used for the same purpose -- blocking content -- they are different when it comes to scope. Without going into too many details: uMatrix is like the advanced brother of uBlock Origin. It gives you more control, and comes with privacy enhancements on top of that.

Yep, uMatrix is a powerful tool for giving user/net-citizen full control of their browser, aka protecting us from all kinds of privacy violation, security traps and also helping us understanding our online activities.

Read more

ZeroNet Dev Resources Index Update

on Mar 31, 2018
tag: zeronet dev

Just updated ZeroNet Dev Resources Index, added quite some new stuffs like TOC (hmm, it might be better if I created a repo for it, but I'm too lazy to maintain it :P, you can use the method in Add Experimental History Diff to the Current ZeroWiki for diff). It's available both in ZeroTalk and in ZeroWiki.

Table of Contents

  • Docs & References
  • Tutorials & Learning Resources
  • Tools & Dev Services
  • Devs & Opensource Projects
    • Coffeescript
    • Vue.js
    • Other js frontend & unconfirmed
    • Backend - python, etc.
    • Some other remarkable opensource projects
  • Dev Blogs
Read more

Tweak My ZeroMe Data And Some Thought About Zite Ownership

on Mar 14, 2018 · 3 min read
tag: long_writing zeronet zerome

The size of optional files of my ZeroMe account is reaching 10 MB, and Orange hub has max_optional_file_size settings in ./data/users/content.json (For official hubs only Orange hub and Sun hub have such a setting, other hubs don't, so I guess it's an experiment for Nofish to test max_optional_file_zite feature, and Nofish created White hub by cloning another hub, but created Sun hub by cloning Orange hub. And I unfortunately dropped into Orange hub when I registered ZeroMe ;_;), therefore I can't sign and publish my content if I post a large image. I tried to ask Nofish for removing that setting or adding extra permission for my account, by both ZeroMe and ZeroMail, but didn't receive a reply for more than a week.. So I have to deal it by myself.

I cloned a new hub, created a new profile with a different id (0ch.anonymous by 0chan.bit, because a user can't have two same ZeroID in users.json iirc, also 0chan.bit is retired in favor of Milchan.bit, so.. :3) and used the script below to copy posts with image to my new account in my own hub:

Read more

Idea: Add More Cmdline Support For ZeroNet And Zites

on Mar 02, 2018 ·
9 comments

tag: zeronet cmd

I'm interested in adding more command line support for ZeroNet and zites, though I doubt if I will use them very often XD Some hardcore GNU/Linux, BSD devs/hackers will like them I guess. As mentioned in this post on ZeroMe, if there some APIs (more supports), a dev on GNU/Linux or BSD can even easily do everything with cmdline, with super low system requirement, as no need for a GUI system setup.

Currently what I have is: A Shell Script for Manually Signing User Content, and some bots which can be transformed for cmdline usage. Signing and publishing content.json with cmd takes too long time, because zeronet.py tries to start a new instance first [Edit 1]. Guess it's possible to add an option for avoiding it, and the process can also be thrown to background, too.

And here are some rough ideas:

$ zerohello list feeds -> List newsfeeds, with feed_id
$ zerohello reply feed:FEED_ID -> Reply to a post/comment/mention
$ zeromail list -> List new zeromail
$ echo "Hello!" | zeromail reply binchan2 -> Reply to ZeroMail, or with cat tmp_reply.md for long text.
$ zerotalk list | grep zeronet -> List new topics on ZeroTalk with keyword "zeronet", topics are all with topic_id.
$ zerotalk list topics:binchan2 -> List all topics of a user
$ zerotalk show topic:TOPIC_ID -> Show topic and comments of a topic
$ zerotalk follow topic:TOPIC_ID -> Follow a topic, aka add a topic to ZeroHello Newsfeeds timeline.
$ zerotalk comment topic:TOPIC_ID -> comment to a topic
$ zerome create profile -> create a new profile on ZeroMe (with interactive script)
$ zerome show post:POST_ID -> Show a post (image to ASCII) and its comments
$ zerome --interactive -> Run ZeroMe in interactive mode, with screen or tmux for multiple windows.

Also here is the awesome cli apps list on Github, if someone wants to explore some related projects.

Edit 1: here is zeronet-websocket for using websocket in cmdline, with it we can sign and publish content, run ZeroFrame API cmd without trying to start a new ZeroNet instance first. Thank 空澄砂夜 (Sorasumi Sayo) for the suggestion and the work!

Edit 2: zeronet-websocket from edit 1 is based on Nodejs, now we also have Python version of ZeroFrame API websocket wrapper and cmd examples for ZeroNet, ZeroName, etc. Thank Git Center!

Edit 3: Wow! Now websocket call is directly supported in official ZeroNet \o/

Pack a websocket client to allow run any ZeroFrame API call from command line using. Eg.: zeronet.py siteCmd 1yoursite fileGet content.json

Read more

Playing Electrum

on Feb 22, 2018 · 4 min read
tag: long_writing bitcoin

Electrum is a lightweight Bitcoin wallet, as you may already know or are using it. Why playing it? Because.. this is the first time I set up a bitcoin wallet X3

Yes, I knew Bitcoin in 2013, when I was still a university student, from the shocking news of Cyprus bailout deal, a member of EU, had economic (government finance) crisis, because of using euro, couldn't suck every citizen by cash printer and currency inflation like Venezuela recently, directly extracted tax from bank account. At that time some info about Bitcoin was spreading in my social network, and I also joked that using Bitcoin then I wouldn't worry about goverment directly taxing me from my bank account! And a friend joked me back asking if I have a bank account in Cyprus XD However, I didn't pay more attention or set up a bitcoin wallet, and.. you may also know that Bitcoin was considered as the worst investment in 2013 (reported/opined/promoted by some pop media).

I have been on ZeroNet and been tracking Bitcoin price and Bitcoin related news for more than one year, but this is the first time I set up a wallet. Why? I prefer not to share details :3 it's somehow a kind of lifestyle I guess. I can anwser why setting up a Bitcoin wallet now though, because of this~ Why choosing Electrum? Because it's probably the only Bitcoin wallet app in Arch official repo (for Parabola pcr repo there is also armory, zeronet is also in that repo, too ;) and it's recommended by ulrichard.

Back to the topic, from the package dependency, Electrum is written in Python and its GUI by qt. First time opening the UI, it asked me to set up a new wallet. There are four options:

Read more

Insert Video and Audio to ZeroBlog

on Feb 08, 2018 · 1 min read
tag: tutorial zeroblog

Add "optional": "media/.*", to content.json of your blog folder and copy the related file to the folder media, then use the format below to insert video or audio. [ref]

For video:

<video src="media/What is GNU Linux.webm" controls preload="none" width="600" style="max-width: 100%;">
Your browser doesn't support HTML5 video. Here is a <a href="media/What is GNU Linux.webm">link to the video</a> instead.
</video>

Audio:

<audio src="media/08 - Hunter - Milhaven.mp3" controls preload="none">
Your browser doesn't support HTML5 audio. Here is a <a href="media/08 - Hunter - Milhaven.mp3">link to the audio</a> instead.
</audio>

preload="none" should be enough to prevent visitor from auto-downloading those large files when openning your blog, but to make it safer, also to avoid loading video widget everytime when opening the homepage, you can add --- (in Markdown mode) to hide them after "Read more" (Note: after saving the article, before sign and publish, refresh the page one time to make it work).

Edit: Also you need to ASCII-lize your file name or ZeroNet can't sign it, one nice tool is Python unidecode lib:

from unidecode import unidecode
unidecode(song).replace('!',''),  # "!" is not supported in optional file name

Test a video: What is GNU Linux.webm (4.8 MB, not a big file)

Read more

Tutorial: Run ZeroNet in Android by Linuxdeploy

on Feb 07, 2018 · 2 min read ·
7 comments

tag: zeronet tutorial android

Yet another method to run ZeroNet on Android :3 and this method is probably the most secure and energy friendly, which likely consumes less power than ZeroNet-kivy app.

Screenshot:

Read more

How Fast It Can Be To Build A Zite

on Feb 07, 2018
tag: zeronet webdev

How fast it can be to build a fantastic zite (by a pro):

GitCenter - on Jan 25, 2018:

This isn't even beta, it is alpha. I've started developing it two days ago. But creating hubs is finished, adding articles (no editing yet, though) and viewing them is done. So in a week or so I will release.

Kaffie - on Jan 25, 2018:
Damn that's fast. Definitely hyped for this.

GitCenter - on Jan 28, 2018:
Kiwipedia Beta is up!
[Kiwipedia discussion thread on ZeroTalkDev]

=== ===

空澄砂夜 - on Nov 26, 2017:
好的来做一个特化屏蔽能力的ZeroMe吧。

Polar - on Dec 04, 2017:
You surprisingly have the patience to review ZeroMe code...

空澄砂夜 - on Dec 04, 2017
@Polar: Except I didn't. I just read dbschema.json and built from scratch.

空澄砂夜 - on Dec 10, 2017:
A preview version of |><||> is now up at sakana.bit. Most operations are supported, but it is not possible to like posts, create profiles, or update profiles yet. Please keep in mind that this is prerelease software. Make sure your data is backed up before signing in [...]

Read more

zero://

on Feb 06, 2018 · 1 min read ·
9 comments

tag: zeronet protocol

https://blog.mozilla.org/addons/2018/01/26/extensions-firefox-59/

Starting with Firefox 59, several protocols that support decentralized architectures are available for use by extensions. The newly approved protocols are:

  • Dat Project (dat://)
  • IPFS (dweb:// ipfs:// ipns://)
  • Secure Scuttlebutt (ssb://)

I don't understand why Firefox 59 approved Dat, IPFS and Secure Scuttlebutt but didn't mention ZeroNet. Because ZeroNet main devs has less communication with Mozilla or the Firefox team? Or the quality of ZeroNet is not good enough? Or because some trolls keep posting hostile content, some people posts illegal content here but they can't be censored, Nofish takes it as low priority and so the platform got ignored? He got invited to TED2017 (but his talk was cancelled several weeks before the conference began.. he still got invited as an audience though), and even RMS reached him and asked for changing the license of ZeroNet from GPLv2 to GPLv3 (but he didn't do it..).

Adding zero:// for ZeroNet can make typing .bit address easier and make the address neater, and it has been discussed several times before.

Nofish said that it always works in this post, but that method only removes localhost:43110 or replaces it with zero, it's still not ideal.

@Polar commented "May ZeroNet is indie, have no company support". I totally agree with it. Firefox is opensource, so I guess the best approach would be by reading the related code and adding it by ourselves.

Btw, recently I'm rocking ZeroBlog design again ^^ Available at ZeroBlog Plus

Read more

Zite Publishing - From A User's Perspective

on Jan 22, 2018 · 2 min read ·
12 comments

tag: zeronet tutorial

You probably know that zite publishing can be a terrible experience for newcomers. Because one's zite can't have any peer if s/he don't ask others to help seed it, and it's horrible when his port is close or falsely displays as opened (this happened to me, my ISP doesn't allow to open port, but sometimes it displays as opened, click re-check then it's gone, sometimes click re-check and it's still opened...).

I haven't checked the code about how zite publishing works, but I'm experienced about it and know quite some tricks, I list them here so that someone may find them useful:

If your 15441 port is truly opened, after you published your zite, others can click the link you posted somewhere, make a request to your computer and download the zite. You may need to publish your zite one more time so they can receive all files (not confirmed).

If your port is close or falsely opened, others can only (afaik) download your zite at the same time when you are publishing it [Edit 1]. It doesn't work asynchronously. And here are some solutions:

Read more

Proposal: Official Opt-in Zite Crawl Plugin

on Jan 21, 2018
tag: zeronet proposal
  • Improve ZeroName to protect zite owner and visitor

    • Give users a warning when the domain name doesn't match the auth address in sites.json, and the notification presents both old auth address and new auth address for user.
    • Store old auth addresses (and available to display peer count) in ZeroName, and list all of them when a user opens a .bit address, for solving the situation that .bit address gets posted in other place but not any more redirects to the original zite.
  • Crawl ZeroName

  • Crawled zites display in ZeroSites

  • Opt: don't allow submit .bit address on ZeroSites, .bit address can be only crawled from ZeroName.

  • Zites that were crawled can't be crawled anymore (if possible to implement).

  • Opt: list of users who crawls most zites, reward user namecoin when a new zite is successfully crawled.

  • Zites with same auth address, only zite with highest peer count is displayed, others can be viewed within a drawer.

  • Opt: help seed new .bit domain zite, and crawl auth address zite in ZeroSites for helping seed new zites (dangerous as some zites may include illegal content).

Others including me can help implement it, too :D

PS1: it would be nice if ZeroNet could provide free subdomain for users, e.g. if a user registers a ZeroID bob, then he will have a domain bob.zeroid.bit, and he can use it for a site he created, or bob.zeroid.zero without namecoin domain. Need to prevent spamming, so not any id will be supported

Read more

Multi-upload Music Files to ZeroLSTN

on Jan 16, 2018 · 3 min read ·
7 comments

tag: zeronet tutorial

So finally we have a beautiful music streaming zite \o/ Why not stuffing it with content? I have uploaded about 1.7 GB music there (I won't tell you where they are and you can try to find them by yourself :3). And here is how:

Prerequisite:

  • Your songs (album) have proper ID3 tags, if not, you can use EasyTAG to create them efficiently, or you need to change the code a bit.

  • pip install pytaglib Unidecode --user

I use Jupyter Notebook so that I can easily test each block of code, if you want a single script, you can try to glue them by yourself :3

Read more

Local ZeroMail Bot

on Jan 10, 2018 · 2 min read ·
8 comments

tag: zeronet bot

This is a Python2 script that decrypts your ZeroMail and sends them to a local bot. After you schedule the bot and follow it, you can receive new ZeroMail notification from ZeroHello newsfeed.

Table of Contents

How to install:

  1. Open ZeroMail bot zite, then from ZeroHello [FAQ 1], choose 3-dot menu after the zite "Local ZeroMail Bot" and clone it. Again from ZeroHello choose the menu after your new "myLocal ZeroMail Bot" and check "Pause" (Because it's for local use ;) (If you can't open the zite, you can download it here and unzip it to /path/to/zeronet/data/, you may need to restart ZeroNet server to open it).
  2. On your new bot zite select an id you like and send a message, so your id folder is generated in your zite. Also hit the "Follow" button.
  3. Download ZeroMailBot.zip from my blog, then unzip it to the root folder of your ZeroNet instance. Or clone and copy it from my messy repo.
  4. Finally start the bot with $ python2 zeromail_bot.py, follow the instruction and done! You can schedule the bot with cron, systemd, or with a simple command like $ while sleep TIME_INTERVAL_IN_SECOND; do python2 zeromail_bot.py; done.

Screenshot:

Read more

Add Anchor to ZeroChat

on Jan 06, 2018 · 2 min read
tag: javascript zeronet

Continue my absurd astonishing Javascript coding trip. In this time it is an informative essay for a trivial problem!

You may know that if an html element has an id, you can add that id to the url to jump to the position of that element. And such url/link is called anchor.

But on ZeroNet a zite is inside an iframe sandbox, it can't access to the resources outside the iframe, and it seems anchor doesn't work with usual code. So ZeroNet uimedia.js provides two functions:
One is onhashchange

      window.onhashchange = (function(_this) {
        return function(e) {
          var src;
          _this.log("Hashchange", window.location.hash);
          if (window.location.hash) {
            src = $("#inner-iframe").attr("src").replace(/#.*/, "") + window.location.hash;
            return $("#inner-iframe").attr("src", src);
          }
        };
      })(this);

With it when you click an anchor inside the page (like TOC), you can jump to the related portion.

Read more

Adding Markdown to ZeroChat

on Jan 02, 2018 · 2 min read ·
3 comments

tag: javascript zeronet

Adding Markdown to ZeroChat:

    addMessage (username, message) {
        var message_escaped = message.replace(/</g, "&lt;").replace(/>/g, "&gt;")  // Escape html tags in the message
        console.log(message_escaped)
        var message_obj = JSON.parse(message_escaped)

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

In console:

JSON.parse('{"subject":"Test","body":"`test`\n> test\n[test](/test)\n![test](/test)\n##test\n#test\n###test\n```\ntest\n```","to":"binchan2@zeroid.bit"}')

SyntaxError: JSON.parse: bad control character in string literal at line 1 column 33 of the JSON data

JSON.parse('{"subject":"Test","body":"`test`\n> test\n[test](/test)\n![test](/test)\n##test\n#test\n###test\n```\ntest\n```","to":"binchan2@zeroid.bit"}'.replace(/\n/g, "\\\\n"))
Read more
Add new post

Title

21 hours ago · 2 min read ·
3 comments

tag:
Body
Read more

Not found

21 hours ago · 2 min read
tag:

0 Comments:

user_name1 day ago
Reply
Body
Select user
  • Welcome to ZeroMessage!
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More