Skip to content

Instantly share code, notes, and snippets.

View iamsimakov's full-sized avatar
🍀
Yeee))

iamsimakov

🍀
Yeee))
View GitHub Profile
@iamsimakov
iamsimakov / mongodb-ssl.sh
Created April 28, 2020 08:07 — forked from kevinadi/mongodb-ssl.sh
Script to create self-signed CA certificates, server certificates, and client certificates for testing MongoDB with SSL
#!/bin/sh
# Generate self signed root CA cert
openssl req -nodes -x509 -newkey rsa:2048 -keyout ca.key -out ca.crt -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=root/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Generate server cert to be signed
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=AU/ST=NSW/L=Sydney/O=MongoDB/OU=server/CN=`hostname -f`/emailAddress=kevinadi@mongodb.com"
# Sign the server cert
@iamsimakov
iamsimakov / mysql-docker.sh
Created November 19, 2019 13:00 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
ra_ru = {
action: {
delete: 'Удалить',
show: 'Просмотр',
list: 'Список',
save: 'Сохранить',
create: 'Создать',
edit: 'Редактировать',
cancel: 'Отмена',
refresh: 'Обновить',
@iamsimakov
iamsimakov / mysql-restore-root.sh
Last active June 25, 2019 10:11
Mysql restore empty root password after update
#!/bin/bash
function log {
echo $@
}
function stop_mysql_server {
log 'Stopping'
sleep 2
sudo /etc/init.d/mysql stop