Skip to content

Instantly share code, notes, and snippets.

View sabahtalateh's full-sized avatar

Alex sabahtalateh

  • work alone
  • Russia
View GitHub Profile
@sabahtalateh
sabahtalateh / gist:709ca1611cc7c0a9ea0d5fc93538973e
Last active December 13, 2019 09:27
Install postgres from sources
Распаковываем архив
Распаковываем архив с исходными кодами PostgreSQL
student$ tar xzf /home/student/postgresql-10.0.tar.gz
student$ ls -ld /home/student/postgres*
drwxr-xr-x 6 student student 4096 окт 3 2017 /home/student/postgresql-10.0
-rw-rw-r-- 1 student student 25830653 окт 3 2017 /home/student/postgresql-10.0.tar.gz
Создание конфигурации
Если требуется повторно выполнить конфигурацию, например с другими параметрами, то предварительно нужно очистить результаты предыдущего запуска:
@sabahtalateh
sabahtalateh / mongoimport.sh
Created October 30, 2018 11:54
Mongo Import
mongoimport /tmp/tv-shows.json -d movieData -c movies --jsonArray --drop
@sabahtalateh
sabahtalateh / uf.yml
Last active June 25, 2018 10:48
Useful information
Articles:
low level:
hardware:
a https://habr.com/post/80962/
memory managment:
linux core and memory:
a https://habr.com/company/yandex/blog/250753/
v https://www.youtube.com/watch?v=bhdkFPGhxfI
a https://www.insight-it.ru/linux/2015/chto-stoit-znat-o-pamiati-v-linux/
@sabahtalateh
sabahtalateh / x86_asm.sh
Last active June 11, 2018 11:08
x86 Assembler
# Some assembler instructions
#
# x86 - Little endian architecture, bytes stores in reversed order
#
# Move (MOV)
# @@@@@@@@@@
#
# mov dst, src - Copy data from source to destination
# mov eax, 8CBh - Put 8CB number to 32-bit eax register, h at the end is for converting number to HEX representation (base 16).
# mov ecx, ebx - Copy 32-bit number from ebx to ecx.
@sabahtalateh
sabahtalateh / lsof.sh
Created May 6, 2018 11:49
lsof macos
# Combine with other protocols if needed.
# -P Prevent convertion from service name to number, -iTCP - (-i{PROTO} select given protocols),
# -sTCP:LISTEN (-s select give protocol state)
lsof -PiTCP -sTCP:LISTEN | grep {portnumber}
@sabahtalateh
sabahtalateh / docker.sh
Last active May 16, 2018 16:00
Pluralsight Docker
## Swarm
# On one of manager nodes run
docker swarm init --advertise-addr 46.161.54.215:2377 --listen-addr 46.161.54.215:2377 # --advertise-addr 46.161.54.215:2377 - Which of this machine IP's will be used for swarm. --listen-addr 46.161.54.215:2377 - IP:Port to listen command for manager nodes.
# Then to generate command to connetc as a manager run.
docker swarm join-token manager
# To generate same command for worker run.
docker swarm join-token worker
@sabahtalateh
sabahtalateh / openvpn_config.conf
Created April 10, 2018 17:07
OpenVPN config simple example on CentOS 7
# OpenVPN config simple example on CentOS 7
--------------------------------------------------------------------------------
# Server config
# /etc/openvpn/server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
@sabahtalateh
sabahtalateh / show_branches_with_commit.sh
Created March 14, 2018 12:52
show git branches with some commit
git branch --contains 0b5cb4a
@sabahtalateh
sabahtalateh / useful_bash_commands.sh
Last active June 21, 2020 10:04
Useful bash commands
## Super Hot
cd - # go to previous directory.
## Copy public key to servers that I want to be accessible to connects to me
# server1 should be configured via ~/.ssh/config like
# Host server1
# HostName 10.0.2.4
# User sabahtalateh
# Port 22
ssh-copy-id -i id_rsa.pub server1
@sabahtalateh
sabahtalateh / find_size.sh
Last active February 21, 2018 16:30
find files gt 20M
sudo find / -size +20000k -exec ls -lh {} \;
find /boot -maxdepth 1 -size +10M -exec du -h {} \;