This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@foo block]# strace -f -s2048 -eopen fdisk -l |& grep /sys/dev/block/ | |
open("/sys/dev/block/8:0", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/8:0", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:0", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:0", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:1", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:1", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:2", O_RDONLY|O_CLOEXEC) = 5 | |
open("/sys/dev/block/253:2", O_RDONLY|O_CLOEXEC) = 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Surveying the Linux Kernel, let's look more at /proc, /sys, and device files. Virtual Filesystems that we talked about proc and sysfs that means these virtual filesystems don't store their contents on a disk, more accurately they generate their contents when you ask for it. When you cat a file in proc or sys, there's some corresponding function in the kernel that's called to generate the contents. These are not RAM-based filesystems. RAM filesystems store their contents in RAM. | |
Virtual filesystems generate their contents when you ask for it, like callback functions. proc got its name from process, and the proc filesystem is normally mounted on /proc. That's done early on in the boot process. proc contains lots of process information, as can be expected, plus lots, lots more. This essentially is information about the state of the kernel. A lot of utilities get information about the kernel from the proc directory. | |
The ps command, process status, gets its information from the proc directory. A real important |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@foo block]# cat /proc/cmdline | |
BOOT_IMAGE=/vmlinuz-3.10.0-327.4.4.el7.x86_64 root=/dev/mapper/centos-root ro rd.lvm.lv=centos/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet LANG=en_US.UTF-8 | |
[root@foo block]# cat /proc/partitions | |
major minor #blocks name | |
11 0 1048575 sr0 | |
8 0 976762584 sda | |
8 1 2097152 sda1 | |
8 2 973832192 sda2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The issue may have to do with the installed version of libsolv not supporting bzip2 compression. Like me, you may not have the most recent version being installed because setting priorities in the repo config files. | |
Failed to open: /var/cache/dnf/x86_64/7/x86_64/7/epel/...xml.bz2 | |
See bug report 1258416. | |
libsolv-0.6.14-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. | |
The libsolv installed from the CentOS base repository is 0.6.11-1.el7, but the one in epel is 0.6.14-1.el7. | |
yum --showduplicates --disablerepo=base list libsolv | |
Installed Packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import boto3 | |
import json | |
import logging | |
from base64 import b64decode | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REMEMBER !!! | |
TO CONNECT TO A REMOTE HOST IN THE OTHER VPC, WE'D NEED TO OPEN UP THE CORRESPONDING PORT ON THE VPN-TUNNEL SERVER SECURITY GROUP ON THE SAME SIDE AS WELL AS ONLY THEN THE TUNNEL INSTANCE WILL ALLOW THE FLOW OF TRAFFIC TO THE OTHER SIDE. REPEAT THE SAME STEPS FOR THE OTHER SIDE TOO. | |
MUM - TUNNEL SERVER - sg | |
TCP 22 0.0.0.0/0 | |
TCP | |
51 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkfifo /tmp/mysql-pipe | |
mysql mydb </tmp/mysql-pipe & | |
( | |
echo "LOCK TABLES mytable READ ;" 1>&6 | |
echo "Doing something " | |
echo "UNLOCK tables;" 1>&6 | |
) 6> /tmp/mysql-pipe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MASTER | |
MariaDB [(none)]> create user 'replication'@'%'identified by 'password'; | |
Query OK, 0 rows affected (0.00 sec) | |
MariaDB [(none)]> grant replication slave on *.* to replication | |
-> ; | |
Query OK, 0 rows affected (0.00 sec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 yum install -y firewalld | |
2 systemctl enable firewalld | |
3 systemctl start firewalld | |
4 systemctl status firewalld | |
5 firewall-cmd --get-default-zone | |
6 firewall-cmd --list-zones | |
7 firewall-cmd --list-zone | |
8 firewall-cmd list-zone | |
9 firewall-cmd list-zones | |
10 firewall-cmd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At the end these are steps you need to have a docker server with OverlayFS as backend storage on AWS/EC2 | |
Fire up an 'ubuntu 14.04' server on AWS/EC2 | |
Upgrade kernel to 3.18 | |
Install Docker on server | |
Create an EBS volume | |
Attach new volume to created server | |
Create a file system on volume: | |
6.1. Connect to your instance and run lsblk to find available disk devices and their mount points. | |
6.2. From the result of lsblk command, choose device that is attached, but not been mounted yet (e.g. xvdf, ...). devicename would be the selected device with a /dev/ as a prefix (e.g. /dev/xvdf,...) |