Skip to content

Instantly share code, notes, and snippets.

@panperla
panperla / forceipv4.md
Created May 28, 2019 12:10
Force ipv4 for apt
echo "Acquire::ForceIPv4 true;" >> /etc/apt/apt.conf.d/99force-ipv4

Creating swap partition in a file

#!/bin/bash
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon -s
@panperla
panperla / crawling-all-pages-on-the-site.md
Created November 15, 2016 17:24
Crawling pages of the site and printing out url to stdout

Crawling all pages on the site

wget --spider --force-html -r -l2 http://example.com 2>&1   | grep '^--' | awk '{ print $3 }'   | grep -v '\.\(css\|js\|png\|gif\|jpg\|jpeg\)$'|uniq 
@panperla
panperla / supervisor-mysqld-galera-installation.md
Last active November 14, 2016 14:44
Supervisor installation and setup for galera node - ubuntu 16.04

Supervisor installation for galera node

  1. We need to install supervisor daemon
  2. Create /etc/supervisor/conf.d/mysql.conf config file
  3. Restart supervisor
apt-get install supervisor -y
echo "[program:mysqld]
command=/usr/bin/pidproxy /var/run/mysqld/mysqld.pid /usr/sbin/mysqld --pid-file=/var/run/mysqld/mysqld.pid
stdout_logfile=/var/log/supervisor/%(program_name)s.log

Setting up raid 1 using mdadm

In order to set up software raid we need to install mdadm tools (Ubuntu/Debian)

apt-get install mdadm

Now for setting up raid one using two drives for example /dev/sdd and /dev/sdc we are issuing the following command

mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mkfs.ext4 /dev/md2
@panperla
panperla / docker-install-ubuntu-16.04.md
Last active September 30, 2018 17:19
Installation of docker engine on ubuntu-16.04

Setting up docker on ubuntu 16.04

HOST SECTION

Installation of required packages, adding repository keys, updating repositiory and packages list

sudo apt-get update && sudo apt-get install apt-transport-https ca-certificates curl -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
@panperla
panperla / ipv6_proxmox_debian_jessie_ovh.md
Last active November 5, 2023 16:19
Setting up IPv6 with Proxmox 4.3 - Debian jessi based on ovh template installation

Setting IPv6 for HOST machine working on Debian jessi and GUEST VM using Proxmox 4.3 installation from ovh template

HOST SECTION

Installation process is giving us ready to use machine which we can access via SSH (port 22) or web interface (port 8006) with setup network interfaces. Unfortunately during the process of testing IPv6 on vanilla Proxmox 4.3 delivered by OVH doesn't work out of the box.

ping6 ipv6.google.com 
connect: Network is unreachable