ZeroNet Blogs

Static ZeroNet blogs mirror

Delete Unwanted Sites (zites)

- Posted in muja's blog by with comments

Bash script to delete sites with user interaction.

Script on NullPaste


for i in 1*; do
    echo ""
    grep --color=auto "description" $i/content.json
    grep --color=auto "title" $i/content.json
    while [ "$try" = "True" ]; do
        echo ""
        read -p "Delete? (yes/no) " rd_cln
        if [ -z "$rd_cln" ]; then
        if [ "$rd_cln" = "yes" ] || [ "$rd_cln" = "y" ]; then
            echo "Deleted"
            rm -rf $i
        elif [ "$rd_cln" = "no" ] || [ "$rd_cln" = "n" ]; then
        elif [ "$rd_cln" = "ls" ]; then
            ls -lAh $i

ZeroVerse support

- Posted in muja's blog by with comments

This blog now accepts certificates created by the ZeroVerse authority.

If this feature is not working, try cleaning your cache or use CTRL + SHIFT + R on the js/all.js file.

You're reading a blog post. You see an interesting link. You click it. The page changes, you go back but now you're at the top of the post.

Not anymore.

With the code that I will share with you, refreshing a page or going back to it will take you to the last spot you left it.

This feature came from a commit from ZeroTalk. (see it on NullPaste)

Edit your js/all.js file.

Search for this.next_message_id = 1; and add this.history_state = {}; in the line after it.

Search for return this.cmd("innerReady"); and replace it with:

      window.addEventListener("beforeunload", (function(_this) {
        return function(e) {
          _this.log("save scrollTop", window.pageYOffset);
          _this.history_state["scrollTop"] = window.pageYOffset;
          return _this.cmd("wrapperReplaceState", [_this.history_state, null]);
      return this.cmd("wrapperGetState", [], (function(_this) {
        return function(state) {
          if (state != null) {
            _this.history_state = state;
          _this.log("restore scrollTop", state, window.pageYOffset);
          if (window.pageYOffset === 0 && state) {
            return window.scroll(window.pageXOffset, state.scrollTop);

If this feature is not working, try cleaning your cache or use CTRL + SHIFT + R on the js/all.js file.


- Posted in muja's blog by with comments

If you read my past posts, you'll see that I'm a huge fan of aliases.

On this post I will, over time, publish all zeronet-related aliases that I can make.

Last update: 9 March, 2016.

  • Start ZeroNet: alias 0='gnome-terminal -x ~/code/zeronet/'

  • Your user: alias zuser='grep -s \"auth_user_name\" /path/to/zeronet/data/users.json'

  • Change your user: alias zch='~code/zeronet/'

  • Go to ZeroNet folder: alias zerogo='cd /path/to/zeronet' or alias zg='cd /path/to/zeronet'

  • Go to data folder of ZeroNet: alias zerogodata='cd /path/to/zeronet/data' or alias zgd='cd /path/to/zeronet/data'

  • Sign site's content: alias zs='python siteSign'

  • Publish site: alias zp='python sitePublish'

  • Create site: alias zsc='python siteCreate'

  • Stop ZeroNet: alias zstop='~/code/zeronet/'

You've been reading about this encryption thing, but what can you use it for?

I've seen that lots of people want to know how to change their ZeroId, so I made a script that will encrypt your current user, decrypt your other user and then change your user. Sounds good?

If you use anything that's not Linux (or maybe Mac), then this won't work for you. You should try Linux, it's what cool people use this days ( :P ) and you don't need to uninstall your current operating system. A lot of people recommend Linux Mint for beginners.

This "tutorial" assumes that your ZeroNet client is not running and that you have two users.json files both registered with ZeroIds. Simply move your current file to another folder and a new one will be created when you start ZeroNet (or maybe even while running).

First thing you gotta do is get yourself some encryption keys.

A few notes before:

The majority of people [citation needed] (;P) advertise against RSA-4096 (that's the size of the key in bits) saying that it's unnecessary since you gain less and less security as your key size increases (see Diminishing returns). My take is that you can't have too much of a good thing (how naive). But read this to see why they say it's unnecessary.

Pro-tip: since we are going to use these keys for scripts, give it some simple, one word name, it'll help later.

So, when they ask you for your Real name, call it Scripts.

Run gpg --gen-key


Now, before I give you the script, make a folder where you will save your encrypted ZeroIds. For example /home/muja/backups/zeronet/users or whatever works best for you. Just remember to put it on the script bellow.

Open a text editor and paste the second code-block (not on it.


# Backup current user

mkdir -p /tmp/zeronet/users/$1 > /dev/null 2>&1
cp /path/to/zeronet/data/users.json /tmp/zeronet/users/$1/users.json
cp /path/to/zeronet/data/sites.json /tmp/zeronet/users/$1/sites.json
cd /tmp/zeronet/users
zip -rq $ $1/ > /dev/null 2>&1
gpg --yes -r Scripts -o /home/muja/backups/zeronet/users/$ -aes /tmp/zeronet/users/$
rm -f $
rm -rf $1/

# Change user

gpg -o /tmp/zeronet/users/$ /home/muja/backups/zeronet/users/$
unzip $  > /dev/null 2>&1
cp $2/users.json /path/to/zeronet/data/users.json
rm -f $
rm -rf $2/

After you make the necessary changes (the path to your zeronet folder, the backup folder, your key name...) give the script permissions to run, like so:

chmod 755

Get an alias to call your script, like so:

echo "alias zch='/path/'" >> ~/.bashrc

Run the script (zch muja muja). Change muja to your user (yes, two times).

Cool, your user (and your sites list) should be encrypted on /home/muja/backups/zeronet/users/

Now put your other user on /path/to/zeronet/data/users.json and run the command again, but this time calling your other user:

zch othermuja muja

The first is your current user and the second is the one you want to change to.

This script is a lot simpler than it might look. If anyone tried doing this and it did not work, make sure you changed these things:

/path/to/zeronet # Path to your zeronet folder
Scripts # Your Real name on your key
/home/muja/backups/zeronet/users #The place to save your users

There's also the chance that I, while adapting this code for publishing, may have made some errors. So feel free to comment bellow or send me a ZeroMail.

It's very unlikely that someone will do this since it's such a niche thing, I just wanted to publish it anyway :)

Using .bit domains

- Posted in muja's blog by with comments

If you got a .bit doman, that's cool!

Now you need to add "domain": "yourAdress.bit", to your content.json file.

Here's an example from ZeroBlog's content.json:

 "description": "Blogging platform Demo",
 "domain": "Blog.ZeroNetwork.bit",

Now clicking on your site from ZeroHello will open your .bit doman.

Stopping ZeroNet with a script

- Posted in muja's blog by with comments

Because sometimes CTRL + C is not the best option.

This will only work if you have something like already.

As usual you can save some typing by using an alias, like so:

echo "alias zstop='/path/'" >> ~/.bashrc

And here's the script:


cd ~code/zeronet
zeroPID=$( pgrep )

if [ $zeroPID ]
    kill -INT -$zeroPID
    echo "ZeroNet has stopped"
    echo "ZeroNet is not running"

For some reason pgrep doesn't work with absolute paths, hence the cd.

Starting ZeroNet with a script

- Posted in muja's blog by with comments

This script will minimize the terminal, pull the latest commits and then start the client.

To make it work even better, call the script in a new terminal. Here's an alias, but keep in mind that I use the gnome terminal so you might need to adapt this to the one you use.

echo "alias zero='gnome-terminal -x /path/'" >> ~/.bashrc

Now that you have an easy and nice way of calling your script, let's create the actual script, here it is: (0.0.4)


sleep 1
minWindow() { xdotool getactivewindow windowminimize
cd /path/to/zeronet

if [ $1 ]; then
    if [ $1 == "disable" ]; then
    python --tor $1
    elif [ $1 == "no-git" ]; then
    python --tor always
    echo "Updating repository..."
    git pull origin master
    echo " "
    python --tor $1
echo "Updating repository..."
git pull origin master
echo " "
python --tor always

That's it.