Thursday, 22 August 2019

How to install Anbox in Fedora 30

Update Nov 21 2020: I fixed the SELinux commands in this article as they were incomplete and caused some confusion. Sorry about that.

How to install Anbox in Fedora 30 as quick as possible.


Open a terminal and type the following commands:

sudo dnf install dkms
sudo dnf install kernel-devel

cd ~
git clone https://github.com/anbox/anbox-modules
cd anbox-modules
sudo cp anbox.conf /etc/modules-load.d/
sudo cp 99-anbox.rules /lib/udev/rules.d/
sudo cp -rT ashmem /usr/src/anbox-ashmem-1
sudo cp -rT binder /usr/src/anbox-binder-1
sudo dkms install anbox-ashmem/1
sudo dkms install anbox-binder/1
sudo modprobe ashmem_linux
sudo modprobe binder_linux


sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap
reboot

snap install --devmode --beta anbox
to update do this: snap refresh --beta --devmode anbox

But wait...Anbox doesn't launch!
because SELinux.
Don't disable SELinux, that's a bad idea.
Instead use SELinux Troubleshooter to find out the cause. To fix it I did this, it might be different for you:

sudo ausearch -c servicemanager --raw | audit2allow -M my-servicemanager
sudo semodule -X 300 -i my-servicemanager.pp
sudo ausearch -c anboxd --raw | audit2allow -M my-anboxd
sudo semodule -X 300 -i my-anboxd.pp
sudo ausearch -c gatekeeperd --raw | audit2allow -M my-gatekeeperd
sudo semodule -X 300 -i my-gatekeeperd.pp

Then launch Anbox. You might need to reboot first though.

Also, install adb so you can do:
adb install filename.apk <--- to install apks into anbox (assuming you don't have your real android device plugged in)


Friday, 9 February 2018

How to allow VLC 3.0 to cast to Chromecast if you have a firewall enabled on Linux

VLC 3.0 recently came out, with the ability to cast to a Chromecast device. However, if you are behind a firewall, such as UFW, a front-end for "iptables", you need to whitelist a certain port.

That port is 8010.

Here is an image on what exactly to type in to allow this port from only your Chromecast, in GUFW (GUI for UFW):

Note: Replace 192.168.1.8 with the IP address of the Chromecast on your network that you want to cast to.


I hope you found this useful.

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.