Skip to content

Instantly share code, notes, and snippets.

View ghaiklor's full-sized avatar

Eugene Obrezkov ghaiklor

View GitHub Profile
jmp $
times 510 - ($ - $$) db 0
dw 0xAA55
<match **>
@type copy
<store>
@type gelf
host "#{ENV['GELF_HOST']}"
port "#{ENV['GELF_PORT']}"
protocol "#{ENV['GELF_PROTOCOL']}"
<buffer>
flush_at_shutdown true
<match **>
@type copy
<store>
@type gelf
host "#{ENV['GELF_HOST']}"
port "#{ENV['GELF_PORT']}"
protocol "#{ENV['GELF_PROTOCOL']}"
</store>
</match>
<source>
@type tail
tag kubernetes.containers.*
path /var/log/containers/*.log
  refresh_interval 2
  read_from_head true
  pos_file /var/log/fluentd-containers.log.pos
  rotate_wait 5
  enable_watch_timer true
  enable_stat_watcher false
@ghaiklor
ghaiklor / config.yml
Created August 4, 2018 10:40
CircleCI configuration for mono-repository
version: 2
aliases:
- &docker_environment
- image: circleci/node:8-stretch
- image: circleci/mongo:3.6
- image: circleci/rabbitmq:3.6.6
- &checkout
path: ~/elasticio
- &restore_cache_dependencies
name: "Restoring node_modules from the cache"
@ghaiklor
ghaiklor / math-parser.js
Last active January 14, 2018 10:39
The simplest parser for mathematical expressions with explanation
/**
* https://repl.it/@ghaiklor/The-simplest-math-parser
*
* What are we going to do?
* We are going to implement the simplest parser for mathematical expressions with parenthesis and precedence.
*
* Why?
* Just for get knowing more about software development.
*
* What will be the result of the parser?
@ghaiklor
ghaiklor / build.sh
Last active December 20, 2022 05:51
Script for getting all the sources and building second stage boot loader
# Install pre-requisites
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y build-essential
sudo apt-get install -y nasm
sudo apt-get install -y qemu
# Download the sources
curl https://gist.githubusercontent.com/ghaiklor/3ef5a07b3de1beb964555183dee18621/raw/59cb9ba42fd71631b0bc0c55e2a27c38f0e8ffaf/boot.asm > boot.asm
curl https://gist.githubusercontent.com/ghaiklor/d63e5183773770e07854b5d799ef3a44/raw/fcdc0652fa1c39c5e76379e1bd58ac49922feeeb/loader.asm > loader.asm
@ghaiklor
ghaiklor / loader.c
Created October 30, 2017 17:32
Full implementation for loader
extern void loader_main() {
for (int i = 0; i < 26; i++) {
char c = 0x41 + i;
asm(
"mov %0, %%al;"
"mov $0x0E, %%ah;"
"int $0x10;"
:
: "r" (c)
@ghaiklor
ghaiklor / loader.asm
Created October 30, 2017 17:31
Full implementation for loader entry
global _start
[bits 16]
[extern loader_main]
_start:
call loader_main
jmp $
@ghaiklor
ghaiklor / boot.asm
Created October 30, 2017 17:30
Full implementation of boot.asm
[org 0x7C00]
[bits 16]
KERNEL_OFFSET equ 0x1000
mov [BOOT_DRIVE], dl
call load_boot
call execute_boot
load_boot: