Friday, 20 October 2017

How I found out an app I installed on my phone was causing my phone to lag - By mining cryptocurrency! [ COINHIVE ]

A few weeks ago I checked XDA Labs, which is an alternative app store / forum browser for "indie" android apps. XDA Developers is the best place to find out how to root your phone, install a custom ROM, check out amazing applications by talented developers, etc. But this time, I found an app that caused my phone to slow down so badly I didn't know what was going on...

...until I opened OS Monitor (which requires root on Android 7.0 and above), which you can find on F-Droid. In the main tab it shows you the percentage of CPU an app is consuming. And smack dab on the top of the list was:



"VMusic". An application to stream free music from YouTube and other sources. Sounds good right? Wrong. The developer of this app has decided to include the CoinHive javascript miner malware in this app, which is what caused the app to slow down my device (which is low end, so it can't have apps consuming that much CPU without grinding the phone to a halt).

Shame on CoinHive for making it possible for people to (excuse my French) r*pe the f*ck out of someones computer resources, and shame on devs for thinking it's a good idea to include it in a mobile app.

So yeah, if somethings up with your phone and it's slowing down, open up OS Monitor and see what's up.

~This has been a rant~

Thursday, 20 April 2017

Fixing the Non-Working Thinkpad T510i Mic Mute Button on Ubuntu MATE 17.04

So, apparently, the mic mute button stopped working in Ubuntu. I remember it working in Ubuntu 16.04 but not 17.04. Anyways, I fixed it with this simple instruction from a user on AskUbuntu.

https://askubuntu.com/questions/125367/enabling-mic-mute-button-and-light-on-lenovo-thinkpads

This is what I did to fix the mic mute button on the Thinkpad T510i. The LED on it works now too. If you have a different Thinkpad, I suggest following the full tutorial on the AskUbuntu link above.

Anyways, this is what I did:

Created the file /etc/acpi/events/lenovo-mutemic

with the contents:

event=button/f20 F20 00000080 00000000 K
action=/etc/acpi/lenovo-mutemic.sh

Created the file /etc/acpi/lenovo-mutemic.sh

with the contents:

#!/bin/bash
INPUT_DEVICE="'Capture'"
YOUR_USERNAME="username"
if amixer sget $INPUT_DEVICE,0 | grep '\[on\]' ; then
    amixer sset $INPUT_DEVICE,0 toggle
    #echo "0 blink" > /proc/acpi/ibm/led
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-muted-symbolic "Mic MUTED"'
else
    amixer sset $INPUT_DEVICE,0 toggle                       
    su $YOUR_USERNAME -c 'DISPLAY=":0.0" notify-send -t 50 \
            -i microphone-sensitivity-high-symbolic "Mic ON"'
    echo "0 on" > /proc/acpi/ibm/led 
fi

Important: Replace username with your Linux username.

Find your Linux username by typing "whoami" in the terminal.

Finally, I did this:

sudo chmod +x /etc/acpi/lenovo-mutemic.sh
sudo service acpid restart

Thank you random user on AskUbuntu!

How To Fix Graphical Glitches in Serious Sam Classic TFE & TSE under Wine

I wanted to play Serious Sam Classic: The First Encounter on my Thinkpad running Linux. (Ubuntu 17.04)

Unfortunately, the native Linux version doesn't run for me, for some reason. Maybe it's to due to the Intel graphics drivers. I also tried compiling the open source release of the Serious Engine but that failed to compile.

So, I decided to run it in Wine. Which "worked", but had severe graphical glitches making the game unplayable.

Apparently this is due to a "non-existant Z-buffer". To fix this, in Serious Sam The First Encounter or The Second Encounter, open the in-game console, either F1 or ~ . Then, type these 2 lines and press enter after each one:

/gap_iDepthBits=24
/ApplyVideoMode()

That should fix the issue.

Source: https://appdb.winehq.org/objectManager.php?sClass=version&iId=2288

Tuesday, 31 January 2017

[Quick Linux Tip] Stuttering/Lagging in Games or Emulators on the Cinnamon desktop? If you have a System Monitor Applet, Remove it. [Updated]

What the title said.

[Updated, see below.]

I noticed for about a year that my emulators (Gens, Kega Fusion, Fceux, Nestopia) etc would stutter while playing and that was incredibly annoying. It made me want to use my Android device (Moto G 2014) for emulation more than my laptop because of how smooth it was.

Then, I remembered listening to a certain Linux podcast where the host had the same issue, I believe he was using the Gnome desktop, but it applies to Cinnamon as well as they are based on the same technology. The solution is to remove the System Monitor applet if you have one. Of course, if you don't have a System Monitor applet, this won't help. My only other solution for you then, is to play your emulators in fullscreen mode. That's not ideal, though.

I like being able to monitor CPU and network usage, because "OCD", but performance is more important to me. Besides, who wants to play Sonic the Hedgehog with microstutter? Gotta go fast!

Update: I found a System Monitor applet which does not cause any (noticeable) stutter. Here's the link to it:

https://cinnamon-spices.linuxmint.com/applets/view/88

Also, here's the link to the applet that does cause stutter:

https://cinnamon-spices.linuxmint.com/applets/view/79

Saturday, 7 January 2017

Modified Reddit Enhancement Suite for Pale Moon web browser

Reddit Enhancement Suite is one of the first addons I install when setting up any browser. It is one of those addons you don't know you need until you start using it.



My favorite feature in RES is the "never ending Reddit" feature. I can infinitely scroll Reddit without having to deal with pages. Does Reddit even have pages anymore? I don't know, because I always use RES.

Unfortunately, it is not available officially for Pale Moon. That said, Pale Moon forum member "JustOff" has hacked together a fixed version of Reddit Enhancement Suite which you can find here:

https://github.com/JustOff/pm27-sdk-addons

To install it, click the "Download" button corresponding to the addon you want (Reddit Enhancement Suite in this case) in the "Fix for PM27" column.

I tested this version, and it works as expected.

Thank you JustOff!

How to install and use mpv to watch streaming video in Ubuntu 16.04 or Linux Mint 18.x



mpv is an open source cross platform media player for Linux, Mac OS X, Windows, and BSD. It is excellent for watching streaming video when coupled with another piece of software youtube-dl. mpv is a nice alternative to watching videos in the browser, as you don't have to use flash or a buggy ad-ridden website.

This tutorial will show you how to install and use an up to date version of mpv and youtube-dl on Ubuntu 16.04 and Linux Mint 18.x (18, 18.1, and whatever point release comes after that)

Installing mpv

 

mpv is already in the Ubuntu 16.04 repository, but I will show you how to install an updated version.

Please follow my instructions carefully, also, if you have added any other updated media library PPAs, please purge them with ppa-purge before adding these ones. This tutorial is meant for people who have the default media libraries that came with Ubuntu 16.04 or Linux Mint 18.

If you have messed with your system, purge any other media lib PPAs with:

$ sudo ppa-purge -d xenial ppa:some/ppa

The dollar sign is not part of the command, it's only to represent that this is a terminal command. Change some/ppa to the ppa you want to purge.

Ok, now to get on with the tutorial.

Step 1. Type this in the terminal (or copy and paste)

$ sudo add-apt-repository ppa:mc3man/mpv-tests -y && sudo add-apt-repository ppa:mc3man/xerus-media -y && sudo apt update && sudo apt install mpv && sudo apt dist-upgrade

Make sure to look at the programs and libraries that will be updated, and press 'y' once you're confident.

Once you're all updated and mpv is installed, install youtube-dl.

$ sudo apt install python-pip

$ sudo pip install youtube-dl

To upgrade youtube-dl if it ever gets outdated, do this:

$ sudo pip install youtube-dl --upgrade

Now we'll continue to the next part.

Using mpv & youtube-dl

 

To use mpv, simply paste a video URL such as a youtube video, or any other supported site after the 'mpv' command.

So, for example:

$ mpv https://www.youtube.com/watch?v=dQw4w9WgXcQ

That will play a popular YouTube video in an mpv video.

To use  youtube-dl (to download a video)

$ youtube-dl https://www.youtube.com/watch?v=dQw4w9WgXcQ

To find a list of options youtube-dl has, type:

$ youtube-dl --help

mpv supports all the video sites youtube-dl does.

The list of supported sites can be found at: https://rg3.github.io/youtube-dl/supportedsites.html

mpv has a barebones user interface, it has keyboard shortcuts you can use to play and pause the video (spacebar), and to fast forward and rewind you can use the arrow keys. For more shortcuts, look up the documentation on mpv with:

$ man mpv (to view the manual)

To install a fully featured GUI for mpv (like VLC has), type this:

$ sudo apt install baka-mplayer

(assuming you added those two PPAs)

It will show up in the menus as "Baka-MPlayer"

I hope you found this tutorial useful.

Pale Moon and why it may be a Firefox fan's only hope



Yesterday I blogged about Seamonkey, a community-run project affiliated with Mozilla. While I like Seamonkey, after googling about the upcoming deprecation of XUL based addons in Firefox (which is a bad decision because it basically makes Firefox a Chrome clone), I noticed that people were saying that Seamonkey will probably follow suit, as they are a much smaller team, and will likely follow whatever bad decision Mozilla ends up making.

In the past few years, Mozilla has been removing useful features from Firefox and announcing that it will remove even more, alienating its core userbase in the process. These days, they (Mozilla) are basically acting like children, putting their fingers in their ears shouting "Na na na na I can't hear you!" at any criticism they get.

I know in the past blog post I said I stopped using Pale Moon for "various reasons", well... I don't remember what those reasons were. Maybe it was because I thought Firefox wasn't going to go down this route.

Thankfully, Pale Moon isn't going to be deprecating the XUL based addons. (As far as I know from what I've read) It also is compatible with way more addons than Seamonkey is. It is a fork of an old version of Firefox, but modified and updated, and they forked Gecko and called it Goanna.

One downside is, that it is a much smaller team then Firefox. That could be said about any fork, though.

To install Pale Moon in Linux, you can use the Pale Moon installer. That is what I am currently using. However, you can also install it with the third party yet fully endorsed repository for Debian and Ubuntu (and Linux Mint + any other Ubuntu derivative) here: LINK

For more information about Pale Moon, visit it's official website at:
https://www.palemoon.org/