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
obj-m += lkm_hello1.o | |
KDIR ?= /lib/modules/$(shell uname -r)/build | |
all: | |
make -C $(KDIR) M=$(PWD) modules | |
clean: | |
make -C $(KDIR) M=$(PWD) clean |
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
#!/usr/bin/env bash | |
# by: anryko | |
# date: 2017.03.12 | |
# description: Script to backup mysql databases on Debian based OS | |
set -e | |
set -o pipefail | |
umask 0077 | |
trap cleanup ERR INT TERM EXIT |
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
Change dir to source directory and run: | |
$ docker run \ | |
-it \ | |
--rm \ | |
--name gcc \ | |
-v $PWD:/mnt \ | |
-p 9090:9090 \ | |
gcc bash -c 'cd /mnt && make && ./a.out' | |
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
--- | |
- name: test | |
hosts: localhost | |
connection: local | |
gather_facts: False | |
vars: | |
listeners: | |
- Protocol: HTTP | |
# Port: 80 |
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
# x → {'a': 111, 'b': 222, 'c': 333} | |
- set_fact: | |
x: "{{ x | d({}) | combine({item.0: item.1}) }}" | |
with_together: | |
- ['a', 'b', 'c'] | |
- [111, 222, 333] | |
# y → [{'a':123}, {'b':456}, {'c':789}] | |
- set_fact: | |
y: "{{ y | d([]) | union([{item.0: item.1}]) }}" |
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
- set_fact: | |
set_filter: 'aws_' | |
# set_envs: [{ 'AWS_PROFILE': <value>}, {'AWS_REGION': <value>}, ...] | |
- set_fact: | |
set_envs: "{{ set_envs | d([]) | union([{ item.split('=', 1)[0]: item.split('=', 1)[1] }]) }}" | |
when: item.startswith(set_filter | upper) | |
with_items: "{{ lookup('pipe', 'env').split('\n') }}" | |
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
iptables -t filter -I OUTPUT -d 169.254.169.254 -j EC2 | |
iptables -N EC2 | |
iptables -A EC2 -m owner --uid-owner root -d 169.254.169.254 -j ACCEPT | |
iptables -A EC2 -j REJECT --reject-with icmp-host-unreachable |
Start container from ansible git root:
docker run \
-it \
-v $PWD:/srv \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /srv \
fedora bash