2018年7月23日 星期一

[How To] [LXDE] Fix lxrandr not working

[How To] [LXDE] Fix lxrandr not working

in case you switch from traditional harddisk to SSD and your computer boot very fast that makes xrandr run too fast and makes it not work every time. you should

1. Edit the autostart file
    vim ~/.config/autostart/lxrandr-autostart.desktop

2. Add some sleep before xrandr
[Desktop Entry]
Type=Application
Name=LXRandR autostart
Comment=Start xrandr with settings done in LXRandR
Exec=sh -c 'sleep 2 && xrandr --output VGA1 --mode 1920x1080 --same-as LVDS1 --output LVDS1 --off'
OnlyShowIn=LXDE


3. restart X and done

2018年5月15日 星期二

[How To] install adblock in openwrt or LEDE

As we know some of the wireless devices cannnot install adblock plugin such as iphone and iPad. We can modify our routers to add adblock in our open source routers.

So how to do it:

The following packages is needed:
1. adblock (the adblock package)
2. libustream-mbedtls (For https download using uclient-fetch)
3. luci-app-adblock (in case for luci interface)

    #opkg install adblock libustream-mbedtls luci-app-adblock

After installation, you need some configuration. For luci, you can find the configuration in homepage-> "Service" Tab -> "Adblock"

enable the host that you need to.

for command line configuration
you need to: (I come from Hong Kong, so I block the reg_cn)
    #/etc/init.d/adblock enable 
    #/etc/init.d/adblock start
    #uci set adblock.global.enabled='1'
    #uci set adblock.reg_cn.enabled='1'
    #uci commit

To verify correct installation
In the log tab in Adblock luci page:
    Tue May 15 14:25:18 2018 user.info adblock-[3.4.3]: blocklist with overall 29670 domains loaded successfully (NETGEAR WNDR3700v4, LEDE XXXXX)
or the same line shown in command line
    #logread |grep adblock

from client side, try ping "analytics.google.com"
    $ ping analytics.google.com
    ping: analytics.google.com: Name or service not known


Conclusion
This adblock is not as good as the browser plugin one as it just block the advertisment hosts. But at least your private information will not be sent to those ad servers.

Cheers