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