Skip to content

Instantly share code, notes, and snippets.

🎱
To be or not to be...

Sergey Kuzmich sergeykuzmich

🎱
To be or not to be...
View GitHub Profile
@sergeykuzmich
sergeykuzmich / CV.html
Last active Jun 11, 2019
Curriculum vitae
View CV.html
<!DOCTYPE html><html><head><meta charset="utf-8"><title>CV.md</title><style>@charset "UTF-8";@import 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha2/katex.min.css';code{color:#c7254e;background-color:#f9f2f4;border-radius:4px}code,kbd{padding:2px 4px}kbd{color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{display:block;margin:0 0 10px;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th{padding:8px;line-height:1.4285714;border-top:1px solid #ddd}.table>thead>tr>td,.table>tbody>tr>th,.table>tbody>tr>td,.table>tfoot>tr>th,.table>tfoot>tr>td{padding:8px;line
@sergeykuzmich
sergeykuzmich / .gitconfig
Created Apr 7, 2019
.gitconfig aliases for ignore-on-commit feature
View .gitconfig
[alias]
hide = update-index --assume-unchanged
unhide = update-index --no-assume-unchanged
show-hidden = !git ls-files -v | grep '^h' | cut -c3-
@sergeykuzmich
sergeykuzmich / service.tf
Created Feb 12, 2019
Terraform Module usage
View service.tf
module "project_name" {
source = "git@github.com:sergeykuzmich/tfmodule-do_wordpress.git"
domain = "project_domain.com"
}
@sergeykuzmich
sergeykuzmich / main.tf
Last active Feb 13, 2019
Droplet definition with custom user_data
View main.tf
resource "digitalocean_domain" "default" {
name = "${var.domain}"
ip_address = "${digitalocean_droplet.default.ipv4_address}"
}
resource "digitalocean_droplet" "default" {
name = "${coalesce(var.droplet_name, var.domain)}"
image = "wordpress-18-04"
region = "${var.droplet_region}"
size = "${var.droplet_size}"
@sergeykuzmich
sergeykuzmich / user_data.tf
Last active Feb 13, 2019
Domain setup template_file definition
View user_data.tf
data "template_file" "user_data" {
template = "${file("${path.module}/user_data.tpl")}"
vars = {
domain = "${var.domain}"
}
}
@sergeykuzmich
sergeykuzmich / user_data.tpl
Last active Feb 13, 2019
Domain setup template_file
View user_data.tpl
#!/bin/bash
mv /var/www/html /var/www/html.old
mv /var/www/wordpress /var/www/html
chown -Rf www-data:www-data /var/www/html
sed -i "s/\$domain/${domain}/g" /etc/apache2/sites-enabled/000-default.conf
a2enconf block-xmlrpc
service apache2 restart
@sergeykuzmich
sergeykuzmich / user_data.sh
Last active Feb 13, 2019
Simple DigitalOcean domain setup script
View user_data.sh
#!/bin/bash
mv /var/www/html /var/www/html.old
mv /var/www/wordpress /var/www/html
chown -Rf www-data:www-data /var/www/html
sed -i "s/\$domain/$dom/g" /etc/apache2/sites-enabled/000-default.conf
a2enconf block-xmlrpc
service apache2 restart
@sergeykuzmich
sergeykuzmich / wp_setup.sh
Created Feb 12, 2019
Default DigitalOcean WordPress setup script
View wp_setup.sh
#!/bin/bash
#
# WordPress activation script
#
# This script will configure Apache with the domain
# provided by the user and offer the option to set up
# LetsEncrypt as well.
# Enable WordPress on firstlogin
mv /var/www/html /var/www/html.old
@sergeykuzmich
sergeykuzmich / outputs.tf
Last active Feb 13, 2019
DigitalOcean Terraform module variables & outputs definition
View outputs.tf
output "price_monthly" {
value = "${digitalocean_droplet.default.price_monthly}"
}
output "ipv4_address" {
value = "${digitalocean_droplet.default.ipv4_address}"
}
@sergeykuzmich
sergeykuzmich / provider.tf
Last active Feb 11, 2019
DigitalOcean provider definition
View provider.tf
provider "digitalocean" {}
You can’t perform that action at this time.