A Quick GitHub tip

  • Do you use Git?
  • Do you use GitHub?
  • Are you following the, now somewhat standard, advice of 2FA all the things?
  • Are you now suprised that trying to pull down a repo from the terminal no longer accepts your password?

Yeah, me too.

But with a little bit of search-fu I found this StackOverflow question that held the answer.

Basically because of the 2FA the password by itself is no longer “enough” and will be rejected. The solution is an OAuth token! This is a bit like the ‘app passwords’ you see in services like Google’s Gmail, where you want to pull your email into an app that isn’t the web site nor is it an official Google generated app. These psudorandom strings are a way of proving authentication to the server since they are generated by an authorized user and they are singular to said user. Once generated and stored in a secure location like 1Password, or your password manager of choice, the token can be used in place of a password when interacting wtih GitHub from your terminal.

As an added benefit if one of these tokens were to be comprimised somehow, it can be deleted and reissued without having to reset the password proper. Once the old token is deleted it will always be rejected by the server and cannot be added back in since it can’t be regenerated back to the exact string.

Now go forth and git push and git pull with confidence!

A Little Something I Made part 2

Well, I’ve not be too idle on this. In real world time I’ve been poking at these scripts for a while, but just now been getting around to posting them.

So this is version 02 of the timer script. I have been messing with making the timer a function so that I can call it separately. Hopefully this will allow me to eventually make it easier to add a GUI and make it loop until all of the tests are done.

-edit- a few minor changes that made sense after I read the code again.

# a simple countdown timer in python
# learning by doing - eh

# time.sleep and import time - http://stackoverflow.com/questions/3309664/python-timer-countdown
#while loop info from - http://thenewboston.org/watch.php?cat=36&number=25
# conditional and function info from http://openbookproject.net/thinkcs/python/english2e

import time                                                                   #adds the time lib from python

def testTimer():                                                   #function that is the timer

t = input ("How long is the test? ")                                    #var that sets the timer length in seconds
station = raw_input ("Which test station is running? ")        #var that sets which test station is running

while t >0:                                                                    #simple "while" loop that will check the amount of time left, it checks once a second
print t, "seconds left"
t -=1
time.sleep(1)
print "Test on", station, "complete."

def again():                                                            # ideally a way to make the timer run again w/o leaving the script
rerun = raw_input ("Would you like to re-run this timer? Y or N ")
if rerun =="Y" or "y":
testTimer()
else:
print "Great! Test on ", station, "is complete! Check the results and move on!"

testTimer()
again()

Not very complex and it currently only runs in the command line. My next goal is to make it store the inputs so that it can re run the timer with only one command. I’m thinking maybe some futzing with conditionals and functions will get me closer.

A Little Something I Made

To assist myself at work I wrote a little Python script to run as a timer. This is a two fold thing, 1. I’m learning Python, 2. I needed a timer to help track the tests I run at work.

After some hunting and kvetching on Twitter I was guided to some useful resources and came up with the following.


# a simple countdown timer in python
# learning by doing - eh

# time.sleep and import time - http://stackoverflow.com/questions/3309664/python-timer-countdown
#while loop info from - http://thenewboston.org/watch.php?cat=36&number=25

import time

t = input ("How long is the test: ")
station = raw_input ("Which test station is running? ")

while t >0:
print t, "seconds left"
t -=1
time.sleep(1)
print "Test on", station, "complete."

Not very complex and it currently only runs in the command line. My next goal is to make it store the inputs so that it can re run the timer with only one command.