Skip to content

Commit 4fb66b1

Browse files
author
Stas Makarov
committed
dirty notes
1 parent 52ef058 commit 4fb66b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+625
-60
lines changed

aerospike.org

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* Aerospike
2+
3+
** Main concepts
4+
5+
bin -- aka column in SQL
6+
record -- like record or string in SQL
7+
set -- wtf
8+
9+
10+
http://www.aerospike.com/docs/architecture/data-model.html
11+
12+
13+
14+
** Start aerospike manager console on Mac
15+
sudo /Library/amc/amc
16+
17+

ansible.org

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
* Ansible
2+
** Fact
3+
system and environment information ansible gathers ("context") before running Tasks
4+
** Module
5+
What runs tasks
6+
** Task
7+
are idempotent
8+
** Handler
9+
A Handler is exactly the same as a Task (it can do anything a Task can), but it will run when called by another Task. You can think of it as part of an Event system; A Handler will take an action when called by an event it listens for.
10+
** Role
11+
** Playbook
12+
13+
Run a playbook
14+
15+
ansible-playbook [-i inventory.yml] playbook.yml
16+
17+
** Best practices
18+
https://www.ansible.com/blog/ansible-best-practices-essentials
19+
https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout
20+

apollo.org

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://blog.apollographql.com/query-batching-in-apollo-63acfd859862
2+
3+
https://medium.com/@dcdigital72/graphql-one-query-to-rule-them-all-batching-vs-merging-d216e6acb218

archlinux.org

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* Printer
2+
** WIFI
3+
https://wiki.archlinux.org/index.php/Avahi#Hostname_resolution
4+
5+
* SSH agent https://wiki.archlinux.org/index.php/SSH_keys#ssh-agent
6+
* pacman

awk.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Add a string to each line
2+
3+
awk '{print $0"extra_string"}' yourFile

clojure/clojure.org

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* Anonymous functions
2+
** Alternative syntax
3+
~#(+ 3 %)~
4+
5+
% for single argument; %1, %2, etc for more then one argument

console.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Hanged ssh
2+
https://serverfault.com/questions/283129/why-do-consoles-sometimes-hang-forever-when-ssh-connection-breaks
3+
4+
To exit from hanged ssh session enter: `Enter ~ .`
5+
6+

dbs.org

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
* Column oriented DBs (CODBs)
2+
3+
** Row oriented DBs (usual DBs)
4+
Locality of reference: data of one row stored near.
5+
6+
Getting data from one column is faster in CODBs, but getting data from
7+
one rows is usually slower.
8+
9+
** Implementations
10+
11+
OSS: ClickHouse, Apache HBase, some Postgres extension, some MariaDB extension.
12+
13+
PaaS: Amazon, Microsoft, Google and Oracle has some shit.
14+
15+
Proprietary: Vertica, many others
16+
17+
18+
https://en.wikipedia.org/wiki/Column-oriented_DBMS
19+
https://en.wikipedia.org/wiki/List_of_column-oriented_DBMSes
20+
21+
22+

docker/docker_main.org

+15
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
systemctl start docker
44

5+
56
docker info
67

78
* Commands
@@ -162,3 +163,17 @@ docker-compose -f file1.yml file2.yml
162163
file1.yml -- base file. All paths must be relative to it.
163164

164165

166+
167+
* Docker hub
168+
169+
* show container IPs
170+
# show all running container's names and ips
171+
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
172+
173+
* Images
174+
** Remove untagged
175+
176+
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
177+
178+
* Space usage
179+
docker system df

elm-main.org

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
* Elm
2+
3+
** Core language
4+
5+
6+
*** Values
7+
*** Functions
8+
fun arg = arg + "somethings"
9+
10+
**** Anonymous Function
11+
12+
\arg1 arg2 -> (arg1 + arg2) /2
13+
14+
15+
All function are anonymous functions
16+
17+
18+
19+
20+
21+
*** Lists
22+
Different number of values of same type
23+
24+
l = [34, 234, 455]
25+
26+
l = ["grey", "blue"]
27+
28+
29+
*** Tuples
30+
Different number of values of different types
31+
32+
t = (34, "Stas")
33+
34+
*** Records
35+
36+
Simular to objects
37+
38+
me = { name = "Stas", sex = False }
39+
40+
me.name
41+
42+
.name me (interesting shit)
43+
44+
45+
** Types
46+
*** Type annotations
47+
48+
Line before function definition:
49+
50+
fun : number -> number
51+
fun a = a + 2
52+

emacs/.#contribute.md

-1
This file was deleted.

emacs/.#delete-whitespaces-in-the-beggining-of-string.md

-1
This file was deleted.

emacs/.#emacs-help.md

-1
This file was deleted.

emacs/.#emacs.md

-1
This file was deleted.

emacs/.#main.md

-1
This file was deleted.

emacs/.#my-emacs-organization.org

-1
This file was deleted.

emacs/.#rectangles.org

-1
This file was deleted.

emacs/.#resize-windows.md

-1
This file was deleted.

emacs/emacs-main.org

+6
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ C-x SPC
3232
auto-fill-mode -- that's what I searched for so long
3333
C-x f -- set-fill-column
3434
M-q -- fill paragraph
35+
* remote files
36+
https://www.gnu.org/software/emacs/manual/html_node/emacs/Remote-Files.html
37+
38+
/ssh:user@host:filename
39+
* rectangle
40+
** string-insert-rectangle
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
insert tag: C-c C-c (only on heading)
2+
3+
search tag: C-c \

git/.#git.md

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally
2+
3+
4+
git update-index --assume-unchanged [<file>...]
5+
6+
7+
git update-index --skip-worktree FILENAME
8+
9+
10+
11+

go.org

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
* Go
2+
3+
** Some links
4+
[[https://github.com/a8m/go-lang-cheat-sheet][cheat-sheet]]
5+
https://golang.org/doc/effective_go.html
6+
http://jordanorelli.com/post/32665860244/how-to-use-interfaces-in-go
7+
8+
** How to set up environment
9+
[[https://golang.org/doc/code.html][How to write Go code]]
10+
export GOPATH=$HOME/work
11+
export PATH=$PATH:$GOPATH/bin:/usr/local/go/bin/
12+
13+
14+
15+
Has lamda function,
16+
17+
Variable arguments
18+
19+
First arguments, then return values
20+
21+
Lexically (normally) scoped
22+
23+
24+
Types, structs and other shit
25+
26+
27+
28+
29+
** Maps
30+
https://blog.golang.org/go-maps-in-action
31+
32+
You can use structs as keys (also int, strings, pointers ... )
33+
34+
35+
36+
37+
** Go concurrency patterns [[https://www.youtube.com/watch?v%3Df6kdp27TYZs&list%3DPLP2uClub0uTrfY7bIpP985bkU6L9wqhVD&index%3D1][video]]
38+
39+
40+
** Generator
41+
Function which generates a channel
42+
43+
** Multiplexer
44+
Takes several channels, returns one
45+
** Tests
46+
*** go test ./... runs in parallel
47+
If it's not what you want (in this case your tests are probably suck) then use `-p` flag.

go/go.org

-14
This file was deleted.

go/modules.org

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* Что такое модули ?
2+
3+
Набор связных пакетов.
4+
Версионирован.
5+
6+
go.sum не лок файл (?)
7+
8+
если хотим поправить мажорную версию, то нужно поправить в пути. А что если 0, 1?
9+
т.е. как происходит выбор версии если в импорте она не указана, а у пакета есть версии 0, 1?
10+
11+
компроментация пакетов (?) в контексте папки вендор (есть же go.sum?)
12+
13+
нп полная задача (?)
14+
15+
16+
** Итоги

go/testify.org

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* testify
2+
run one test:
3+
`-testify.m` flag

go/to_read.md

-5
This file was deleted.

go/wire.org

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
* Wire
2+
wire - DI container with code-generation.
3+
** Сравнение Wire с остальными (Uber's dig and Facebook's inject)
4+
Wire использует кодогенерацию, вместо runtime-reflection.
5+
Преимущества:
6+
- проще разбираться и дебажить, значительно меньше магии
7+
- будет ругаться при компиляции на лишние/отсутствующие зависимости
8+
- не нужно выдумывать имена для объектов контейнера
9+
- сгенерированный код -- обычный читаемый Go-код. Который из коробки поддерживается стандартным тулингом (
10+
поиск использования, объявления, переименования, ...)
11+
12+
** Основные понятия (concepts)
13+
*** Provider
14+
Regular Go function that returns value. Written by hand.
15+
Like a constructor (?).
16+
*** Injector
17+
You write injector signature by hand (some func containing ~wire.Build~), then after
18+
running ~wire~ in app directory you get generated injector.
19+
20+
Arguments to wire.Build are the same as wire.NewSet: they form a provider set.
21+
22+
Any non-injector declarations found in a file with injectors will be copied into the generated file.
23+
24+
** API
25+
*** wire.Struct()
26+
have to use ~new(Smth)~, not ~&Smth{}~
27+
28+
use ~wire.Struct(new(Smth), for injecting all fields)
29+
30+
31+
*** ProviderSet
32+
33+
** Resources
34+
Введение: https://blog.golang.org/wire
35+
АПИ: https://godoc.org/github.com/google/wire
36+
Github: https://github.com/google/wire
37+
Tutorial: https://github.com/google/wire/tree/master/_tutorial
38+
Docs: https://github.com/google/wire/tree/master/docs
39+
Big sample application: https://github.com/google/go-cloud/tree/master/samples/guestbook

graphql.org

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* Queries
2+
Executed in parallel
3+
4+
* Mutaions
5+
Executed sequentially
6+
7+
* Frontend
8+
https://dev-blog.apollodata.com/the-concepts-of-graphql-bc68bd819be3
9+
** libs
10+
*** Apollo Client
11+
*** Relay

kafka.org

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* kafka
2+
** Therminology
3+
- topic
4+
- partition
5+
- broker
6+
- cluster
7+

kibana.org

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* field like
2+
use "*desired query*"

kindle.org

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SELECT strftime('%Y-%m', datetime(timestamp/1000, 'unixepoch')) as month, count(word) FROM words group by month order by month;

0 commit comments

Comments
 (0)