Skip to content

Instantly share code, notes, and snippets.

View ryanbekabe's full-sized avatar
💭
Cuckoo Sandbox for identify Malware, JupyterLab for Machine Learning

ryanbekabe

💭
Cuckoo Sandbox for identify Malware, JupyterLab for Machine Learning
View GitHub Profile
@ryanbekabe
ryanbekabe / permute-stl.cpp
Created December 4, 2019 15:11 — forked from vo/permute-stl.cpp
getting permutations
//
// An example of how to generate permutations
// using STL algorithms library
//
#include <iostream>
#include <algorithm>
using namespace std;
int main () {
const int N = 8;
@ryanbekabe
ryanbekabe / python_sjt_coroutines.py
Created December 4, 2019 06:36 — forked from sahands/python_sjt_coroutines.py
Steinhaus–Johnson–Trotter (SJT) Permutation Generation Algorithm in Python using Coroutines (Generators)
from time import sleep
__author__ = "Sahand Saba"
def nobody():
while True:
yield False
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import log_loss
import numpy as np
x = np.array([-2.2, -1.4, -.8, .2, .4, .8, 1.2, 2.2, 2.9, 4.6])
y = np.array([0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0])
logr = LogisticRegression(solver='lbfgs')
logr.fit(x.reshape(-1, 1), y)
import boto3
from botocore.exceptions import NoCredentialsError
ACCESS_KEY = 'AxKIAI2772U77ALJUKS5xA'
SECRET_KEY = 'bxBVLKyrc2GwJuNGBE8u92AU5W4LyBiZrpIU4q9rxK'
def upload_to_aws(local_file, bucket, s3_file):
s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,
aws_secret_access_key=SECRET_KEY)
# Copyright (C) 2012-2013 Claudio Guarnieri.
# Copyright (C) 2014-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import datetime
import hashlib
import io
import multiprocessing
import os
@ryanbekabe
ryanbekabe / pysay.py
Created August 24, 2019 12:23
Python Text to Speech
import pyttsx3
import engineio
engineio = pyttsx3.init()
voices = engineio.getProperty('voices')
engineio.setProperty('rate', 130) # Aquí puedes seleccionar la velocidad de la voz
engineio.setProperty('voice',voices[0].id)
def speak(text):
engineio.say(text)
@ryanbekabe
ryanbekabe / tea.py
Created August 22, 2019 09:46 — forked from twheys/tea.py
Python implementation of the Tiny Encryption Algorithm (TEA)
# coding: utf-8
"""
Implementation of the Tiny Encryption Algorithm (TEA) for Python
https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm
Example Usage:
import tea
# The key must be 16 characters
@ryanbekabe
ryanbekabe / dna.py
Created August 16, 2019 01:01 — forked from odanga94/dna.py
CodeAcademy Python project: DNA Analysis
sample = ['GTA','GGG','CAC']
def read_dna(dna_file):
dna_data = ""
with open(dna_file, "r") as f:
for line in f:
dna_data += line
return dna_data
def dna_codons(dna):
@ryanbekabe
ryanbekabe / rsa.py
Created August 16, 2019 00:28
A simple RSA implementation in Python
'''
620031587
Net-Centric Computing Assignment
Part A - RSA Encryption
'''
import random
'''
@ryanbekabe
ryanbekabe / rsa_p36.py
Created August 16, 2019 00:28 — forked from dendisuhubdy/rsa_p36.py
RSA Implementation Running on Python 3.6
"""
Implementation of RSA cryptography
using samples of large numbers
"""
import random
import sys
import math
from random import randrange