Skip to content

Instantly share code, notes, and snippets.

View elnemesisdivina's full-sized avatar
🤪
Working from home

Ray elnemesisdivina

🤪
Working from home
View GitHub Profile
@elnemesisdivina
elnemesisdivina / My jupyter log
Created April 20, 2019 02:21
General ML list of commands
docker pull jupyter/notebook
docker run --rm -it -p 8888:8888 -v ~/notebooks:/home/jovyan jupyter/scipy-notebook
#Loign token
http://(77ac7f6b4059 or 127.0.0.1):8888/?token=cf05cf1f97423bbe47f9e7ec08fb6875ab09
# This tells kubecfg to read its config from the local directory
export KUBECONFIG=./kubeconfig
# Looking at the cluster
kubectl get nodes
kubectl get pods --namespace=kube-system
# Running a single pod
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard
kubectl get pods
!! Colorscheme
! special
*.foreground: #93a1a1
*.background: #141c21
*.cursorColor: #afbfbf
! black
*.color0: #263640
*.color8: #4a697d
@elnemesisdivina
elnemesisdivina / bubble sort by vRay
Created January 29, 2020 17:14
bubble sort python exercise
#list can be asked by the user but for testitn propouses and rush I leave it as hard code
lists = [54,26,93,17,77,31,44,55,20]
n = len(lists)
for j in range(n):
for i in range(n-1):
liststmp = lists[i]
if lists[i] > lists[i+1]:
lists[i] = lists[i+1]
lists[i+1] = liststmp
@elnemesisdivina
elnemesisdivina / piramide
Created January 30, 2020 22:48
piramide de asteriscos
cF = 0
cC = 0
while cF < 5:
while cC < cF:
print("*", end="")
cC += 1
cF += 1
cC = 0
print()
@elnemesisdivina
elnemesisdivina / aritmetica.py
Created February 6, 2020 02:27
manual calculator
#def functions for operations
def sumar(operando1, operando2):
return (operando1 + operando2)
def multiplicar(operando1, operando2):
return operando1 * operando2
def dividir(operando1, operando2):
try:
if operando2 != 0:
return operando1 / operando2
elif operando2 == 0:
@elnemesisdivina
elnemesisdivina / Persona.py
Created February 12, 2020 19:25
ceracion de archivo de personas en un file
import io
class persona:
###sobrecarga de metodo init de default
def __init__(self, nombre, apellidoPaterno, edad, sexo):
self.__nombre = nombre
self.__apellidoPaterno = apellidoPaterno
self.__edad = edad
self.__sexo = sexo
@elnemesisdivina
elnemesisdivina / pcapbpfc.c
Created March 16, 2020 22:13 — forked from oro350/pcapbpfc.c
BPF compiler using libpcap
#include <pcap.h>
#include <unistd.h>
int main(int argc, char **argv)
{
struct bpf_program bpfprog;
int dflag = 0;
int c;
while ((c = getopt(argc, argv, "d")) != -1) {
@elnemesisdivina
elnemesisdivina / rawfilter.c
Created March 16, 2020 22:13 — forked from oro350/rawfilter.c
SO_ATTACH_FILTER usage
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netpacket/packet.h>
@elnemesisdivina
elnemesisdivina / rawfilter.c
Created March 16, 2020 23:54 — forked from 2opremio/rawfilter.c
BPF test: filter tcp segments to port 80
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <netpacket/packet.h>