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 / 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 / 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)
# 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
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)
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)
@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
@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_audio_streaming.py
Last active August 9, 2024 07:29
Python Audio from Mic to streaming
from flask import Flask, Response,render_template
import pyaudio
app = Flask(__name__)
#audio1 = pyaudio.PyAudio()
p = pyaudio.PyAudio()
def generate_wav(self, raw):
"""
# Using Android IP Webcam video / mjpeg .jpg stream (tested) in Python37 OpenCV
# TheBekabe - HanyaJasa.Com - [email protected]
import urllib
import urllib.request
import cv2
import numpy as np
import time
# Replace the URL with your own IPwebcam shot.jpg IP:port
@ryanbekabe
ryanbekabe / vhost.py
Last active May 11, 2020 06:08 — forked from fideloper/vhost.py
Create vHost Ubuntu Lamp-Server (bash and python)
#! /usr/bin/python3.5
#Ubuntu 16.04.6 LTS
#Apache/2.4.18 (Ubuntu)
#Source: https://gist.githubusercontent.com/fideloper/2710970/raw/cbe308f44bfd299a3f410bb1a06aa67a2753763a/vhost.py
#Modif: 12:43 11/05/2020 - [email protected] - hanyajasa.com
#Example: python3.5 vhost.py -d /var/www/html/lab -s lab.bekabe.my.id
from sys import argv
from os.path import exists
from os import makedirs