Skip to content

Instantly share code, notes, and snippets.

View electrocucaracha's full-sized avatar

Victor Morales electrocucaracha

View GitHub Profile
@electrocucaracha
electrocucaracha / ParticipantSelector.java
Created April 9, 2014 04:00
This program helps to choose a volunteer from a list of students.
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class ParticipantSelector {
@electrocucaracha
electrocucaracha / LineCounter.java
Created April 9, 2014 14:07
Write a Java program that takes a list of filenames on the command line and prints out the number of lines in each file. The program should create one thread for each file and use these threads to count the lines in all the files at the same time. Use java.io.LineNumberReader to help you count lines. You'll probably want to define a LineCounter …
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.LineNumberReader;
public class LineCounter extends Thread {
private static final String FOLDER_PATH = "C:\\temp";
@electrocucaracha
electrocucaracha / .bashrc
Last active August 1, 2018 22:25
releng-xci helper functions
# OPNFV
export XCI_BUILD_CLEAN_VM_OS=false
function ssh_xci {
ssh -o StrictHostKeyChecking=no -i ~/releng-xci/xci/scripts/vm/id_rsa_for_dib -l devuser ${1:-ubuntu}_xci_vm
}
function tail_xci {
ssh -o StrictHostKeyChecking=no -i ~/releng-xci/xci/scripts/vm/id_rsa_for_dib -l devuser ${1:-ubuntu}_xci_vm tail -f /home/devuser/releng-xci/xci/${2:-xci-deploy.log}
}
function pull_xci {
@electrocucaracha
electrocucaracha / post_provision.sh
Last active August 7, 2018 13:57
Bash script that pull latest ClearLinux image and starts a VM thru Libvirt client
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
@electrocucaracha
electrocucaracha / ClearLinux.yml
Last active May 20, 2019 18:07
These are the changes required for compiling Kata containers kernet with QAT
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2019 Intel Corporation
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
qat_driver_pkgs:
@electrocucaracha
electrocucaracha / podman.patch
Last active June 12, 2019 22:31
Podman change
commit ef164679af86749aa5edc660f9fb13235bd6c234
Author: Victor Morales <victor.morales@intel.com>
Date: Thu May 30 14:43:55 2019 -0700
Remove local registry
diff --git a/vagrant/installer.sh b/vagrant/installer.sh
index 58a0a5c..252c8b2 100755
--- a/vagrant/installer.sh
+++ b/vagrant/installer.sh
@electrocucaracha
electrocucaracha / mgmt-net.md
Last active September 9, 2019 19:34
Electroucucaracha's IP address management

Electrocucaracha IPAM

This document pretends to manually track the CIDRs used by my projects to avoid any conflict in a server.

Project Name Networks CIDR Host Min Host Max Broadcast
OpenStack MultiNode mgmt-net 192.168.122.0/27 192.168.122.1 192.168.122.30 192.168.122.31
Kubernetes QAT Envoy qat-mgmt-net 192.168.123.0/27 192.168.123.1 192.168.123.30 192.168.123.31
K6board k6-mgmt-net 192.168.124.0/30 192.168.124.1 192.168.124.2 192.168.124.3
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2020
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
@electrocucaracha
electrocucaracha / deploy.sh
Created July 17, 2020 15:59
Customize kubernetes scheduler using KinD deployment tool
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c)
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
@electrocucaracha
electrocucaracha / main.go
Created September 10, 2020 20:24
P-GW NSM implementation
// Copyright 2020
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software