sudo apt update
sudo apt get net-tools # netstat
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real
#!/bin/bash - | |
# | |
# env-pkg: Environment Packager -- super simple, see Usage below | |
# | |
# by: Charles Thayer <thayer@mediabridge.com> | |
cd $HOME | |
ENVPKG_RSH=${ENVPKG_RSH:-ssh} | |
ENVDIR=env-pkg |
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
$ python manage.py migrate | |
Operations to perform: | |
Apply all migrations: admin, auth, contenttypes, sessions | |
Running migrations: | |
Applying contenttypes.0001_initial… OK | |
Applying auth.0001_initial… OK | |
Applying admin.0001_initial… OK | |
Applying admin.0002_logentry_remove_auto_add… OK | |
Applying contenttypes.0002_remove_content_type_name… OK | |
Applying auth.0002_alter_permission_name_max_length… OK |
$ pip install django | |
$ django-admin startproject myproj | |
$ cd myproj | |
$ django-admin startapp myapp | |
$ export DJANGO_SETTINGS_MODULE=myproj.settings | |
$ django-admin runserver | |
Performing system checks… | |
System check identified no issues (0 silenced). | |
February 11, 2020–05:12:45 | |
Django version 1.11.9, using settings 'myproj.settings' |
s = """Gur Mra bs Clguba, ol Gvz Crgref | |
Ornhgvshy vf orggre guna htyl. | |
Rkcyvpvg vf orggre guna vzcyvpvg. | |
Fvzcyr vf orggre guna pbzcyrk. | |
Pbzcyrk vf orggre guna pbzcyvpngrq. | |
Syng vf orggre guna arfgrq. | |
Fcnefr vf orggre guna qrafr. | |
Ernqnovyvgl pbhagf. | |
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. |
>>> from django.db import transaction | |
>>> transaction.set_autocommit(autocommit=False) | |
>>> o = Organization_v2.objects.get(name='pdemo') | |
>>> del_info = o.delete() | |
>>> del_info | |
(1404, {'data.Property': 408, [..more stuff..], 'data.Organization_v2': 1}) | |
>>> Property.objects.filter(scope__organization_id=o).count() | |
0 | |
>>> transaction.rollback() | |
>>> o = Organization_v2.objects.get(name='pdemo') |