Author Archives: bullgare
docker-compose for starting aerospike and memcache
Place this config wherever you like (in your project) — for instance, ~/myproj/docker/docker-compose.yml:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
version: "2" services: #aerspike as: image: aerospike/aerospike-server volumes: - ./aerospike/etc:/opt/aerospike/etc ports: - 3000:3000 command: [asd, --config-file, /opt/aerospike/etc/docker.conf] memcached: image: memcached ports: - 11211:11211 volumes: #volume for etcd dicovery-data: driver: local #volume for database db-data: driver: local |
And this config for aerospike should be placed in a directory ~/myproj/docker/aerospike/etc/docker.conf After that you should run it like that:
1 2 |
cd ~/myproj/docker docker-compose up -d |
When you finished, just run:
1 2 |
cd ~/myproj/docker docker-compose down |
https://docs.docker.com/compose/reference/up/
Container insights for golang engineer (k8s docker CPU throttling)
We’ve run into problems on my work when k8s limits cpu to few processors (throttling), while go application can see all of them (setting GO_MAX_PROCS to maximum CPUs available) and go’s scheduler is going crazy because of that during highload (like stress-tests). It is caused by scheduling for, let’s say, 40 processors while you have …
Proxies and traffic sniffers for mac os
That’s a great one but it’s not cheap — https://www.charlesproxy.com/. They say this one is good as well and free — https://mitmproxy.org/. But I don’t like the interface.
React component lifecycle methods
Flow of lifecycle methods I checked it with react 16.2.0. On a client When component is rendered for the first time
1 2 3 4 |
constructor componentWillMount render componentDidMount |
How to count resource usage in linux
1 |
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 5 |
It will output something like this:
1 2 3 4 5 6 |
PID PPID CMD %MEM %CPU 2591 2113 /usr/lib/firefox/firefox 7.3 43.5 2549 2520 /usr/lib/virtualbox/Virtual 3.4 8.2 2288 1 /home/gacanepa/.dropbox-dis 1.4 0.3 1889 1543 c:\TeamViewer\TeamViewer.ex 1.0 0.2 2113 1801 /usr/bin/cinnamon 0.9 3.5 |
Javascript mocking frameworks
Classical one — http://sinonjs.org/. TestDouble — https://github.com/testdouble/testdouble.js/blob/master/README.md There is a good video on using TestDouble from it’s creator: https://www.youtube.com/watch?v=nH8EnmdEBj4
Подборка статей по устройству javascript
http://dmitrysoshnikov.com/
Запустить memcached в докере
Под мак.
1 2 3 4 5 6 |
docker pull memcached:alpine docker run --name memcached -d --restart=always --publish 11211:11211 memcached:alpine telnet localhost 11211 ctrl+] docker ps docker stop <id> |
https://hub.docker.com/_/memcached/ https://github.com/sameersbn/docker-memcached Вдогонку — как смотреть статистику в мемкэше.
1 2 3 4 5 6 |
telnet localhost 11211 > stats > stats items > set key 0 900 4 data > get key |
https://blog.elijaa.org/2010/05/21/memcached-telnet-command-summary/ http://www.alphadevx.com/a/90-Accessing-Memcached-from-the-command-line
Собеседование. Что расспросить о компании
https://medium.freecodecamp.org/how-to-interview-your-interviewers-f8f65ac57b80 Top questions What is your workflow? From idea to production. How does your usual day look like? What is the most annoying technical thing that bothers you on daily basis HR interview questions: Who are the other major players in this space? What do we have that they don’t? Why have the last few …
Книги по PostgreSQL
Хорошая бесплатная книга на русском языке про оптимизацию — Работа с PostgreSQLнастройка и масштабирование, А. Ю. Васильев. Про разработку и синтаксис — PostgreSQL Development Essentials. Manpreet Kaur, Baji Shaik: на google books можно ознакомиться и скачать на scribd