Welcome to thatlinuxbox.com Wednesday, July 26 2017 @ 08:49 pm EDT

Python requests urllib3 SSL warning

View Printable Version
  • Tuesday, June 06 2017 @ 01:36 pm EDT
  • Contributed by:
  • Views: 214
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

My Linux development computers are still running Ubuntu 14.04 which includes Python 2.7.

One of the libraries I commonly use to access websites or APIs from Python is "Requests: HTTP for Humans". Requests in turn leverages urllib3.  The following warning began popping up a while ago when making requests to SSL sites:

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

The solution is actually quite simple (especially if one is developing in a virtual environment), using pip install with the extra bits including the brackets:

$ pip install urllib3[secure]

From: 

https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2

 

If you aren't developing in a python virtual environment... start developing in a pyton virtual environment! I suggest virtualenvwrapper over vanilla virtualenv.

https://virtualenvwrapper.readthedocs.io/en/latest/

 

Screenshots of ARK: Survival Evolved on Linux

View Printable Version
  • Monday, January 16 2017 @ 08:03 pm EST
  • Contributed by:
  • Views: 603
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

ARK: Survival Evolved is a (currently Early Access) game that works natively on Linux and is available thru Steam. It combines aspects of survival, crafting and FPS (First Person Shooter) games with... dinosaurs! It can be addictive and also can be loads of fun. And DINOSAURS!

Here is my desktop hardware, with the graphics card a new purchase at the start of 2017.

Ubuntu 14.04
Intel i3-2105 CPU @ 3.10GHz
ZOTAC NVIDIA GeForce GTX 1070 graphics card
NVIDIA Driver Version: 375.26
monitor native resolution: 1920 x 1080


Rex vs. hatchet. Luckily, the T-Rex was already tamed.


Here are some more screenshots...

How to Install Minecraft Mods on Linux

View Printable Version
  • Thursday, August 18 2016 @ 03:05 pm EDT
  • Contributed by:
  • Views: 4,185
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

See the "Additional Notes" section near the bottom of this article for more info on installing and running the java version of Minecraft on Linux.

The first thing I noticed when I started looking at Minecraft mods is dependencies. One major dependency to note is the Minecraft version. At the time of this writing the current version of Minecraft is 1.10.x. Many mods required older versions. For example, to run the OreSpawn mod you need to use Minecraft 1.7. Also, you must first install something called Minecraft Forge (minecraftforge.net) or just "Forge" for short, and it must be the version of Forge that matches the specific version of Minecraft you need to run (as required by the mod). 

I found the following video helpful since many of the online howtos are either terrible or written for older versions of Minecraft. For example, they talk about modifying the minecraft.jar and files in the .minecraft/bin directory, neither of which exist in recent versions of Minecraft. I learned from the video that installing Forge and compatible mods is actually embarassingly easy. There is no unzipping or modifying .jar files or deleting META_INF from inside archives, etc.

Here is a summary of the steps that I use to install Minecraft mods on Linux:

1. Download and Run the Forge Installer 

In my case I want to run mods that are compatible with Minecraft 1.7. So I locate and download the "installer" from Forge that matches the desired version.

Beware, the free file hosting sites where the actual downloads live try to trick you in a dozen ways to click on something other than your actual file download.

Once downloaded, we need to "run the jar".  On my computer, clicking a .jar file does not execute it (it opens it like an archive instead), so I just run the jar file from the command line which will start the graphical installer.

$ java -jar forge-1.7.10-10.13.4.1558-1.7.10-installer.jar

2. Run Minecraft to verify Forge is properly installed

There should now be a profile named "Forge" available in the lower left list of profiles.  Start Minecraft using the "Forge" profile.

Forge will do some work.

After Minecraft loads at least once with Forge installed, it is ok to install the actual mods. Exit Minecraft.

3. Download and install mods

Download the mods and place them in the .minecraft/mods directory. Other than being very careful to download a legitimate mod file and navigating the download sites carefully... that's it! The mod files that go into "mods" may be either .zip or .jar format.

4. Run Minecraft with the new mods installed

Again start Minecraft and choose the "Forge" profile. Forge will notice the new files in the mods directory and do some additional work to prepare them:

Once Minecraft starts there will be evidence of loaded mods in the bottom left:

 

Release v1.3 of my dailymile_export tool

View Printable Version
  • Friday, June 17 2016 @ 08:48 pm EDT
  • Contributed by:
  • Views: 569
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

Announcing v1.3 of my dailymile export tool

In this most recent release of dailymile_export I have updated the Python version to grab extended information for each entry.

The download bundle is available:

https://github.com/danstoner/dailymile_export/releases

The basic usage info of the python script:

$ python dailymile_export_to_tsv.py --help

usage: dailymile_export_to_tsv.py [-h] [-d] [-e] [-m MAXPAGES] [-w] USERNAME

Script to download entries from the dailymile API for a particular user into a
tab-delimited file.

positional arguments:
  USERNAME              The dailymile.com username of the account to export.

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug level logging.
  -e, --extended        Retrieve extended info for each entry. Extended gear
                        includes Effort, Gear, Weather, and Calories. Tthis
                        will SIGNIFICANTLY impact performance since every
                        single entry will require an additional web request
                        (extended data is not available via the API). Posts
                        must not be set to private in dailymile.
  -m MAXPAGES, --maxpages MAXPAGES
                        Maximum number of API requests to make (to limit http
                        requests during testing)
  -w, --disablewarnings
                        Disable urllib3 warnings.

 

Read below for execution samples and excerpt from the output file.

Full output file samples are available in the "output_files" directory of the project.

The github repo for the project is located:

https://github.com/danstoner/dailymile_export

If my dailymile export tool is useful to you, or you have suggestions or feedback, please submit a github issue.

 

Write in Markdown and use pandoc to generate documents

View Printable Version
  • Tuesday, August 25 2015 @ 08:22 am EDT
  • Contributed by:
  • Views: 1,240
Linux, Open Source, and Tech Stuff

Share
  • Google Plus
  • Facebook
  • Twitter
  • Reddit
  • LinkedIn
  • Digg

The last time I updated my resume I decided that it needed some major revisions. I didn't want to use a WYSIWYG editor anymore and I wanted to start tracking changes to my resume with git. After looking at various plain text file formats and markup options, and even though I have a fondness for the txt2tags syntax, I decided on Markdown. For better or worse, and I suspect due mostly to the popularity of GitHub, Markdown has become a de facto standard syntax for geeks writing documents that other people might read.

With Markdown as a source format I experimented with pandoc - a universal document converter to generate output files.

With the pandoc workflow, it is possible to write a document in plain text and then generate other types of documents such as HTML, Word processor formats (Microsoft Word docx) and PDF (via LaTeX).

So for people who insist on having a resume in Comic Sans:

or perhaps Game of Thrones is more your style (via the Artificial Uncial font):

pandoc has you covered.

The most challenging thing was figuring out the names of the fonts available, the packages needed to use them with pandoc, and the pandoc command-line syntax for activating them.

I gathered my notes and sample outputs in a github repo:

https://github.com/danstoner/pandoc_samples

I can spit out a new PDF of my resume by editing the Markdown source in my favorite text editor (emacs), commiting the changes to git, and running one command:

$ pandoc --latex-engine=xelatex -V geometry=margin=.75in -V mainfont="TeX Gyre Heros" -o danstonerresume.pdf danstonerresume.md

 

First | Previous | 1 234567| Next | Last

User Functions

Login

Connect

thatlinuxbox.com is the home of Dan Stoner's Personal Blog, Photos, and More (opinions, rants, techno-babble, and possibly a few useful tidbits of knowledge).

Questions or Comments about this site? Contact danstoner _ at _ gmail.com.

RSS Feed for this blog

Other places to find me on the web:

Twitter

LinkedIn

dailymile

GitHub

Visit Dan Stoner's profile on Pinterest.

Support This Site

If you like something that you find on this site, please consider making a purchase through one of the links below or sending me an item from my Amazon Wish List.


If you can't speak for yourself, your Road ID will.


Altra Zero Drop Footwear
10% Off and Free Shipping!

10% Off and Free Shipping!
(Discounts will become visible during Checkout)


The Clymb


Awesome VPS hosting by Linode.com