Archive

Category Archives for "Ethan Banks"

How To Work With A Sponsor For Your IT Blog

For many years, I’ve been working with B2B IT vendors who sponsor content with my company to market their offerings. My co-founder and I have learned many lessons–some the hard way–about dealing with these vendors and the content they create with us.

In this article, I’ll focus on handling a specific scenario. You’ve got a niche blog where you write as a deeply technical expert in a IT field such as cloud, networking, storage, development, or security. Your audience is made up of fellow nerds in similar orbits. You’ve been writing for years, and have developed a faithful audience who reads most of your stuff. After all this time, a real-deal vendor appears, wanting to place a sponsored blog post on your hallowed site. Now what?

You might think the sponsored content itself would be the most complicated part, and that once you hit publish, you’re mostly done. Not really. Back end logistics will likely take up more of your time. There are other considerations, too. Consider them carefully before trying to monetize your blogging hobby.

Mark Sponsored Content As Sponsored

If this is your first sponsored post, you might feel weird about it. The temptation can be to hide Continue reading

How To Use Grep + Regex To Match Non-200 HTTP Status Codes In Apache Server Logs

When parsing Apache web server logs on Linux, I find it interesting to monitor access requests resulting in HTTP status codes other than 200s. An HTTP status code in the 200s mean the request was successful, and hey–that’s boring.

I want to see the requests that my dear Apache instance is upset about. So the question becomes…how do I filter the logs to show me every entry that doesn’t have a status code in the 200s?

Let’s back our way into this. We’ll start with the answer, then explain how we got there.

The Answer

This CLI incantation will get the job done.

sudo grep -E '\" [1345][01235][0-9] [[:digit:]]{1,8} \"' /var/log/apache2/access.log

If you’d like to watch the log entries scroll by in real time, try this.

sudo tail -f /var/log/apache2/access.log | grep -E '\" [1345][01235][0-9] [[:digit:]]{1,8} \"'

Comprehending The Regex

Let’s focus on the regular expression (regex) grep is using to find the matches. In plain English, the grep utility is using an extended -E regex to display all lines in the file /var/log/apache2/access.log matching the regex.

The regex portion of the command is as follows.

'\" [1345][01235][0-9] [[:digit:]]{1,8} \"'

The regex is enclosed in single quotes Continue reading

Can Fantastical Openings Replace Calendly?

TL;DR

Fantastical Openings can’t replace Calendly for my scheduling needs yet, but it’s close.

The Rest Of The Story

I use Calendly so that folks can schedule me for appointments. I send people a Calendly link, and they choose an available time slot. Calendly creates calendar invitations and sends them to me and the requestor. Calendly also integrates with Zoom, so that an invite comes with a Zoom meeting already attached.

In my years of Calendly use, I’ve found it to be…

  • Reliable. It just works.
  • Flexible. The availability rules engine allows me to configure conditions such as “leave a gap of X minutes between appointments” that I rely on to keep my calendar sane.
  • Expensive. $144/year for the features I need.

I also use Fantastical by Flexibits. In my few months as a Fantastical user, I’ve found it to be…

  • Beautiful. It’s the best calendaring interface of anything I’ve tried.
  • Integrated. I use Fantastical to integrate with multiple calendars, Zoom, and the Todoist task manager. I use Fantastical both on my Mac and iOS devices.
  • A super power. Fantastical happens to be highly compatible with how I work. I am more productive with Fantastical.
  • Affordable. $40/year for the features Continue reading

Career Advice I’d Give To 20, 30 and 40-Something Year Old Me

Career Advice To 20-Something Year Old Me

Start that business. You have sufficient technical & business skills, and you can figure out what you don’t know. Take the chance now while you have little at risk.

You’re not the standard everyone else is supposed to live up to. Work on your own faults. They are legion.

Your boss is your boss for a reason. You’re not the boss for a reason, too. When you understand and accept those reasons, you’ll reduce the workplace friction you keep experiencing.

Meritocracy doesn’t mean what you think it means. Being good at your job doesn’t mean you deserve a promotion.

More responsibility comes easy, because no one wants it. More compensation comes hard, because everyone wants it.

Business owners who cheat their partners & customers will cheat their employees, too. Run at the first sign of dishonest business dealings.

Career Advice To 30-Something Year Old Me

Define your goals so you know when you’ve reached them. Otherwise, you’ll exhaust yourself with endless effort.

You are your own worst critic. Take yourself less seriously.

When you work for someone else, you are a replaceable component in a larger machine. This is by design.

You don’t Continue reading

How To Fix Ubuntu 18.04 ‘apt update’ Throwing An NGINX Repository i386 Package Error

When running ‘apt update’ on Ubuntu 18.04 to prepare for routine system patching, the system kicked back the following error.

N: Skipping acquire of configured file 'nginx/binary-i386/Packages' as repository
'http://nginx.org/packages/ubuntu bionic InRelease' doesn't support architecture 'i386'

The issue is that the existing sources list file for NGINX has gone stale, and appears to be requesting the i386 package. NGINX does not support i386 on Ubuntu 18.04 (Bionic). The solution is to update the sources list file for NGINX.

OLD /etc/apt/sources.list.d/nginx.list

deb http://nginx.org/packages/ubuntu bionic nginx

NEW /etc/apt/sources.list.d/nginx.list

deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu/ bionic nginx

After this change, the error should be gone when running ‘apt update’.

For More Information

NGINX Linux Packages

NGINX update issue (Ubuntu 18.04 Bionic) – Vesta Control Panel Forum

Ubuntu Server 18.04 Nginx i386 – StackOverflow

How To Create A Python Function You Can Call From Other Scripts

Python gives you the ability to write a bit of code and the call that code as a function. You can call the function from within the same script where the function is defined, or you can save the function in a separate script and then import the function inside of other scripts.

Writing and calling functions is a key component of the Don’t Repeat Yourself (DRY) principle of software development. Creating a function in a single script and calling that function from other scripts is preferable to performing copypasta of the same bit of code throughout several scripts. When a function lives in a single script, it only needs to be updated in that one place when it inevitably needs updating.

While Python functions can perform isolated tasks, my typical use cases send values into the function and receive a value returned from the function. In this example, I’ll import a Python function used to refresh an access token required to authenticate to a remote API endpoint. I’ll pass other tokens required to refresh the access token into the function, and the function will return the refreshed access token back to the calling script.

The Function

The names of Continue reading

How To Blackhole (Null Route) An IPv6 Block On Linux Using ‘ip -6 route’

If there’s an IPv6 netblock you’d like your host to stop responding to, one tactic is to blackhole the traffic. That is, send any traffic from your host destined to the troublesome IPv6 netblock into a blackhole. Blackholes are also called null routes.

A Simple Example

Let’s say I’m getting repeated SQL injection attacks from various hosts in IPv6 block 2a09:8700:1::/48. Just a totally random example with no basis in reality whatsoever, whoever you are in Belize. 🙄 There are various ways I can defend against this, but one (sorta ugly) option (I don’t actually recommend, read to the bottom to see my logic) is to create a blackhole aka a null route.

On many flavors of Linux, including Ubuntu 18.04, 20.04, and 22.04, I can accomplish this task with the ip route utility. Let’s take a look at our existing host routing table.

[email protected]:~$ ip route
default via 123.94.146.1 dev enp1s0 proto dhcp src 123.94.146.227 metric 100
169.254.169.254 via 123.94.146.1 dev enp1s0 proto dhcp src 123.94.146.227 metric 100
123.94.146.0/23 dev enp1s0 proto kernel scope link src 123.94.146. Continue reading

What Does An ‘R’ Before A String Mean In Python?

R Means ‘Raw String’

An ‘r’ before a string tells the Python interpreter to treat backslashes as a literal (raw) character. Normally, Python uses backslashes as escape characters. Prefacing the string definition with ‘r’ is a useful way to define a string where you need the backslash to be an actual backslash and not part of an escape code that means something else in the string.

Examples

1. In this example, Python will interpret each ‘\t’ found in this string as a tab. That is, the backslash+t is interpreted as an escape sequence with a special purpose.

>>> 'path\to\the\thing'
'path\to\the\thing'
>>> print('path\to\the\thing')
path o he hing
>>>

2. By adding the leading r, Python will know that the backslashes are to be interpreted as literal characters and not escape sequences. Interestingly, note how Python represents the literal backslash–as an escape sequence of backslash + backslash.

>>> r'path\to\the\thing'
'path\\to\\the\\thing'
>>> print(r'path\to\the\thing')
path\to\the\thing
>>>

3. This means another way to handle the literal backslash problem is to use backslash + backslash in your string definition. However, this feels like a clunkier way to define the string to me when compared to using ‘r’. Using ‘r’ makes for, I think, more readable Continue reading

Podcast Guest: Can You Have A Successful IT Career Without A Degree?

I was a guest on the February 22, 2022 episode of the So You Wanna Be In IT podcast.

Certifications

I chatted with hosts Pat & Dean about how my career got started. I’ve been around IT since the 90s, so my start was with Novell certification that became Microsoft certification that became Cisco certification. We talk about certs and the job opportunities I took advantage of driven by those certs.

Can You Have A Successful IT Career Without A Degree?

Along the way, we discussed whether or not someone can have a successful IT career without a college degree. Put another way, are IT certifications good enough? I think that yes, you can have a successful IT career without a degree, but that the question, “College degree. Yes or no?” deserves more analysis than a simple yes or no answer offers. Like anything, choosing not to attend university has tradeoffs. We discuss this at some length in the podcast.

What IT Roles Are In Demand In 2022?

The degree vs. certifications part of the discussion transitioned into my takes on IT careers in 2022–especially related to infrastructure. 2022 is an interesting time to be in IT. There are Continue reading

How To Pass Environment Variables To A Remote SSH Deployment With PyCharm

I pass access tokens, authentication keys, and other secrets to Python scripts via environment variables rather than encode these values into the scripts themselves. If I was a real boy, I’d use a solution like Hashicorp Vault or other secrets management tool (there’s a bunch of them), but I haven’t yet found the motivation to learn such a tool.

I’m not sure I’d want to build and maintain such a tool if I did find the motivation. I’m sort of lazy sometimes is what I’m saying. So for now, environment variables it is.

PyCharm allows for the passing of environment variables from the IDE to a script, whether that script is running locally or in a remote SSH deployment you’ve configured for your project.

To set the environment variables, select Edit Configurations from the Run menu.

Or in the project bar above the code window, click the dropdown with your script name, and select Edit Configurations.

Either way brings up the following configuration window for the scripts in your project. In the Environment variables: field, click the icon.

That will bring up the following window you can use to configure the environment variables.

Fantastic. But how do we assign the Continue reading

How To Pass API Query Parameters In A Curl Request

If you’re using CLI tool curl to retrieve data from a remote API, you might send forth a command like so.

curl -H "Authorization: Bearer access_token_goes_here" \
  https://api.provider.com/thing/you_want/index.json

That results in a lovely JSON payload that makes you happy.

Let’s say that according to the API documentation, /thing/you_want/ accepts query parameters so that you can scope what you want to know about. Excellent! Instinctively, you try the following…

curl -H "Authorization: Bearer access_token_goes_here" \
  https://api.provider.com/thing/you_want/index.json?scope=1

Rather than a scoped JSON payload that also makes you happy, you get back a message indicating that the API endpoint is displeased. Your sacrifice was deemed unworthy. Nay, YOU are unworthy. You are decidedly not happy.

What has gone wrong to anger the API gods so? You asked the wrong question of the API. More accurately, curl hasn’t formatted the request in quite the way you intuited it would.

To appease the API deities, the appropriate sacrifice comes in the form of a tweaked curl command. For example…

curl -G -H "Authorization: Bearer access_token_goes_here" \
  https://api.provider.com/thing/you_want/index.json \
  -d "query=scope=1"

We added a “-G” flag to make sure curl is sending a GET and not Continue reading

They’ll Remember The Rage Monster

I was tired. Very tired. Tired in my brain. Tired in my body. I needed to eat, puke, and scream…all of those things as soon as possible. Big cutovers are like that. You know the kind of change I’m talking about. The kind where you only get a maintenance window twice a year, so you plan to throw in the new core switch pair because that’s easy, re-tool the BGP peering that twelve other changes are waiting for, and bring up the new firewall all in one night.

Stupid! Unthinkable! Small changes only!! I mean…obviously. Of course. But sometimes, that’s just not the way it works out. And so it was that after several hours of executing a meticulously planned change that would create the network foundation for the company’s big plans, I needed to eat, puke, and scream.

You see, the change hadn’t got entirely well. It had only gone mostly well. The core switch upgrade really was easy. The BGP peering work went well enough. The new firewall was a fight, though.

At first, the firewall pair wouldn’t pass traffic. At all. Despite a lovely routing table and so on. After sitting in the freezing data center for Continue reading

The Best Technologists First Try To Solve Their Own Problems

Every once in a while, I get questions from random internet folks who want me to do their homework for them. They want me to provide them with detailed technical information, solve their complex design problem, or curate content on a difficult topic so that they don’t have to do the sifting.

While I like to help folks out as much as anyone (and often do), I usually ignore these sorts of questions. Why? Partly, I don’t have enough time to fix the internet. Partly, I like to get paid for consulting. But more importantly, the best technologists first try to solve their own problems.

A Manager’s Perspective

When interviewing candidates for technical positions, one of my questions is, “If you run into a problem you’ve never faced before, how do you solve it?” There are two typical answers.

  1. “I’ll ask someone else for help. Probably you.”
  2. “I’ll search the internet, company wiki, and product documentation. I’ll set up a lab. If I’m still stuck, I’ll ask for help.”

I prefer to hire a person who first tries to figure things out. While I want neither a cowboy nor science experiments making their way into production, I Continue reading

How IT Pros Learn Online In 2021

I surveyed 53 IT professionals about online IT training in August 2021. Most of the folks I interact with are networking & cloud infrastructure professionals, and the answers reflect that. 53 responses isn’t enough to draw hard and fast conclusions from, but I still believe there are interesting trends & individual comments worth thinking about.

By the way, if you’d like to submit your own responses, I left the survey open. I told Google Forms to not collect email addresses, so your responses are anonymous.

1. Which online learning sites do you have a subscription to or have bought an IT course from?

  1. Udemy – 32
  2. Pluralsight – 24
  3. INE – 19
  4. A Cloud Guru – 16
  5. CBT Nuggets – 12
  6. Coursera – 9
  7. O’Reilly / Safari – 7
  8. ITProTV – 4
  9. LinkedIn Learning / Lynda – 3
  10. Juniper Learning Portal – 2
  11. Pearson – 2
  12. Skillshare – 2
  13. Adrian Cantrill – 1
  14. Cisco Learning Network – 1
  15. Global Knowledge – 1
  16. Ivan Pepelnjak – 1
  17. KBITS – 1
  18. Kirk Byers – 1
  19. Routehub – 1
  20. Skillsoft – 1
  21. TalkPython – 1
  22. Teachable – 1
  23. YouTube – 1

I believe Udemy is so popular because it’s a great platform to Continue reading

What Makes A Senior IT Engineer “Senior”?

Ravi asks the following…

I’m trying to figure out what makes a network engineer truly a “senior” engineer. What skills, mostly non-technical, do they possess in order to bring value to the work place?

I’ll share my opinions based on my experience having held junior and senior IT engineering roles, as well as multiple managerial stints with engineers as direct reports. I’m mostly going to address IT engineering broadly rather than networking specifically, as my opinion is the same no matter which tech silo an engineer might hail from.

Technical Skills

As Ravi asked about “mostly non-technical” skills, I’ll be brief here. From a technical perspective, I believe a senior IT engineer is primarily differentiated from a junior in one word–experience. The senior engineer has installed more systems, planned more changes, fixed more problems, and survived more outages than a junior engineer in the same organization.

Ideally, that experience has led to wisdom about how technology can best serve the business needs of an organization. This wisdom will tend to eschew needlessly complex designs, nerd knobs, and “science experiments” conducted in production. This wisdom will also result in difficult problems being resolved more quickly. Experienced folks know somewhat instinctively Continue reading

How Upgrading PHP On WordPress Became *It Was DNS*-An IT Operations Tale

The server needed a PHP update. WordPress told me so with a severe-sounding notification adorned with red coloration, a security warning, boldface type, and a link explaining how to change the PHP version. I sighed. Security issues never end, and I have a recurring reminder in my todo list to patch the Virtual Private Server (VPS) boxes I shepherd.

But this PHP issue…hmm. This felt like a bigger deal, and many sites I support lean heavily into WordPress. Rather than wait for the next regular patching session, I decided to get on it. I did a process test on one server, a lower profile machine that wouldn’t hurt too much if things went awry. The goal was to move from PHP 7.2.insecure to PHP 7.4.secure. How hard could it be?

Most of the search engine hits for “upgrade PHP on WordPress” told me to go into CPanel or a similar tool my hosting provider might offer to abstract what’s going on with the server itself. That’s not what I was looking for, because I manage my own hosts. I needed to know how to reconfigure the host itself. The OS packages to install. The conf files Continue reading

Born In The Cloud Enterprise Case Study With Tekion – Packet Pushers LiveStream With Alkira (Video 2)

Tekion builds cloud-based applications for the automotive retail industry. The company uses Alkira’s cloud networking product to connect a network of automobile dealerships to an array of cloud-hosted services. In this video, the Packet Pushers’ Ethan Banks talks to Tekion’s Jamie Fox. They discuss how the Alkira platform enables Tekion to leverage multiple clouds with […]

The post Born In The Cloud Enterprise Case Study With Tekion – Packet Pushers LiveStream With Alkira (Video 2) appeared first on Packet Pushers.

Is Sticking With A Networking Vendor As Risky As Changing?

The networking industry has had a bumper crop of startup companies including a few unicorns, new and novel solutions, and fresh standards-driven tech in the last decade. There’s been enough churn that you’d think the landscape would be unrecognizable from what it was ten years back. And yet, a dominant vendor supplying networks to enterprises remains Cisco.

Data networking folks sometimes wonder why Cisco remains such a dominant force after all these years. With all the churn in the industry, with all the fancy new products, companies and approaches, with the cloud changing how computing is done, and with software eating the world, there are many more options than Cisco to meet networking needs. Of course, Cisco has always had competition. Cisco’s never gotten 100% of the pie, but, depending on market segment, there’s rarely been a second juggernaut in the enterprise networking space. The choice has typically been between Cisco and everyone else.

But in 2021, the networking market is increasingly fragmented with more startups than I’ve even heard of chasing after slivers of the diverse networking pie. Sure, that impacts Cisco. Still, Cisco tends to dominate, even if their share isn’t quite what it was depending on which Continue reading

Learning In Public Helps Everyone

The tradition of technology blogging is built on the idea of learning in public, something Matt’s encouraging with Red Hat’s Enable Architect blog linked in his tweet above. We encourage it at Packet Pushers, too. We think everyone has at least one blog post in them worth sharing with the community. Let us know, and we’ll set you up with an author account.

Starting a blog, especially for the technically savvy, is not overly difficult, though. Maybe Matt and I are hoping to make it even easier to share by offering our platforms, but I don’t think the time it takes to stand up a blog is necessarily the barrier.

I think the biggest barrier is the “in public” part. Architects and engineers tend to be introverts who are at times unsure of themselves. We don’t want to be learning in public. We want to be left alone to figure it out. When we’ve figured it out, maybe then will we share, once we’re supremely confident that we’ve got it 110% right. We just don’t Continue reading

If You Haven’t Checked Your Backups, They Probably Aren’t Working

This is a pleasant reminder to check your backups. I don’t mean, “Hey, did the backup run last night? Yes? Then all is well.” That’s slightly better than nothing, but not really what you’re checking for. Instead, you’re determining your ability to return a system to a known state by verifying your backups regularly.

Backups are a key part of disaster recovery, where modern disasters include ransomware, catastrophic public cloud failures, and asset exposure by accidental secrets posting.

For folks in IT operations such as network engineers, systems to be concerned about include network devices such as routers, switches, firewalls, load balancers, and VPN concentrators. Public cloud network artifacts also matter. Automation systems matter, too. And don’t forget about special systems like policy engines, SDN controllers, wifi controllers, network monitoring, AAA, and…you get the idea.

Don’t confuse resiliency for backup.

When I talk about backups, I’m talking about having known good copies of crucial data that exist independently of the systems they normally live on.

  • Distributed storage is not backup.
  • A cluster is not backup.
  • An active/active application delivery system spread over geographically diverse data centers is not backup.

The points above are examples of distributed computing. Distributed computing Continue reading

1 2 3 11