You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🤠
herding cats
Evan Gray
evanscottgray
🤠
herding cats
Software Engineer, packet picker-upper, and professional cat wrangler. Sometimes, I get to write code - a rare but celebrated event.
This is a basic step by step intro to working with Docker containers and Images. You should be able to follow along with your installation of docker, but be sure to change IDs/naming schemes according to your use case.
The goal of this exercise is to create a base image from the ubuntu base image that has both the jre and htop installed.
Start up an ubuntu container to modify, install htop, then exit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mosh (mobile shell) is a gift from the Gods(tm). Anyone with spotty internet or wireless connection has suffered the pain of a lost SSH session. Sure, one can fire up screen (or tmux as the kids are using these days), but that's an extra step and you are still using the SSH protocol.
I'm not here to tout the benefits of Mosh, you came here to open it up in your firewall.
Create the following file as /etc/firewalld/services/mosh.xml
firewall-cmd --add-service=mosh --permanent
firewall-cmd --reload
If you tend to have a lot of sessions (not recommended), you can increase the ports, but the default should be fine for most applications.
My Fake Coffee Shop -or- Local Audience Twitter Favoriting
Today I made the decision to shut down King's Cross Coffee, the potentially-popular coffee shop that existed only in the hearts and minds of coffee-drinking Ann Arborites. I decided to shut it down because people were actually going there. It didn't seem fair, and I'd proved my point.
I'd been experimenting with the concept of automatically favoriting tweets from a local audience as a way of driving traffic. I set up a product called LocalFavorite which takes a search term and location range and favorites 3 tweets each hour.
The Experiment
Can a brand with no real-world presence build a legitimate following by Twitter favorites alone?
To control my variables, I created the Twitter account @KingsCrossCafe, a realistic-looking coffee shop in Ann Arbor, MI. I gave it a few photos, a real address, a bit.ly link, and posted a few tweets. Then I began automatically favoriting anyone in the Ann Arbor area that mentions 'coffee' or being 'tired'.
As of version 3.3, python includes the very promising concurrent.futuresmodule, with elegant context managers for running tasks concurrently. Thanks to the simple and consistent interface you can use both threads and processes with minimal effort.
For most CPU bound tasks - anything that is heavy number crunching - you want your program to use all the CPUs in your PC. The simplest way to get a CPU bound task to run in parallel is to use the ProcessPoolExecutor, which will create enough sub-processes to keep all your CPUs busy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wrapper library to use /dev/null as a service on Linux via LD_PRELOAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters