Python – Kirk Byers Course Week 4 Part 3

This post will describe the exercises and solutions for week four of Kirk Byers Python for Network Engineers.

The final exercise of week 4 is the following.

III. Create a program that converts the following uptime strings to a time in seconds.
uptime1 = 'twb-sf-881 uptime is 6 weeks, 4 days, 2 hours, 25 minutes'
uptime2 = '3750RJ uptime is 1 hour, 29 minutes'
uptime3 = 'CATS3560 uptime is 8 weeks, 4 days, 18 hours, 16 minutes'
uptime4 = 'rtr1 uptime is 5 years, 18 weeks, 8 hours, 23 minutes'

For each of these strings store the uptime in a dictionary using the device name as the key.

During this conversion process, you will have to convert strings to integers.  For these string to integer conversions use try/except to catch any string to integer conversion exceptions.

For example:
int('5') works fine
int('5 years') generates a ValueError exception.

Print the dictionary to standard output.

The first step is to import pretty print which we will use to print the dictionary.

# Import pretty print
import pprint

To do the conversion from years, weeks and days to seconds, we are going to need some constants. Constants are usually defined with the variable Continue reading

US faces limits in busting Russian agents over Yahoo breach

In a rare move, the U.S. has indicted two Russian government agents for their suspected involvement in a massive Yahoo data breach. But what now? Security experts say Wednesday’s indictment might amount to nothing more than naming and shaming Russia. That’s because no one expects the Kremlin to play along with the U.S. indictment. “I can’t imagine the Russian government is going to hand over the two FSB officers,” said Jeremiah Grossman, chief of security strategy at SentinelOne. "Even in the most successful investigations, state hackers are still immune from prosecution or retaliation," said Kenneth Geers, a research scientist at security firm Comodo.To read this article in full or to leave a comment, please click here

US faces limits in busting Russian agents over Yahoo breach

In a rare move, the U.S. has indicted two Russian government agents for their suspected involvement in a massive Yahoo data breach. But what now? Security experts say Wednesday’s indictment might amount to nothing more than naming and shaming Russia. That’s because no one expects the Kremlin to play along with the U.S. indictment. “I can’t imagine the Russian government is going to hand over the two FSB officers,” said Jeremiah Grossman, chief of security strategy at SentinelOne. "Even in the most successful investigations, state hackers are still immune from prosecution or retaliation," said Kenneth Geers, a research scientist at security firm Comodo.To read this article in full or to leave a comment, please click here

Inside the Russian hack of Yahoo: How they did it

One mistaken click. That's all it took for hackers aligned with the Russian state security service to gain access to Yahoo's network and potentially the email messages and private information of as many as 500 million people.The U.S. Federal Bureau of Investigation has been investigating the intrusion for two years, but it was only in late 2016 that the full scale of the hack became apparent. On Wednesday, the FBI indicted four people for the attack, two of whom are Russian spies.Here's how the FBI says they did it:The hack began with a spear-phishing email sent in early 2014 to a Yahoo company employee. It's unclear how many employees were targeted and how many emails were sent, but it only takes one person to click on a link, and it happened.To read this article in full or to leave a comment, please click here

Inside the Russian hack of Yahoo: How they did it

One mistaken click. That's all it took for hackers aligned with the Russian state security service to gain access to Yahoo's network and potentially the email messages and private information of as many as 500 million people.The U.S. Federal Bureau of Investigation has been investigating the intrusion for two years, but it was only in late 2016 that the full scale of the hack became apparent. On Wednesday, the FBI indicted four people for the attack, two of whom are Russian spies.Here's how the FBI says they did it:The hack began with a spear-phishing email sent in early 2014 to a Yahoo company employee. It's unclear how many employees were targeted and how many emails were sent, but it only takes one person to click on a link, and it happened.To read this article in full or to leave a comment, please click here

Inside the Russian hack of Yahoo: How they did it

One mistaken click. That's all it took for hackers aligned with the Russian state security service to gain access to Yahoo's network and potentially the email messages and private information of as many as 500 million people.The U.S. Federal Bureau of Investigation has been investigating the intrusion for two years, but it was only in late 2016 that the full scale of the hack became apparent. On Wednesday, the FBI indicted four people for the attack, two of whom are Russian spies.Here's how the FBI says they did it:The hack began with a spear-phishing email sent in early 2014 to a Yahoo company employee. It's unclear how many employees were targeted and how many emails were sent, but it only takes one person to click on a link, and it happened.To read this article in full or to leave a comment, please click here

Inside the Russian hack of Yahoo: How they did it

One mistaken click. That's all it took for hackers aligned with the Russian state security service to gain access to Yahoo's network and potentially the email messages and private information of as many as 500 million people.The U.S. Federal Bureau of Investigation has been investigating the intrusion for two years, but it was only in late 2016 that the full scale of the hack became apparent. On Wednesday, the FBI indicted four people for the attack, two of whom are Russian spies.Here's how the FBI says they did it:The hack began with a spear-phishing email sent in early 2014 to a Yahoo company employee. It's unclear how many employees were targeted and how many emails were sent, but it only takes one person to click on a link, and it happened.To read this article in full or to leave a comment, please click here

The wireless spectrum sharing mover and shaker you might not know

When the CBRS Alliance introduced itself early last year as an outfit bent on promoting LTE services across shared spectrum in the 3.5 GHz band, five out of the six founding members’ names — Google, Intel, Nokia, Qualcomm and Ruckus — were familiar to those in general network technology circles. But the other member, Federated Wireless, might have drawn some blank stares from those not in the thick of the emerging Citizens Broadband Radio Service (CBRS) market. Interestingly enough, though, it was Federated that drew up the charter for this alliance of companies promoting CBRS in light of new FCC rules opening up 150 MHz of spectrum for new commercial use. What’s more, Federated Wireless CEO Iyad Tarazi, previously a VP with Sprint and Nextel, had also co-chaired the Wireless Innovation Forum, which the FCC is working with to establish standards for the CBRS band to ensure that devices used in the newly opened 3.5 GHz shared spectrum play nicely together. To read this article in full or to leave a comment, please click here

The wireless spectrum sharing mover and shaker you might not know

When the CBRS Alliance introduced itself early last year as an outfit bent on promoting LTE services across shared spectrum in the 3.5 GHz band, five out of the six founding members’ names — Google, Intel, Nokia, Qualcomm and Ruckus — were familiar to those in general network technology circles. But the other member, Federated Wireless, might have drawn some blank stares from those not in the thick of the emerging Citizens Broadband Radio Service (CBRS) market.Interestingly enough, though, it was Federated that drew up the charter for this alliance of companies promoting CBRS in light of new FCC rules opening up 150 MHz of spectrum for new commercial use. What’s more, Federated Wireless CEO Iyad Tarazi, previously a VP with Sprint and Nextel, had also co-chaired the Wireless Innovation Forum, which the FCC is working with to establish standards for the CBRS band to ensure that devices used in the newly opened 3.5 GHz shared spectrum play nicely together. To read this article in full or to leave a comment, please click here

New iPhone 8 concept photos are jaw-dropping

We're about six months away from Apple unveiling the iPhone 8 and the excitement has only continued to mount with each passing month. Of course, the big rumor surrounding Apple's next-gen iPhone is that it will feature an edge to edge display. In turn, it's widely believed that Apple has figured out a way to embed the Touch ID sensor into the display itself, though as we'll get into later, the iPhone 8 release date may not actually happen until November.That said, the main reason why everyone is so excited about the iPhone 8 is because Apple hasn't updated the current iPhone form factor since 2014's iPhone 6. Consequently, many current iPhone owners can't wait to get their hands on the first new iPhone design in nearly three years. While the ultimate design remains to be seen, that hasn't stopped some enterprising designers from churning out absolutely stunning iPhone 8 concepts that we can only hope will be similar to the real thing.To read this article in full or to leave a comment, please click here

58% off LE Battery Powered LED Head Lamp – Deal Alert

With 18 white LED and 2 red LED, this headlamp from LE has 4 different lighting modes, including a red flashing mode. The beam distance is 20+ feet when it is on the brightest setting. Two loop buckles enable you to adjust both head-round band and the top band for maximum comfort. With this 58% off deal, its typical list price of $18.95 is now only $7.99 on Amazon, including 3 AAA batteries. See this deal now on Amazon. To read this article in full or to leave a comment, please click here

Microsoft announces AI Immersion Workshop

Microsoft intends to run an AI Immersion Workshop in Seattle on May 9, a free pre-event to Microsoft Build developer conference.The workshop is a special opportunity for advanced developers looking to create the next generation of scalable, real-world intelligent apps that use the very latest AI and machine learning techniques.The workshop will feature hands-on tutorials using Microsoft and open-source technologies. Microsoft developers will be there, and the workshop is said to be an opportunity to connect with developers and data scientists working on Microsoft’s products and services, as well as to connect with industry peers. To read this article in full or to leave a comment, please click here

IDG Contributor Network: Adoption of voice-first assistants expected to skyrocket

Amazon’s voice-first assistant technology could be worth billions for the e-tailer in just a few years, says an investment bank quoted by Fox News last week. RBC Capital Markets says Alexa could trigger $10 billion in revenue for Amazon by 2020.This startling prediction comes alongside recent speculation that Alexa will be incorporated into smartphones sometime in 2017. That wrapping-in (if it were to include the voice element, rather than simply account management) would be part of a major second-generation update. It also means Amazon will compete with native telephony-supplied AI voice products such as Siri.To read this article in full or to leave a comment, please click here

Google Chrome extension ScaleUp can make your in-flight Wi-Fi fly

Northwestern University researchers have devised a Google Chrome browser extension that might just help you get your money's worth for in-flight Wi-Fi.The ScaleUp extension stems from research originally conducted using a Northwestern-developed tool called WiFly for testing Internet connection speeds for in-flight Wi_fi. The result of these tests was that "travelers are paying a lot of money and getting modem-like performance," said Fabian Bustamante, professor of computer science at Northwestern's McCormick School of Engineering, in a statement.To read this article in full or to leave a comment, please click here

Nuclear physics, plastic surgery & more: 802.11ac wave 2 users sound off

The second wave of 802.11ac Wi-Fi technology, primarily distinguished by new MIMO capabilities, bigger channels and the general ability to handle larger and denser groups of connections, is starting to make its way into enterprises.MU-MIMO is the piece that’s got everyone excited for wave 2 – it stands for multi-user, multiple-input, multiple-output, meaning that access points use larger numbers of antennae that can be managed algorithmically to provide a more flexible distribution of wireless resources. In essence, these are smarter access points that are better able to handle large numbers of users at any given time, and feature more advanced ways to manage different kinds of wireless links.To read this article in full or to leave a comment, please click here

Nuclear physics, plastic surgery & more: 802.11ac wave 2 users sound off

The second wave of 802.11ac Wi-Fi technology, primarily distinguished by new MIMO capabilities, bigger channels and the general ability to handle larger and denser groups of connections, is starting to make its way into enterprises.MU-MIMO is the piece that’s got everyone excited for wave 2 – it stands for multi-user, multiple-input, multiple-output, meaning that access points use larger numbers of antennae that can be managed algorithmically to provide a more flexible distribution of wireless resources. In essence, these are smarter access points that are better able to handle large numbers of users at any given time, and feature more advanced ways to manage different kinds of wireless links.To read this article in full or to leave a comment, please click here