Skip to content

Instantly share code, notes, and snippets.

@elfarsaouiomar
elfarsaouiomar / Vagrantfile
Created August 25, 2022 06:19
Multiple Vagrant VMs in One Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "web" do |web|
web.vm.box = "precise64"
web.vm.hostname = 'web'
web.vm.box_url = "ubuntu/trusty64"
web.vm.network :private_network, ip: "192.168.56.101"
web.vm.network :forwarded_port, guest: 22, host: 10122, id: "ssh"
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg">
<rect width="300" height="100" style="fill:rgb(0,0,255);stroke-width:3;stroke:rgb(0,0,0)" />
<script type="text/javascript">
alert("Hello");
</script>
</svg>
---
- name: Update Config
hosts: ServersG1
gather_facts: false
tasks:
- name: Add API key to thes config file
lineinfile:
path: ~/config.ini
line: "API_KEY={{ api_key }}"
---
- name: Update Config
hosts: ServersG1
gather_facts: false
vars_prompt:
- name: api_key
prompt: Enter the API key
tasks:
- name: Add API key to thes config file
# Queue implementation in Python
class Queue:
def __init__(self):
self.queue = []
# Add an element
def enqueue(self, item):
@elfarsaouiomar
elfarsaouiomar / docker-compose.yaml
Last active March 2, 2022 08:19
docker-compose.yaml
version: "3.7"
services:
app:
user: www-data
image: omarelfarsaoui/nuxtjs-app:v1
ports:
- "9004:9004"
env_file:
- .env