- Details
- Nick Congleton
Objective
Sideload an Android app from Ubuntu to a mobile device.Distributions
This guide is tailored to Ubuntu, but the same principles will work on any distribution.Requirements
A working Ubuntu install with root privileges and an Android device.Difficulty
EasyConventions
- # - requires given command to be executed with root privileges either directly as a root user or by use of
sudo
command - $ - given command to be executed as a regular non-privileged user
Introduction
Installing an app on Android isn't always as simple as downloading it from the Play Store. In a lot of cases, especially development, the Play Store isn't an option, and you need another way to push apps to an Android device.- Details
- Nick Congleton
Objective
Connect to a VPN automatically on booth with a service.Distributions
This will work on almost any Linux distribution.Requirements
A working Linux install with root privileges and a VPN subscription.Difficulty
EasyConventions
- # - requires given command to be executed with root privileges either directly as a root user or by use of
sudo
command - $ - given command to be executed as a regular non-privileged user
Introduction
VPNs are great. They protect people from all sorts of threats and snooping online. Sometimes, they can be a real pain to set up, or the set up procedure doesn't exactly fit the way you use your computer. That's why it's a great solution to run a VPN connection as a service at startup. You don't need to remember to turn it on, and it will keep running even if you don't have a desktop environment up. Plus, it will usually run before your desktop and any of your other connections, helping to keep your data from leaking.- Details
- Nick Congleton
Objective
Play audio with VLC in Python.Distributions
This will work on any Linux distributionRequirements
A working Linux install with Python and VLC.Difficulty
EasyConventions
- # - requires given command to be executed with root privileges either directly as a root user or by use of
sudo
command - $ - given command to be executed as a regular non-privileged user
Introduction
There are plenty of ways to play audio files with Python. It really depends on your application, but the easiest way, by far, is to use the bindings for VLC to control VLC with Python, and play your files.With VLC, you don't need to worry about codecs and file support. It also doesn't require too many complicated methods, and/or objects. So, for simple audio playback, VLC is best.
- Details
- Nick Congleton
Objective
Encrypt individual files with GPG.Distributions
This will work with any Linux distribution.Requirements
A working Linux install with GPG installed or root privileges to install it.Difficulty
EasyConventions
- # - requires given command to be executed with root privileges either directly as a root user or by use of
sudo
command - $ - given command to be executed as a regular non-privileged user
Introduction
Encryption is important. It's absolutely vital to protecting sensitive information. Your personal files are worth encrypting, and GPG provides the perfect solution.Install GPG
GPG is a widely used piece of software. You can find it in nearly every distribution's repositories. If you don't have it already, install it on your computer.Debian/Ubuntu
$ sudo apt install gnupg
Fedora
# dnf install gnupg2
Arch
# pacman -S gnupg
Gentoo
# emerge --ask app-crypt/gnupg
Create a Key
You need a key pair to be able to encrypt and decrypt files. If you already have a key pair that you generated for SSH, you can actually use those here. If not, GPG includes a utility to generate them.$ gpg --full-generate-keyGPG has a command line procedure that walks you through the creation of your key. There is a much more simplified one, but it doesn't let you set key types, sizes or expiration, so it really isn't the best.
The first thing GPG will ask for is the type of key. Use the default, if there isn't anything specific that you need.
The next thing that you'll need to set is the key size.
4096
is probably best. After that, you can set an expiration date. Set it to
0
if you want the key to be permanent. Then, it will ask you for your name.
Finally, it asks for your email address.
You can add a comment if you need to too.
When it has everything, GPG will ask you to verify the information.
GPG will ask if you want a password for your key. This is optional, but adds a degree of protection. As it's doing that, GPG will collect entropy from your actions to increase the strength of your key. When it's done, GPG will print out the information pertaining to the key you just created.
Basic Encryption
Now that you have your key, encrypting files is very easy. Create a blank text file in your/tmp
directory to practice with. $ touch /tmp/test.txtTry encrypting it with GPG. The
-e
flag tells GPG that you'll be encrypting a file, and the -r
flag specifies a recipient. $ gpg -e -r "Your Name" /tmp/test.txtGPG needs to know who is going to be opening the file and who sent it. Since this file is for you, there's no need to specify a sender, and you are the recipient.
Basic Decryption
You have an encrypted file. Try decrypting it. You don't need to specify any keys. That information is encoded with the file. GPG will try the keys that it has to decrypt it.$ gpg -d /tmp/test.txt.gpg
Sending A File
Say you do need to send the file. You need to have the recipient's public key. How you get that from them is up to you. You can ask them to send it to you, or it may be publicly available on a keyserver.Once you have it, import the key into GPG.
$ gpg --import yourfriends.keyThat key will have their name and email in it, just like the one you made. Remember that in order for them to be able to decrypt your file, they need your public key too. Export it, and send it to them.
gpg --export -a "Your Name" > your.keyYou're ready to encrypt your file for sending. It's more-or-less the same as before, you just need to specify that you're the one sending it.
$ gpg -e -u "Your Name" -r "Their Name" /tmp/test.txt
Closing Thoughts
That's mostly it. There are some more advanced options available, but you won't need them ninety-nine percent of the time. GPG is that easy to use. You can also use the key pair that you created to send and receive encrypted email in much the same way as this, though most email clients automate the process once they have the keys.- Details
- Nick Congleton
Objective
Consume a JSON API in Python.Distributions
This will work on any Linux distribution.Requirements
A working Linux install with Python.Difficulty
EasyConventions
- # - requires given command to be executed with root privileges either directly as a root user or by use of
sudo
command - $ - given command to be executed as a regular non-privileged user
Introduction
One of the main reasons that you'd like to work with JSON in Python is consuming APIs. There are hundreds of excellent public APIs out there and ready to use in your application. Even huge players on the web, like Facebook and Twitter, out out APIs for you to work with.You can build entire applications around API data, including building web applications that aggregate, manipulate, and display that data in a convenient way.