Monday, March 29, 2021

Python3 pip is slow on install

`python3 -m pip install` was hanging when trying to install packages.

 

Update with a much easier way is to force the system to prefer ipv4 instead of ipv6:

Pip installs slowly due to ubuntu’s preference for ipv6, in /etc/gai.conf add the line (or uncomment the existing line)

precedence ::ffff:0:0/96 100 to indicate a preference for ipv4. This will stop pip from hesitating before installing packages.

 

Older method:

Searched for `pip hangs on "Starting new HTTPS connection (1): pypi.org:443"` and found a single link which linked to https://github.com/pypa/pip/issues/5469#issuecomment-393919476, which ultimately lead to a tutorial at https://support.purevpn.com/how-to-disable-ipv6-linuxubuntu. Essentially

  • edit /etc/sysctl.conf to add
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
  • run `sudo sysctl -p`
  • confirm with `cat /proc/sys/net/ipv6/conf/all/disable_ipv6`

Wednesday, March 24, 2021

End of disastrous job, new job predictions

From looking back on my past predictions, I was not exactly on the mark with some of them. Many of them were more guesses just to have some mark to judge whatever would happen against them. I never felt strongly about any of them until the latest prediction for the newest job. I felt very strongly about that one. I knew something was very off from the start and was very disappointed to be leaving the robotics company. Today that all came true in that I was finally let go. As it just happened a few minutes ago it will take some time to absorb all the lessons learned, but I knew that this was coming, so I was fortunately prepared. Fortunately, there was a nice side to all of this in that they gave me severance. I was debating whether to quit myself, but I suppose it can be said that my patience paid off.

The crux of the reasoning as to why I was let go was because I was three weeks late on a project I was assigned. I do feel that I should have ramped up faster. I believe the main issue was that I simply wasn't dedicating enough time to the company, between each company I interviewed with taking several days of multi-hour interviews and through my own lackadaisical attitude in approaching the task, I got behind fairly quickly. I also struggled with understanding all that was generated when the boilerplate was copied around. This coupled with the fact that I was hired on at roughly the same time as another engineer who was tasked with a similar project and who got the project done in the expected time made it all the more glaring as to how far behind I was in getting the component complete. Some other things to note, I am not as up to speed with the changes in python and AWS as I thought. Lambda and Dynamodb were new to me and I didn't take the time to really get up to speed with those, in particular how different Dynamodb's suggested data model is from other data stores.

There were numerous red flags that I read that got me moving right out of the gate. I've been interviewing since the second week with this company and fortunately took a position with a company I had turned down a year ago. For my own edification these red flags were:

  • several examples of foolish consistency (everyone uses the same type of laptop, everyone pressured to use the same ide, everyone has a namespaced github username). The issues at the start where I ran into significant issues after resigning from the robotics company were the most significant red flags. I still resent that, after I had already resigned!
  • low standard of coding practices: large swaths of boilerplate copy-pasted around, very poor documentation for getting up to speed, unit-tests spread out all over the place with multiple conftest files in strange places, poor github commits, few if any code reviews.
    • there were interesting things done as well
      • encoding pertinent info into the ids
      • factory classes used for creating objects
  • toxic environment:
    • I was chastised for asking a fairly silly question in chat that I quickly saw the answer to myself. I went back and acknowledged that it was a silly mistake, but it was still used as a stick against me later
    • when asked to explain why I was behind on the project, my explanations were brushed aside and I was told that I should have been able to deal with those issues. They never openly stated that they thought I wasn't smart enough, but it was clear that this was what they were trying to imply. Had this happened when I was fresh out of my career, this behavior would have been truly disheartening. As it is later in my career, it's more apparent that they've suffered these types of attacks themselves and instead of handling it in a healthy way, are applying these same attacks on others as defensive mechanisms.
    • when asking how certain parts of the code worked, they would simply demand that I explain how I thought it worked and when I got it wrong, would be met with derision and statements like "I can't ask it any more simply."
  • vanity company:
    • the biggest issue I had with the company itself was the driving factor towards one of the main components that they wanted to develop. The story was that the CEO was upset that a non profit that perse worked at demanded that perse comply and pay the amount perse had agreed to pay to the dot org. Instead, perse became very angry and demanded that the time and effort be considered when taking into account how much perse owed. When the non profit refused to take this into consideration, ceo threw a fit and resigned from the board and other various positions with the non profit. As a result, perse started this company to create tools for non profits to be able to track what all a person does for a non profit out side of money. Ultimately it feels as if the ceo wants a way for non profits to see their 'likes', retweets and other #hashtivisim as a form of fund raising. But ultimately, a non profit needs to pay their bills. Likes and retweets don't make any money.
All in all, I am sad that I didn't shine as I do at most places, but at the same time it could be a warning shot indicating that my abilities are no longer where they should be when it comes to working at start ups. I need to get back into conventions and start brushing up api building skills.

Fortunately the new job so far, is all good. They agreed to the machine and environment I chose. Despite being less in base pay, I'm still making more than the previous place due to better benefits and 401k matching. Also the interview was the type of interview I respect. They asked actual programming and design questions instead of just asking about my background and various high level questions. Only minor negative things is a background check and asking for references. It should be a fairly positive experience.

Tuesday, March 23, 2021

Find and replace across multiple files in Emacs, Rename multiple files in Emacs

 Find and replace across lots of files in emacs:

  1. M-x find-name-dired: prompts for a root directory and a filename pattern.

  2. Use t to "toggle mark" for all files found.

  3. Use Q for "Query-Replace in Files...": prompts for query/substitution regexps.

  4. Proceed with query-replace-regexp: SPACE to replace and move to next match, n to skip a match, etc.

  5. Press C-x s to save buffers. (then use y, n or ! to save all at once)

To rename multiple files in emacs:

  1. Alt+x dired to go to the directory.

  2. Alt+x dired-toggle-read-only 【C-x C-q】.

  3. Then, just edit the file names.

  4. When done, wdired-finish-edit 【C-c C-c】 to commit the changes.

Sunday, March 14, 2021

Using multiple github accounts with different keys

Create and edit `.ssh/config` and add:

#activehacker account
Host github.com-activehacker
	HostName github.com
	User git
	IdentityFile ~/.ssh/id_rsa_activehacker

#jexchan account
Host github.com-jexchan
	HostName github.com
	User git
	IdentityFile ~/.ssh/id_rsa_jexchan

After which, clone repos as:

git clone git@github.com-activehacker:activehacker/gfs.git gfs_jexchan
________________________^
as oppose to:
git clone git@github.com:activehacker/gfs.git gfs_jexchan

Friday, February 5, 2021

End of old job, new job opinions and predictions

Finally decided to move on from the robotics company. Main factors were money and a disconnect with the director of software. Tried to get a very good old coworker in as a software developer but he was dismissed by the director as not having the desired experience. New place is also offering 20k more, but on further inspection, they're only providing health care for the individual, not for family which, after paying for that, means that the increase is only 8k per year. Also, it's been incredibly difficult leaving the robotics company as the children loved hearing about and working with the robots so much.

Disturbingly, less than a week after submitting my resignation, a major issue came up. I had gotten several assurances that developers were able to use whatever environment that they felt most comfortable with, but when it came time to send out the company computer, the new company said they would only provide Mac computers. I stated that I wanted a thinkpad running linux. I was rather irritated by this, but their response was that this would be a deal breaker for the company. The recruiter that I had such a high regard for and was the reason I was interested in the company took a turn in that it was a deal breaker and that they would rescind the offer if I didn't relent. After I had already submitted my resignation. I was already on the fence due to the health insurance issue and to also have to deal with this would have been a deal breaker. All this for only 8k more a year.

Also spoke with the CTO about why it was important to allow developers to work within their own chosen environment rather than their personal favorite computer type, but was met with simple arguments of "it's easier to develop on-boarding documentation if everyone has the same system" and "it's easier to re-purpose a Mac for other non dev types". It was also apparent from the CTO that further arguing about the issue was unwelcome as the recruiter had stated that the CTO "was traumatized from a previous company where, as a manager, they were at loggerheads with another senior developer" and that "they didn't want to have to deal with that again." That said, I had already tendered my resignation and had my exit interview. I actually texted the previous CTO with the intent on talking about getting my old job back, but they weren't available. I also made the decision to always move forward, no regressing. If this doesn't work out, I'll move on elsewhere.

The reason it is so disturbing to be forcing only one type of computer is that it is a fools consistency which is the hobgoblin of little minds. It predicts other foolish decisions that will be made out of lack of understanding or fear of some security issue that causes impediments to good development. It also smacks of a company that is more of a lifestyle or vanity company, not a real company with any intent of doing something significant other than being a hobby for wealthy CEO/COO types. The C levels are only there to dictate procedures and play the roll of the boss. That's all fine and good for those who want just a secure existence, but that's not what I want. The robotics company was a decent gig which had some potential and was highly engaging for my children. This new company is completely abstract to them and will be difficult to engage them. As a result I've not told them about the switch. This job is purely for a paycheck.

And true to form, another foolish consistency in that not just do developers need new github accounts, but they also had to be prefixed with the name of the company. This makes no sense, the org is the namespace for the company there's not need to prefix it on the username. There's also no need to demand separate github accounts and is in fact a burden. Now new keys must be made and managed in the new account as well as multiple keys managed on the laptop in order to move code around between accounts. There is no security in requiring this either as it's trivial to simply push the git repo to a different account with a different origin.

All in all, I have great regrets leaving the robotics company for this company. I know that the situation at the robotics company was not ideal, but this is not a suitable company to have left that situation. The robotics company, if nothing else, was inspiring to my children. I don't think I've ever regretted switching companies as much as I have in this case.

As for predictions, it now looks as if I am by far the senior at the company. I am the only one with a CS degree at this point. I'm filled with doubts and nervous about my abilities to perform here, but at least I'm back working primarily with Python. We have a very small mvp due for April which is doable. As for the company, already the main developer is a bit of a spammer of code. There's no standards in terms of commits, no requirements for peer reviews and few tests. Given the amount of code churn due to immense refactoring, it makes sense that the tests and documentation are scrapped every so often.

The only thing I can predict is that I wont be here beyond  a year. If I make it to a year.