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

The Blinking Prompt Times █

Computer tips and tricks, scripts, news
Feel free to propose a Chinese translation !
I'm on ZeroMe !
寻找这篇文章的翻译!
谢谢!

Follow in NewsfeedFollowing

Latest comments:

Script : Twitter in an isolated Firefox window

on Dec 21, 2018

Now that Corebird isn't fully functional anymore thanks to yet another Twitter API change, I wanted a way to have my twitter feed on its own window, just like an app.

I came up with the idea of using a dedicated Firefox profile named "twitter" using firefox -p, some Firefox UI customization and some shell magic to make it look like the part, it should work on any recent Linux/BSD/exotic Unix-like with minimal adjustments.

Sorry for the (very) odd formatting but the code block on ZeroBlog is broken it seems so I am pasting it within a quote block, if anyone has a better way... :p

sleep 5
firefox -P "twitter" -no-remote https://mobile.twitter.com &
while [ 1 ]
do
IS_READY=$(wmctrl -l | grep "Twitter - Mozilla Firefox")
if [ $? -eq 0 ]
then
wmctrl -r "Twitter - Mozilla Firefox" -e 0,1620,0,0,1080
sleep 1
wmctrl -r "Twitter - Mozilla Firefox" -b add,skip_taskbar
break
else
sleep .5
fi

done

wmctrl(1) is used to put the window on the right part of my screen at boot time and to hide it from my taskbar, I think it looks pretty good on my desktop :

firefox_twitter.jpg (1200x675)

Happy scripting !

Read more

A year's dusk 🌆

on Dec 18, 2018

2018 is slowly coming to an end and I can't say I'll miss it to be honest, it is high time to start fresh in so many ways !

For next year, I'll try to make better use of productivity tools like https://habitica.com/ to keep track of todo's and encourage me to cultivate healthier habits (god knows 2018 was awful for me in that regard)

I also plan to program something that could take me several months... something like a small 2D game in Golang or something Zeronet related ? I have yet to find an idea but if you have any, please share !

So fellow Zeronet users, got any goals and dreams for next year ?

“Think of yourself as dead. You have lived your life. Now take what’s left and live it properly.”Marcus Aurelius

Happy holidays season to all and keep seeding ! :)

Read more

znqa 0.1.8 is out

on Jun 05, 2018

I finally made some updates to this add-on ! I added support for up to 4 zites and reworked the UI a bit so it's more compact and has less chance to block the actual content of the webpage when opened, the result looks like this :

znqa018.png (164x165)

Grab it at the usual location on clearnet : https://addons.mozilla.org/en-US/firefox/addon/znqa/

Feedback or add-ons ideas most welcomed :)

Read more

A Firefox Add-ons list for the privacy minded

on May 31, 2018

Long time no post ZeroNet ! I am glad there's still some loyal seeders around to keep the Blinking Prompt Times alive :)

I thought I would share my Firefox add-ons list because, who knows, maybe someone will learn about an add-on thanks to it, feel free to share yours in the comments, sharing is caring ! So without further ado, here it is :

firefox_addons.png (1057x650)

I would make uBlock Origin and uMatrix as essentials (funnily they origin from the same developer "Raymond Hill", props to him/her !)

Privacy Badger and Decentraleyes might be redundant but as Decentraleyes is a recent addition on my setup, I'll have to take some time to learn about it.

I guess I am still to lax about cookies, maybe I should take a look at "Cookie AutoDelete" which is the successor of "Self Destructing cookies"

The rest are quality of life Add-ons and my ZeroNet Add-on znqa which needs some love ... maybe one of those days !

Happy browsing !

Read more

A simple script to automatically put your Linux computer to sleep

on Feb 09, 2018

I like to have my computer sleep to RAM under certain conditions, and of course being the geek I am, I want full control over those.

Enter this small script which will put your computer to sleep if idle since > N minutes (using xprintidle) AND if some applications are not running (You would not want your computer to go to sleep while you use it to listen to music, are downloading something or are doing a backup)

Of course it doesn't cover all cases (What to do about the browser ?) but I believe it's still a pretty good basis

#!/bin/bash

function sleeptime()
{
check vlc &&
check mpv &&
check transmission &&
check virt-manager &&
check xfsdump &&
check emerge &&
sudo pm-suspend

sleep $check_interval # After sleep, don't check before N minutes
}

function check()
{
pgrep $1
if [ $? != 0 ]
then
printf "not using $1\n"
else
printf "using $1, skipping sleep\n"
return 1
fi
}

# Base variables
max_idle=600000
check_interval=30

# Handle options
while test $# -gt 0; do
case "$1" in
--test)
max_idle=600;
check_interval=3;
break
;;
*)
break
;;
esac
done

# Start
while [ 1 ]
do
current_idle=$(xprintidle)
if [ $current_idle -gt $max_idle ] # 10 mins
then
printf "Computer has been idle for 10 minute\n"
sleeptime
fi
sleep $check_interval # Check every 30 seconds
done

Read more

znqa 0.1.6 is out

on Feb 07, 2018

So I just pushed some polishing touches to znqa, a single button can now save all the add-on options, I've reworked the icons and the sizing a bit and I've fixed some warning reported by the Mozilla Add-ons checker (I hope it won't break anything, worst case you may have to re-add your favorites zites if any)

I'm still looking for a better name but ZeroNet Navigator seems too cheesy (besides not being, you know, a real navigator!)

znn192.png (192x192)

I'll continue to make it more configurable and hopefully useful, next planned feature(s) are :

  • increase the user-sites limit to something a bit more interesting like 16 or 32

  • Add the ability to remove the "default" zites

As usual the add-on is available at https://addons.mozilla.org/en-US/firefox/addon/znqa/ or will be updated automatically if you have it installed already.

Happy to take requests / ideas and names if any !

Read more

znqa 0.1.4 : Initial customization support

on Feb 05, 2018

I've updated znqa to support adding one (for now, more to come) custom zite to the icon list ! It also has a proper option page and browser menu icon.

znqa-user-zites.png (925x590)znqa-user-zites2.png (432x528)

You can grab it at https://addons.mozilla.org/en-US/firefox/addon/znqa/

As usual, the source is under MIT/X11 on Gitcenter : http://127.0.0.1:43110/1NaRTgwxsn17BCVSfvq6LG8NVPb9srKG5X

Next up will be fixing the icon list placements which may be a bit off depending on your resolution and adding support for multiples custom zites !

Thank you to the person who put a kind review in the Mozilla Add-on page :)

As usual, feedback much appreciated !

edit : A version 0.1.5 has been released shortly after with the following fixes/improvements :

  • Fix for padding/margin issues (Thanks @Gitcenter for the bug report)
  • Added support for two custom zites
  • Added support for custom names for zites (in place of plain URL)
Read more

Introducing my first WebExtension : znqa !

on Feb 04, 2018

I've been playing a bit with Firefox's WebExtensions for the last two days and I've a small prototype I thought I would share.

znqa (for Zeronet quick access) is an collapsible add-on only displayed on ZeroNet pages (http://127.0.0.1/*) providing one-click access to various Zites no matter where you are on ZeroNet (so that you don't need to go back to ZeroHello or use bookmarks)

Right now, the prototype looks like this (open/collapsed) :

znqa-1st-look.png (229x428)znqa-collapsed.png (150x177)

It's by no means polished and configurable yet but that's the point, I would be happy to have some kind feedback to see what you would like to see implemented ! So feel free to comment below !

The add-on is available on clearnet at https://addons.mozilla.org/en-US/firefox/addon/znqa/

The extension is open-source under the MIT/X11 license on Gitcenter : http://127.0.0.1:43110/1NaRTgwxsn17BCVSfvq6LG8NVPb9srKG5X

Read more

Spotlight: the fish shell

on Jan 25, 2018

fish-mac-os-x-autosuggestion.jpg (620x417)

Most Linux distributions are shipped with the GNU bash shell as default, a robust, scripting-friendly and POSIX-ish compatible shell also available on a wide range of others platforms (macOS, BSD, ...) giving you a solid script portability should you need it.

But bash doesn't really shine as a user shell, its history features are pretty limited (CTRL-R, history and !N (where N is the command number in your history)) to name a few are archaic for nowadays standards

fish is an alternative shell with a focus on interactivity and user-friendliness where the most relevant auto-completion is always shown dynamically as you type in dimmed colors thus making your command history discoverable and easier to access (through the left & rights arrow keys, see this GIF on IFS for a graphical example :

http://127.0.0.1:43110/12MVkvYGcRW6u2NYbpfwVad1oQeyG4s9Er/merged-CDN/1MzV32sv55VSD5Vr7u3mcMPsX2oG9PHusr/data/users/12w3zJ6gRrcAw2kSCQXDkorgqxuXnkKkF8/output.gif

You can also progess by word with alt-{left,right} arrows.

fish also support a CTRL-R like search by typing the pattern you're looking for then hitting the up/down arrows.

It comes by default with a web-based configuration interface to tweak you theme, prompts and so on very easily.

web_config.png (1447x871)

I cannot emphasize how much nicer it feels to use fish if you use a shell daily at home or work daily rather than good old bash, fish really is a different take on what a unix shell could behave and is truly a success.

This spotlight is only scratching the surface of it, why not give it a spin ! It's open source and available on most unix-like systems package managers nowadays.

More info on clearnet at https://fishshell.com/

Read more

Context is everything

on Jan 22, 2018

And this applies to good old grep(1) too !

Need a bit more context around the pattern or word you are looking for ? Add --context=N such as :

$ grep "Z270-A PRIME" PC-2018.md
ASUS Z270-A PRIME

$ grep --context=3 "Z270-A PRIME" PC-2018.md

4C/8T @ 3.6 Ghz

ASUS Z270-A PRIME
i7-7700
16 GB RAM

Also check --before-context and --after-context, self-explanatory options if you know this first one

Read more

A simple OpenVPN kill switch with iptables

on Jan 21, 2018

lock.png (64x64)

If you're using a VPN, you probably already know that disconnections might happen for whichever reason and the last thing you want is leaking your Internet traffic outside of the VPN tunnel.

Fortunately, on Linux (and BSD/macOS too but that's gonna be for another time) a kill switch on its simplest form is relatively easy to do, here's how :

You have to restrict all traffic to your VPN interface (here tun0 ) and then allow DNS queries (UDP:53) and VPN traffic (UDP:1194/TCP:1194) to be passed through the tunnel, you then deny (DROP) all output not matching the previous rules.

iptables -F OUTPUT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o tun0 -j ACCEPT
iptables -A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p tcp -m tcp --dport 1194 -j ACCEPT
iptables -A OUTPUT -p udp -m udp --dport 1194 -j ACCEPT
iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -o tun0 -j ACCEPT
iptables -A OUTPUT -j DROP
iptables --policy OUTPUT DROP

Based on https://forum.level1techs.com/t/openvpn-network-kill-switch/113111

Read more

Get your public IP from the command line

on Jan 21, 2018

There is several websites providing a way to query your public IP from the command line, my daily driver is ifconfig.co

curl ifconfig.co

It has a rate limit so be careful not to spam it, I've found checking every 60 seconds to be perfectly supported.

You can gather more information like City, Town, Hostname and port as explained on https://ifconfig.co/ , check also https://v6.ifconfig.co/ for IPv6 info.

For a more complete check of your IP including TCP/IP fingerprint, ISP, DNS leaks, check http://ip-api.com or https://www.dnsleaktest.com

寻找篇文章翻译!谢谢!

Read more
Add new post

Title

21 hours ago · 2 min read ·
3 comments
Body
Read more

Not found

Title

21 hours ago · 2 min read

0 Comments:

user_name1 day ago
Reply
Body
This page is a preview of ZeroNet. Start your own ZeroNet for complete experience. Learn More