? ??? ??????? ????? ?????? ?? ??????? ? ?????? ? ??????

??? ????? ?????? ?? ?? ??? ????????? ? ???????, ? ???????? ? ??????????? ????????, ? ?????????? ??????? ? ??????.

? ??????? ?????? ????????? ?? ???????? ????? ????? ?????, ? ??????? ??? ??????????, ?????? ??? ????? «?????????? [???? ? ????] ? ????», ? ?????? ?????? « ???????? ????????? ?? ?????????????? ? ???????????????? ????????????? ?? ??? ????????».

??? ???????, ??? ????? ?? ????? ????? ????????? ??????? ????? «???????????????» ? «????????????» ????????.

????? ???? ??? ????????? ? ??????? Google Translate. ????? ????????, ???? ?????? ??????.

? ????? ?????? ? New York Daily News, ???????, ?? ????? ??????, ???? ???????? ??????? ??????????? ????????? ?????? ???????? ????? ??????????? ? ??????? ? ??????. ? ?????, ??? ??? ????????? ????? ?? ?????? ????? ????????, ??????? ? ????? ???????????? ??????? ???????.

? ???????? ??? ????????? ??? ?????? Daily News, ?? ???????? ???????, ??????? ? ??? ???????????:

  1. ?????? ?????? ??? ?????????? ? ???????? ??????? ? ????????? ?????????? ????????? ?????? ???????????? ???. ????????? — ?????????????? ????????? ?????, ???????????? ???????????? ??????????.
  1. ????? ? ????? ???? ????????, ? ??????? ?? ?????? ????????? ??????? 31 ??????, ??????? ??????????????, ?????????, ??????, ??????? ? ??????. ???????? ????? ????? ?? ??????? ??????? ???????? ? ???? ????????? ?????????, ???????? ?????????? ?????????.
  1. ???????? ????? ??????? ??????? ????????? ?????, ????? ??? ????????.
  1. ??? ???????? ????????? ????????? ? ??????????? ???????????? ????? (???) ?? ??? ??????. ????????? ? ???? ??????? ?? ?????????? ???. ????????? ? ??????? ???? ????? ?????????? ???????? ???, ? ?????? ??????? ?? ???????? ??????????? ????? ???.

???????? ?? ????????????? ???????, ??????????? ??????????? ?????? ???????? ? ????????? ????????? ? ????

??? ?????? ? ????????, ??????? ??????????, ??? ????? ????? ????? ??????????? ??? ???????: ?????? ?? ?? ??? ??? ????????????? ????? ? ????????


??????? ??????

????????? ? ??????? ?????? ?????????? ?? ?????

  • ???? ???, ???-???? ????? ????, 15 ?????? 2022 ?., link

? ?? ????? ??? ??? ????????? ?? ???????? ?????? ?????? ? ???????, ? ?? ????? ??? ??????????? ????? ??????????? ??????, ????? ?????????? ? ???????? ?????????, «? ??? ?????? ??????» – ?????? ???????, ?????????? ???????? ?????????????? ???????????? ?????????.

?? ???? ????????? ???????????? ??????????? ? ?????? ??????, ????? ??? ?????????? ? ??????? ?????? ????? (??????? ????????????? ????????, ?????? ??????? ?? ???????? ?????????? ??????? ?? ????????? ? ????, ? ?????????? ???????? «???? ????? ????? ????? ???????? ?????? ???????»), ? ????? ?????, ????? ??? ??? ??????? MSNBC ????? ??????, ??????? ?????????, ?? ?????????? ??????, ??? ???????? ????? ????? ??????? ???????? ? ???????. ???????? ?????? ? ?????????? ????????? ????? ????????????? ???????? ?? ?????? ?????? ??????? ? ?????.

?? ?? ????? ???????? ????? ? ?????, ????? ???????, ????????? ??????????????? ??? ?????????.

??-??????, ? ??????? ?? ???????, ?????? ????????? ??????????? ????????, ?????????? ? ?????? ?????? (??????) ? 1990 ????, ??????????? ????????? ?? ????????, ? ??????? ??????? ???, ? ???????? ???? ????????? ???????? ? ?????? ????????? ????????? ?? ????????, ??????? ???????? ????????? ?? ??????? ?????? ????????? ?????????. ?????? ?????? ??????? ????????? ????????? ?????? ???????????? ???, ????????? ?? ???????, ???????? ? ?????? 2002 ????, ??????????????? ?????????????? ??????????.

????????? ???????? ? ??????? ????? ??????????, ??? ??? ????????? ??????????????? ???????? ????????????? ??? «???????? ????????». ??????????? ?? ????????, ? ????????? ??????????? ????????? ??? ???? ????? ??????, ??? ????? ????? ???? ?????????? ??????????????? ?????? ?????? ?????????? ???, ?????????? ??????????? ??????? ????. (??? ? ?????????????? ????????, ?? ?? ?????? ???????? ????? ?????????.) ??? ?? ?????, ????? ????????, ??? ????????? ??????? ?? ?????????? ???, ? ???? ????? ???? ?????? ????, ????? ???????, ??? ?????? ?????????, ??? ??? ???? ??????????. ?? ?????? ???. ??? ????? ????????????? ? ??????? ? ????? ??????????? ?????????? ?????, ??????? ?????? ??????, ???? ?? ??????? ??????????? ????? ???.

????? ? ????? ????? ???? ????????, ? ??????? ?? ?????? ????????? ??????? 31 ??????, ??????? ??????????????, ?????????, ??????, ??????? ? ??????. ???????? ????? ????? ?? ??????? ??????? ???????? ? ???? ????????? ?????????, ???????? ?????????? ?????????.

????? ????, ???? ? ??????? ???????? ??????????? ?????????? ?????? ??? ????????????? ??? ???????? ?????????, ?? ? ?????, ?? ??????? ???? ????????, ?? ??? ???????? ???????????: ??????? ??????? ??????? ???? ????????? ???????? ??????????. ? ?????? 2004 ???? 46% ??????? ???????, ??? ???? ??????? ?????, ??? ?? ?????, ? 49% ???????, ??? ????????? ???? ????????? ??? ? ?????-?? ??????? ??????????; 39% ???????, ??? ???? ??????? ???? ? ??? ????????? ???? ????????????.

????? ??? ????? ?????????? ?? ???? ????????? ???????? ? ????????? ????????? ? ???????????? ???????. ??? ?? ?????, ? ?????? 2009 ???? ?????? 28% ??????? ????????? «????????? ????????????»; ? ?????? ??????? ???? ?? ??????? ??????? ??????????? ? ???, ??? ?????????? ??????? ???? ??????, ???????? ?? ?????????. ??? ?????????????, ????????, ??? ??????????? ????? ???????????? ????????? ??????????? ??????????? — ???????? ????? ?????????? ????????? ?????????? ? ??????????? ???????? — ? ??? ?? ??????? ???? ????????? ??????????? ????? ????????????????? ?????? ??? ???????.

??????? ????, ??? ??????? ????? ???????? ?????? ??????? ??????? ? ?????????? ?????????? ???????? ? ?????? ??????? ???????? (?? ?????? ?????? ??????????? ? ???????????????????? ????????). ?? ??????????? ?????? ?????? ??????? ? ?????????? ?????? ?? ??????? ???????? ???????? ?? ???????????? ?????????????? ?????????????? ??????? ? ???????? ???????????????? ???????, ?? ?????? ??? ? ?? ?????????? ?????????? ?? ?????????????? ??????????? ???????. ??, ????????? ???????????? ??????? ? ????? ????????? ??????? ????????????, ????? ??? ???????? 24 ?????? ??????? ? ?????? ? 2005 ????, ? ?? ??????? ???????? ?????????; ?? ???? ??? ?????????? ?? ??????? ??? ?????????.

????? ??????? ???????, ??? ????????????? ????? ?????? ??? ????????? ??? ???. ????????????? ???????????? ????? ? ????? ???? ???????? ???????????? ???????????, ???????, ?? ?????? ?????? ????? ????, ????? ?? ????? 250 000 ????? ???????????. ???? ????????? ?????, ???????????????? ????????? ?????, ? ????? ??????????? ? ???????? ???????? ? 2010 ???? ???????, ??? ???????????? ?????? «??????? ????????? ??????, ??????? ?????????????? ???? ?????».

????????? ????????, ????? ??? ??? ?????? ?? Commentary, ??????????, ??? ???????? ?????? ????? — ????????????? ??????????, ?? ?????????????? ?????? ????????????, — ??????? ????????????? ??? ????????????? ??????????. ??? ?????? ???????, ???? ???????? ??? ??????: ?????? ??????????? ? ???????; ???????????? ???? ? ?????? ????; ???????????? ??? ? ?????????, ??????? ????? ????????? ???????? ??? ? ????????? ???? ????????; ????? ????????????? ??????? ???? ?? ?????, ????????????? ??????????? ??????????? ?? ?????? ????????? ???????????, ?????????? ???? ????????, ??? ??? ???????? ?? ????????????? ???????????????.

???-?? ????? ????????, ??? ????? ? ????? ??? ?? ????????, ??? ??? ??? ?????????? ???????? ??? ??????? ??????. ?? ?????????? ???????? ? ?????? ?????? ?? ??????? ??????? ??? ? ????????????, ??? ? ? ????????? ????? ??????.


???????????? ????????? ?? ????? ???????? ????? ?????

??? ?? ???? ????????????? – ? ????????? ???????? ?????????? ????? ??????? ?? ?? ?????? ? ?? “????????????”, ? ?? ??????????? ??????? ?????. 

?? ????, ???????????, ?? ???? ?????????????  “?????????????” ?? ????? ???????? ?? ????? ???????????? ??????? ????? ?????? ??? ? ???? ????? ??????? ????????? ? “??????????? ? ????” ???? ? ??????, ? ?????? (?? ? ????? ?????? ??????) ?????? ????? ???????? ?? ?????????????? ? ?????????? ???????????????? ???????????? ? ????? ??????. 

????? ?????? ?? ????? ?????????, ??? “???????????????” ??????? ?????????? ?? “?????????????” ? ?????? ?????? ?????, ? ?????? – ????????????? ??????. ????? ??????, ??? ????? ????????? ???? ? ???????, ??? ?????? “????? ????????” ? ????? ?????.

What is the difference between the wars in Iraq and Ukraine?

I absolutely hate what’s happening in Ukraine, to both the Ukrainian and Russian people who are there, and to Russia’s reputation.

Recently I saw a message from a Russian friend of a friend, asking why the USA can “flatten [Iraq and Iran] into a pancake,” but Russia has to “quietly watch as extremist and terrorist activities occur at its borders.”

They said no one can clearly explain the difference between “democratic” and “authoritarian” abuse.

I found a New York Daily News article, which I thought was a pretty good explanation of some important differences between the Ukraine and Iraq invasions. I think it is a decent response to that person’s question, so I decided to publish a Russian translation.

I encourage you to read the whole Daily News article, but the main differences it mentions are:

  1. Saddam Hussein was a dictator with a history of murder and violating several United Nations Security Council resolutions. Zelensky is a democratically elected leader with public support.
  1. The war in Iraq was conducted by a coalition that had 31 member countries at the time of the invasion, including the United Kingdom, Australia, Italy, Spain and Turkey. Vladimir Putin found one on-and-off ally in the dictator next door, Belarus’s Aleksandr Lukashenka.
  1. There was large support of the war by the citizens of Iraq when it initially began.
  1. The US tried to justify the invasion in the United Nations (UN) before it began. The Iraq invasion was never condemned by the UN. The Ukraine invasion was near-unanimously condemned by the UN, and Russia never tried justifying it to the UN.

Despite the reasons above, most Americans quickly regretted supporting the invasion of Iraq

My question to the person, who is arguing that there’s no difference between these 2 invasions: why are you still supporting the war in Ukraine?


Original message from the Russian friend of a friend

Below is a google translation of their message. I apologize if it’s difficult to read.

There is no need to distort – on the Internet a huge number of people are fighting not for Putin and for a “special operation”, but for primitive common sense.

Not a single, I emphasize, not a single newborn “quasi-pacifist” can answer the most elementary questions, such as why the United States and NATO can bomb Yugoslavia and “roll into a pancake” Iraq and Iran, while Russia (and any other countries) should silently look at extremist and openly terrorist activities at their borders.

No one can clearly explain how “democratic” violence differs from “authoritarian” violence and why the first is possible, while the second is categorically impossible. In a word, either the equality of all and everyone is complete, or only “the right of the strong” and the right of war.

Stretches and Exercises for Lower Back Pain

A little unusual of a post for this blog, but recently, my recurring lower back pain soreness and pain has returned. In order to address this soreness, I found an incredibly helpful set of stretches on youtube from a channel called Activ Chiropractic. By doing each stretch for about 10 seconds, a lot of my soreness and pain goes away.

In order to make these stretches easy to reference, I made a screenshot of each stretch and a single image with all the stretches combined. Since it’s been so helpful to me, I figured I would share it with the world on my blog.

Build a Javascript Slack App

A Summary of the Official Building a Bolt JS App

  1. Create a new slack app in the apps portal.
  2. Go to Basic Information page in the apps portal and install the app in your Slack instance.
  3. To edit and host the code for your slack app: Create a Glitch app from Slack’s template.
  4. Copy the signing secret and the Bot token from Basic Information and OAuth pages in the apps portal into your glitch app’s .env file.
  5. Go to Event Subscriptions in the apps portal and add app_home_opened.
    1. request_url for glitch apps is https://YOUR_APP_NAME.glitch.me/slack/events.
    2. Add bot event app_home_opened. Save changes.
  6. Go to your app’s “home” page in the Slack app. You should see the example text and button from the code in Glitch.
  7. You can now use shortcuts, listen for events, post messages, and more with the bolt js framework. To try one, just replace the example “app.home.opened” function.
  8. Each of the functions above has listener functions for interacting with Slack. 

Add a Shortcut in a Bolt JS Slack App

  1. Go to your app’s Interactivity page in the apps portal.
    1. request_url for glitch apps is https://YOUR_APP_NAME.glitch.me/slack/events.
    2. Name is whatever you want showing up in the Slack app.
    3. callback_id is your function name that you will use in your code.
  2. In glitch, add the code from https://slack.dev/bolt-js/concepts#shortcuts.
  3. That’s it. To add more functionality to your shortcut, check out https://github.com/slackapi/bolt-js#making-things-happen.
slack shortcut example
slack shortcut example

Kubernetes FAQ

Recently I’ve been working a lot with kubernetes at my job. I’ve written up a bunch of internal documentation based on my work, and because it’s not company-specific I decided I’m going to share it here for anyone trying to find answers on the internet.

Table of Contents:

  1. what is k8s?
  2. view nodes in a nodegroup
  1. view pods on a node
  2. restart deployment
  3. insufficient cpu, insufficient memory errors
  4. deployment is not ready
  5. CrashLoopBackoff
  6. pod didn’t trigger scale-up
  7. how do I avoid accidentally running a kubectl command on the wrong cluster?

What is Kubernetes? How do I use it?

Kubernetes is an open source container orchestration engine for automating deployment, scaling, and management of containerized applications. Check out official docs here: https://kubernetes.io/docs/home

View Nodes in a Nodegroup

Confirm the nodegroup you’re checking actually exists (e.g. you’re looking for pods running under engtools-infra/my-app) by listing all the nodegroups in a certain namespace:

k get nodegroup -n engtools-infra

Get the nodes under that nodegroup:

k get nodes -o wide | grep my-app

View Pods on a Node

View pods under a node with the following command (replace NODE_NAME_GOES_HERE with the node’s name, e.g. ip-10-10-12-123.ec2.internal).

k get pod --field-selector=spec.nodeName=NODE_NAME_GOES_HERE -owide --all-namespaces | grep -v -E "( kube-proxy-| kube2iam-|  local-volume-provisioner-| node-monitoring-| localusers-)"

Restart Deployment

Make sure you’re in the right cluster, get the deployment name, then use the rollout command.

k config current-context
k get deployment -n [NAMESPACE]
k rollout restart deployment [DEPLOYMENT_NAME] -n [NAMESPACE]

insufficient cpu, insufficient memory errors

If you’re seeing errors about insufficient resources, or node(s) had taint … that the pod didn’t tolerate warnings, you probably need to define instanceType and resources attributes in your service k8s objects / charts. For example, something like the following:

  instanceType: c5.2xlarge
  resources:
    requests:
      cpu: "3"
      memory: "4G"
    limits:
      cpu: "4"
      memory: "6G"

Deployment is not ready

A log you might see when deploying with Bazel is Deployment is not ready: <service>. 0 out of 2 expected pods are ready. This usually means k8s pods are in a CLB or some other non-ready status.

Use kubectl commands to check on the pods’ status and logs. Usual status check command:

kubectl -n NAMESPACE get pods

CrashLoopBackoff

If you see CrashLoopBackOff status on one of your pods, that means it’s crashing (I know, thanks captain obvious).

Check the pod logs: k logs CRASHING_POD -n NAMESPACE.

Find the deployment.yaml file describing the launch instructions for this pod. Find the command attribute in that file, comment out the value underneath it, and add the following:

          - tail
          - "-f"
          - /dev/null

Then re-deploy the pod. This will allow you to SSH into the pod, run the failing command manually, and generally get more info about the problem.

You might also need to comment out the liveness/readiness container specs in deployment.yaml, as those will often cause the pod to crash as well if there’s an issue with the primary container.

More info about troubleshooting crashloopbackoff pods can be found in this releasehub.com article.

pod didn’t trigger scale-up

Normal   NotTriggerScaleUp    19m                  cluster-autoscaler   pod didn’t trigger scale-up: 3 node(s) had taint {node: database-rev-eng-8c38-pool1}, that the pod didn’t tolerate…

Potentially a node group or a scaling group issue. For example, you might have a single AutoScalingGroup (asg) under your nodegroup-controller which has reached its max size. In this case, adding autoscaling: true option to your charts may be required in order to have more ASGs created.

If adding nodegroup options, you may need to delete the existing nodegroups (krm ng NODEGROUP_NAME -n NAMESPACE) for the option to take effect. After creating the new nodegroup, the cluster autoscaler may need to pass by, which can take a few minutes. So if you’re still seeing the scale-up messages and your pod in a Pending status after such a change you may need to give it a little time.

How do I avoid accidentally running a kubectl command on the wrong cluster?

Use Explicit Context in Commands

kubectl –context cluster3.us1.test.com get pods -n mynamespace  

Kube-ps1

kube-ps1 will show you what cluster and namespace you’ve set in your prompt, which helps avoid this issue:

After installing it with homebrew, add this to your .rc file and restart your terminal to enable it:

source /usr/local/opt/kube-ps1/share/kube-ps1.sh
PROMPT='$(kube_ps1)'$PROMPT

It works great in conjunction with using kubectx and kubens to change your context/cluster/namespace.

It’s very easy to change contexts in a different terminal and have a stale prompt showing the old context. Press enter to refresh the prompt.

Powerlevel10k

If you use powerlevel10k, it can dynamically update your prompt with the current context when you’re typing a kubectl command – https://github.com/romkatv/powerlevel10k#show-on-command.

Troubleshooting

‘Clear Formatting’ Shortcut Fix

Recently my ‘clear formatting’ shortcut for most google apps (Command (or Cmd) ? + \) stopped working on my Macbook.

This was very frustrating as I use it all the time.

Apparently the 1password took over this shortcut since it uses cmd+\ to fill logins, silently. I was able to change the shortcut in 1password preferences, at which point clear formatting started working again.

In the future, if you have a similar issue, there’s also an app called ShortcutDetective that can help you find out if a keyboard shortcut is being used for an app on your Mac.

View Pods in a Nodegroup

Confirm the nodegroup you’re checking actually exists (e.g. you’re looking for pods running under product-team/fubar) by listing all the nodegroups in a certain namespace:

get nodegroup -n product-team

Get the nodes under that nodegroup:

get nodes -o wide | grep fubar

Get the pods under those nodes (replace NODE_NAME_GOES_HERE with the name you got from the command above, e.g. ip-10-111-22-333.ec2.internal):

k get pod --field-selector=spec.nodeName=NODE_NAME_GOES_HERE -owide --all-namespaces

Parking Near Airports in NYC

Little trick I learned from living in NYC.

There’s free street parking in neighborhoods like Ozone Park near JFK on streets that don’t have street cleaning, for example on 120th St between 133rd Ave and Sutter Ave. You can park there, and then take public transit or uber to JFK. I’ve done this at least twice now.

This is fairly low risk if you’re not going away for more than a week. The only issue is if you leave the car for too long I imagine it might be reported as abandoned and get towed.

You can do a similar sort of thing near LGA, which I’ve done MANY times now, but there are no streets without street cleaning, so you either need to make sure your trip is 6 days or less, or cough up the $65 ticket for street cleaning.

The nice thing about LGA, is that street parking is close enough to the airport that you can just walk to the terminal, or take a kick scooter and then lock it up at one of the bike racks outside the terminals.

I love not needing to spend $60-80 for airport transportation and being able to drive myself 95% of the way there. I usually walk to LGA too instead of taking an Uber after finding a spot.

Bulk Delete Projects in Jira

Had to do this recently for a lot of test projects that were created in our Jira sandbox instance.

It’s a small python script using Jira API and the requests python library.

import requests
from requests.auth import HTTPBasicAuth

domain = "https://MY_JIRA_INSTANCE.atlassian.net"
admin_user = "JIRA_ADMIN@MY_COMPANY.com"
admin_token = "JIRA_ADMIN_TOKEN"
project_query = "PROJECTS_I_WANT_TO_DELETE"

def getJson(url, auth):
    r = requests.request(
        "GET",
        url,
        headers={"Accept": "application/json"},
        auth=auth
    )
    return r.json()

def deleteProject(id, auth):
    r = requests.request(
        "DELETE",
        domain + "/rest/api/3/project/" + id,
        auth=auth
    )
    return r.text

search_url = domain + "/rest/api/3/project/search?query=" + project_query
auth = HTTPBasicAuth(admin_user, admin_token)
json = getJson(search_url, auth)

projectIds = []

# append results across all pages, while there's still a nextPage, to projectIds array
while "nextPage" in json:
    nextUrl = json["nextPage"]
    for searchResult in json['values']:
        # optional safety check to make sure the right project is being added to the deletion array
        # if "PROJECT_NAME_I_INTEND_TO_DELETE" in searchResult["name"]:
        projectIds.append(searchResult['id'])
    print("Number of project IDs found matching the search query: " + str(len(projectIds)))
    json = getJson(nextUrl, auth)

# append a single page, or the last page of results, to projectIds array
for searchResult in json['values']:
    # optional safety check to make sure the right project is being added to the deletion array
    # if "PROJECT_NAME_I_INTEND_TO_DELETE" in searchResult["name"]:
    projectIds.append(searchResult['id'])
print("Number of project IDs found matching the search query: " + str(len(projectIds)))

# delete projects in projectIds array
for index, id in enumerate(projectIds):
    print("Deleting project " + id + ". Projects remaining: " + str(len(projectIds)-index))
    print(deleteProject(id, auth))