Saturday, December 19, 2020

Bash Script for converting APE to FLAC

This is a little script I use for batch converting ape files in a folder into flac.

 

#!/bin/bash
for f in *.ape
do
    mac "$f"  "${f%.*ape}.wav" -d && flac --best "${f%.*ape}.wav" && rm "${f%.*ape}.wav"
done
 

Sunday, December 6, 2020

AIMP Player for Android

I choose an Android One phone for its better support and cleaner launcher.  It is all good except one thing and that is Music Player.  The default Google Music player isn't great but passable.  Playlist is good but personally I prefer using folder for grouping.

The player isn't great but at least it is there to use, but now Google has decided ot take this away and replaced it with Youtube Music.  It is all good if you only use streaming services for your music.  However for people like myself who only play music off from my local collection, this action from Google is simple appaulling.

 Anyway, if you are in the same boat like myself, you may want to give AIMP (https://play.google.com/store/apps/details?id=com.aimp.player&hl=en_GB&gl=US) a try.  It is a nice free alternative with no ads.

Although without Google Music, there are many options available at the play store.  Still, I think it is a bad decision to take away a basic music player.


Wednesday, September 23, 2020

NanoPi R2S and OpenWRT

Although there is an OEM version of OpenWRT (FriendlyWRT) for NanoPi R2S, personally I prefer using the original version of OpenWRT if it is possible.  The FriendlyWRT is fine solution however it is few versions behind the official OpenWRT build.  In addition, the OEM version preloaded with many plugins that I either don't use or I don't know.  For instance, it comes it with many VPN related plugins that are populate in its home market.


Currently, its support hasn't make to the mainstream yet.  It is still under development and its image is under the snapshot branch.  Being a snapshot image, it only contains the very core.  That is it doesn't come with luci preloaded.  Here are steps that I use to set mine up.  Firstly, ssh into your NanoPi, then:-

1) Install luci to regain GUI access.

opkg update
opkg install luci 

2) Install packges for OpenVPN, Custom Command and ttyd.

opkg install openvpn-openssl luci-app-openvpn luci-app-commands luci-app-ttyd

3) Install packages for statistics such as CPU load, thermal etc

opkg install luci-app-statistics
opkg install collectd-mod-cpu collectd-mod-interface collectd-mod-memory collectd-mod-ping collectd-mod-rrdtool collectd-mod-wireless collectd-mod-thermal

4) Install Smart Queue Management (SQM) package

opkg install luci-app-sqm

You may need to restart the r2s to get this to work.

 https://openwrt.org/docs/guide-user/luci/luci_app_statistics 

 

Here is settings for the front LEDs in the /etc/config/system file.

config led 'led_wan'
option name 'WAN'
option sysfs 'nanopi-r2s:green:wan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'eth0'

config led 'led_lan'
option name 'LAN'
option sysfs 'nanopi-r2s:green:lan'
option trigger 'netdev'
option mode 'link tx rx'
option dev 'eth1'

 

 

n.b. all packages in one command:

opkg install luci openvpn-openssl luci-app-openvpn luci-app-commands luci-app-ttyd luci-app-statistics collectd-mod-cpu collectd-mod-interface collectd-mod-memory collectd-mod-ping collectd-mod-rrdtool collectd-mod-wireless collectd-mod-thermal luci-app-sqm

Saturday, September 12, 2020

OpenWRT and Wireguard

VPN Unlimited has a great step by step guide ( https://www.vpnunlimitedapp.com/help/manuals/open-wrt-wireguard-setup) for setting up Wireguard on OpenWRT.

Here, I just want to add a few useful notes on setting up Wireguard.

First, these are packages required to make Wireguard working.


Second, you may need to restart the Wireguard interface to see settings being applied.  Sometimes you may even need to reboot the router.

Last but not the least, it is possible to have one local network using the normal WAN interface, and another network to use WG interface/ OpenVPN TUN Interface. You can do it by using VPN and WAN Policy-Based Routing (luci-app-vpn-policy-routing).

As below, you can specify the routing path for a machine, a group of machines or a network.



It is worth to note that, the policy routing only works if no NAT offloading is deployed.



Again, you may need to do a restart before you can see things become effective.

Saturday, September 5, 2020

How to Update OPNSense to a specific version

Two days ago, I updated my OPNSense to version 20.7.2.  Then I started experiencing issue with my connection.  My connection would cut off after a few hours and I could not get onto the firewall.  Luckily, I have a backup of my configuration so reinstalling the firewall should not be a big problem.

Now, I have this issue of bring the firewall up to date.  If I use the standard method to update the firewall, it will update it to the latest version, i.e. 20.7.2 which is the version I had problems with.  Hence, I need a way to bring my firewall to the last good version, e.g. 20.7.1.

After consulting the know-it-all Google, here is what I found.  On the firmware settings page, rather than using the default flavor, choose "(other)".  In the box underneath, specify the version you want to update to, e.g.

<major version>/MINT/<decimal version number>/OpenSSL

20.7/MINT/20.7.1/OpenSSL

Save the settings, and then press the "Check For Update" button as usual.  You now should get an update offer to the version you specified.

I hope I don't need to do this again in the future, but I guess this is something good to know.


ref: https://forum.opnsense.org/index.php?topic=9638.0

Sunday, August 30, 2020

AdBlock Testing

I just want to share a few useful websites for AdBlock testing.

  • https://ads-blocker.com/testing/
  • https://canyoublockit.com/
  • https://adblock-tester.com/

 

Saturday, August 29, 2020

Useful Public DNS Providers

Just want to list a few public DNS providers I tend to use for my setups.

For unfiltered DNS service, I tend to use Google (8.8.8.8, 8.8.4.4), Cloudflare (1.1.1.1), NextDNS (45.90.28.155, 45.90.30.155), dns.sb (185.222.222.222, 185.184.222.222) for DNS over TLS.  I was using DNS.WATCH (84.200.69.80, 84.200.70.40) before moved to DoT. DNS.WATCH is a nice alternative if you are looking for an option that is not from usual big providers.

Lastly, I uses  DNSForge.de,  a small DNS provider, if I need DNS with AdBlocking service.  DNSForge uses PiHole to do AdBlocking.  I use them over the others because they publish their blocklist on their site so I can determine what are blocked.