Skip to content

Instantly share code, notes, and snippets.

View nikelborm's full-sized avatar
🐢
chillin'

Eva nikelborm

🐢
chillin'
View GitHub Profile
@codedokode
codedokode / Как хранить в БД древовидные структуры (паста).md
Last active April 21, 2024 11:27
Как хранить в БД древовидные структуры

Эта версия статьи устарела. Новая версия статьи перенесена по адресу: https://github.com/codedokode/pasta/blob/master/db/trees.md


Как хранить в БД древовидные структуры

Те, кто знают английский, могут сразу перейти сюда: http://stackoverflow.com/questions/4048151/what-are-the-options-for-storing-hierarchical-data-in-a-relational-database

Древовидные структуры - это такие структуры, где есть родители и дети, например, каталог товаров:

@shamil
shamil / mount_qcow2.md
Last active June 17, 2024 17:27
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@alister
alister / DockerRedis_ExportImport_Dump.sh
Created January 27, 2015 21:46
Example of creating a Docker data volume, exporting it, and re-importing it to a completely fresh container
# Create the container - we run 'echo' in the container, and reuse the same as we will be running later
docker run -d -v /data --name redis.data dockerfile/redis echo Data-only container for Redis
# the data container doesn't show up - nothing is running
docker ps
# will show 'redis.data', but as stopped
docker ps -a
# start redis, attach to 'redis.data'
docker run -d -p 6379:6379 --volumes-from redis.data --name ca.redis.1 dockerfile/redis
@michalczukm
michalczukm / .gitignore
Created August 5, 2015 08:58
WPF projects .gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
@ygotthilf
ygotthilf / jwtRS256.sh
Last active June 27, 2024 16:13
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@Imater
Imater / HighMiddle примеры рекомендованных знаний.md
Last active April 29, 2024 22:32
Рекомендованные знания для React разработчика high middle

Рекомендованные знания для React разработчика high middle

React

  • Варианты создания компонента (pureFunction, class, createElement)
  • pureRender - знания принципа ререндера Реакт приложений при изменениях хранилищ, какие props приводят к неоправданному перерендеру, кеширование результатов функций
  • Контейнер - его назначение, основные задачи, типовая структура
  • Глупый компонент - его назначение, основные задачи, принцип разбиения на компоненты, функции
  • React router - как создавать синхронный, асинхронный роутер, как отложить рендер компонента в Route на время загрузки, как работает функция match, как считывать параметры url ?q=1, #q=1 как их устанавливать при .
  • Последовательность DOM render, последовательность вызова всех функций компонента, например componentDidMount, componentWillMount, componentWillReceiveProps и всех остальных. Как использовать ref, в какой момент он вызывается.
@vorozhba
vorozhba / Как удалить commit в Github.txt
Last active June 24, 2024 07:39
Как удалить commit в Github
1. Получаем хэш-код коммита, к которому хотим вернуться.
2. Заходим в папку репозитория и пишем в консоль:
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a
$ git push --force
@MaxXor
MaxXor / btrfs-guide.md
Last active June 10, 2024 15:46
Btrfs guide to set up an LUKS-encrypted btrfs raid volume with included maintenance & recovery guide

Encrypted Btrfs storage setup and maintenance guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
@joseluisq
joseluisq / resize_disk_image.md
Last active June 26, 2024 20:20
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

---
- hosts: legacyservers
gather_facts: yes
become: yes
tasks:
# Use a block to perform tasks conditionally—only if running Ubuntu 18.04.
- block: