Skip to content

Instantly share code, notes, and snippets.

@andreybleme
andreybleme / geocoding.py
Created November 6, 2024 12:12
Script python que imprime geocoordenadas apartir de uma lista de endereços
from geopy.geocoders import Nominatim
from geopy.exc import GeocoderTimedOut
import time
# Function to get coordinates from an address
def get_coordinates(address):
geolocator = Nominatim(user_agent="geoapiExercises")
try:
location = geolocator.geocode(address)
if location:
@andreybleme
andreybleme / Dockerfile
Last active October 18, 2022 03:14
Minimal Dockerfile container for running BPF programs using libbpf
FROM ubuntu:latest
RUN apt-get update && \
apt-get install -y build-essential git cmake \
zlib1g-dev libevent-dev \
libelf-dev llvm \
clang libc6-dev-i386
RUN mkdir /src && \
git init
@andreybleme
andreybleme / ryu_controller_learning_switch.py
Last active June 30, 2021 03:21
Ryu Controller to install flows in L2 switches - Network Systems DCC/UFMG (student Lucas Andrey Caldeira Bleme), prof Marcos Augusto Menezes Vieira
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_0
from ryu.lib.mac import haddr_to_bin
from ryu.lib.packet import packet
from ryu.lib.packet import ethernet
from ryu.lib.packet import ether_types
@andreybleme
andreybleme / resenhas-paper.txt
Last active February 19, 2022 21:24
Modelo simples para escrita de resenhas de artigos científicos, disponibilizada pelo professor Marcos Augusto Menezes Vieira
1. Problema
Discutir precisamente qual o problema o artigo quer resolver.
2. Abordagem da solução
Qual é a principal ideia atrás da solução? Qual a contribuição intelectual da solução?
3. Abordagem de Avaliação
Como os autores avaliaram o trabalho? Existe alguma novidade na metodologia de avaliação?
4. Quais são os resultados principais?
@andreybleme
andreybleme / test_ping.c
Created February 11, 2021 00:07
Send ping request using Caladan - Advanced Operating Systems DCC/UFMG (Lucas Andrey Caldeira Bleme)
/*
* test_ping.c - sends ping echo requests
*/
#include <stdio.h>
#include <base/log.h>
#include <net/ping.h>
#include <runtime/runtime.h>
#include <runtime/timer.h>
@andreybleme
andreybleme / basicfwd.c
Last active January 20, 2021 01:42
DPDK application to reply ICMP packets received in a Linux server - Advanced Operating Systems DCC/UFMG (Lucas Andrey Caldeira Bleme)
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2010-2015 Intel Corporation
*/
#include <stdint.h>
#include <inttypes.h>
#include <rte_eal.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
#include <rte_cycles.h>
@andreybleme
andreybleme / e2e_code_pipeline.yaml
Created November 28, 2020 20:12
andreybleme.com | Running Cypress tests in parallel at AWS Codepipeline CI, Cloudwatch event
EndToEndTestCronJob:
DependsOn: CodePipelineEndToEndTestingRoot
Type: 'AWS::Events::Rule'
Properties:
ScheduleExpression: 'cron(0 22 * * ? *)'
State: ENABLED
Targets:
- Arn: !Sub arn:aws:codepipeline:${AWS::Region}:${AWS::AccountId}:${CodePipelineEndToEndTestingRoot}
RoleArn:
Fn::ImportValue:
@andreybleme
andreybleme / e2e_code_pipeline.yaml
Last active November 28, 2020 19:30
andreybleme.com | Running Cypress tests in parallel at AWS Codepipeline CI, buildspec
BuildSpec: |
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
commands:
- echo ">>> global installing dependencies"
- npm install -g typescript lerna
pre_build:
@andreybleme
andreybleme / e2e_code_pipeline.yaml
Last active November 28, 2020 19:59
andreybleme.com | Running Cypress tests in parallel at AWS Codepipeline CI
AWSTemplateFormatVersion: 2010-09-09
Description: >
This stack creates a codepipeline for running the end-to-end tests
Last Modified: 08.10.2020
Author: Lucas Bleme
Parameters:
Owner:
Description: Enter Team or Individual Name Responsible for the Stack.
Type: String
Default: Lucas Bleme
@andreybleme
andreybleme / address.spec.js
Created March 28, 2020 00:34
andreybleme.com | Boosting Cypress end-to-end Tests
it('Should choose an address', () => {
cy.visit(urls.contact);
cy.setGooglePlaceAddress('billing_address', 'Pretty street');
...
});