Skip to content

Instantly share code, notes, and snippets.

View gasparian's full-sized avatar
👾

Andrey Gasparyan gasparian

👾
View GitHub Profile
@gasparian
gasparian / interviews_prep.md
Last active February 8, 2024 18:21
interviews prep
@gasparian
gasparian / README.md
Last active October 25, 2022 14:38
setting up ec2 machine with GPU for DL

EC2 Cent OS machine with GPUs setup guide

All suggestions here are valid for Cent OS.

Pyenv

Install pyenv via installer, first:

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

Then add these to your env variables:

@gasparian
gasparian / ssh_config.md
Created March 8, 2022 12:01
Configure access to remote machine via pem key

In order to connect to the remote machine without the need to provide *.pem key each time, you can add these lines to the ~/.ssh/config:

Host 1.2.3.4
     User root
     IdentityFile /path/to/my.pem

Also, if you're using midnight commander, you can now freely connect to the remote machine as well by just specifying user and host:

[email protected]
@gasparian
gasparian / priority_queue_example.go
Last active January 7, 2022 08:46
priority_queue_example
import (
"container/heap"
)
type Event struct {
Raw string
Number uint64
MsgType int
FromUserID uint64
ToUserID uint64
@gasparian
gasparian / changroup.go
Created August 23, 2021 19:44 — forked from jesselucas/changroup.go
Simple solution for using a WaitGroup with select{}
package main
import (
"fmt"
"sync"
"time"
)
func main() {
// Create a wait group of any size

Example of installing python3.7.11

sudo apt update
sudo apt install \
         build-essential \
         zlib1g-dev \
         libncurses5-dev \
         libgdbm-dev \
         libnss3-dev \

Goal - get solid understanding of fundamental topics of distributed systems and algorithms. Become strong at Go ;)

Convention:
[_] - todo
[✗] - in progress
[✓] - done

Practice/Pet projects:

package main
import (
"fmt"
"time"
"math/rand"
"encoding/hex"
)
func GenerateSecureToken(length int) string {