Skip to content

Instantly share code, notes, and snippets.

View shmalex's full-sized avatar

Alexei Matusevski shmalex

View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
@REDU RISE Education Cayman Ltd through its subsidiaries provides junior English Language Training services in China under RISE brand. It offers educational programs, services & products, consisting of educational courses, and other complementary products.
@RWX The investment seeks to provide investment results, before fees and expenses, correspond generally to the total return performance of the Dow Jones Global ex-U.S. Select Real Estate Securities Indexsm.. The fund generally invests substantially all, but at least 80%, of its total assets in the securities comprising the index and in depositary receipts based on securities comprising the index. The index is a float-adjusted market capitalization index designed to measure the performance of publicly traded real estate securities in countries excluding the United States. The fund is non-diversified.
@REI Ring Energy Inc is a Midland-based exploration and production company that is engaged in oil and natural gas acquisition, exploration, development and prod
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
-4.0174336 1.8325577 8.786042
9.781403 0.30886754 -12.351665
-22.120518 -7.325666 2.8411496
-4.5682545 19.34254 -4.0497246
-20.582008 -4.075826 9.633399
24.289375 -1.0449073 -0.8331189
-2.861584 2.0763915 6.8639197
25.134392 -1.7839859 -1.891535
-3.3268483 20.549065 0.7513602
-2.4775496 -9.263461 27.183546
{
"embeddings": [
{
"tensorName": "Stocks By Descriptons",
"tensorShape": [
1000,
50
],
"tensorPath": "https://gist.githubusercontent.com/shmalex/2670d94ce6266588fdc7530c03162229/raw/e9350a921d48ec3d866af3d920663b497a59ef2a/stocks_embedings.csv",
"metadataPath": "https://gist.githubusercontent.com/shmalex/397f9f51f4e294774e9ef8c8f1a7805b/raw/a8a0e3ef0bb0dd11b166913271eca85d98f14d96/stocks_descropyions.tsv"
import pandas as pd
import numpy as np
import math
from matplotlib import pyplot as plt
# data file should have one column with price data
df = pd.read_csv('../data/ninja-trade/data.txt')
col = 'close'
period = 9
@shmalex
shmalex / sum_of_matrix.py
Last active August 15, 2023 13:29
Sum of Ones in Matrix 2^n by 2^(n+1)
import numpy as np
def sum_of_bins_greater_then(n):
print("n =",n)
left = []
for i in range(2**n):
left += [sum(int(x) for x in bin(i)[2:])]
up = []
for i in range(2**(n+1)):
up += [sum(int(x) for x in bin(i)[2:])]
print("Matrix shape", len(left),'x',len(up))
@shmalex
shmalex / random_password.py
Created August 24, 2023 09:09
random password generator
import numpy as np
import time
import sys
import argparse as ap
from collections import Counter as cnt
def rule_inrow(psw):
p = ''
for i in psw:
if p == i:
@shmalex
shmalex / git.sh
Created August 24, 2023 09:37
GitHub Routines
# New github ssh key
ssh-keygen -t rsa -b 4096 -C "fancy-email@banana.com" -f outputfile
# calculate the SHA265 of the public key
ssh-keygen -lf outputfile.pub
@shmalex
shmalex / config.md
Last active November 7, 2023 11:03
ssh config help

Generate your key and copy to server

ssh-keygen

Copy to server

linux:

ssh-copy-id -i ~/.ssh/mykey user@host -p 22

windows:

@shmalex
shmalex / ssh bp.md
Created August 28, 2023 14:03
ssh keys and stuff

Add key to agent

run the agent process

eval $(ssh-agent)

ssh-add [key]

redo when restated

@shmalex
shmalex / users.md
Last active November 7, 2023 14:33
Ubuntu User Management

List users

https://www.godaddy.com/help/remove-a-linux-user-19158

cat /etc/passwd

Each row represents a user and the fields separated by the colon (:) has the following meaning:

  • User name
  • Password, x means that a password is set for the user
  • User ID (UID)
  • User's group ID (GID)