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 / sources.list
Created August 15, 2019 06:22 — forked from h0bbel/sources.list
/etc/apt/sources.list for Ubuntu 18.04.1 LTS Bionic Beaver
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@ryanbekabe
ryanbekabe / mic_client.py
Created August 10, 2019 17:30 — forked from fopina/mic_client.py
microphone streaming with pyAudio
#!/usr/bin/env python
import pyaudio
import socket
import sys
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
CHUNK = 4096
@ryanbekabe
ryanbekabe / flaskaudiostream.py
Created August 5, 2019 03:36 — forked from hosackm/flaskaudiostream.py
Flask streaming an audio file
from flask import Flask, Response
app = Flask(__name__)
@app.route("/wav")
def streamwav():
def generate():
with open("signals/song.wav", "rb") as fwav:
data = fwav.read(1024)
@ryanbekabe
ryanbekabe / client.py
Created July 3, 2019 03:27 — forked from yoavram/client.py
Example of uploading binary files programmatically in python, including both client and server code. Client implemented with the requests library and the server is implemented with the flask library.
import requests
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
url = "http://localhost:5000/"
fin = open('simple_table.pdf', 'rb')
files = {'file': fin}
try:
r = requests.post(url, files=files)
print r.text
@ryanbekabe
ryanbekabe / client.py
Created June 29, 2019 23:43 — forked from kittinan/client.py
Python OpenCV webcam send image frame over socket
import cv2
import io
import socket
import struct
import time
import pickle
import zlib
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('192.168.1.124', 8485))
@ryanbekabe
ryanbekabe / mongo-struc.js
Created June 22, 2019 10:11 — forked from hkasera/mongo-struc.js
A script for mongo shell to get the collection structure.
var conn = new Mongo();
db = conn.getDB(<DB_NAME>);
var cursor = db.<COLLECTION>.find();
var items = [];
items = cursor.toArray();
var dbstruc = {};
for (var i = 0; i < items.length; ++i) {
var target = items[i];
getKP(target,dbstruc);
}
@ryanbekabe
ryanbekabe / mongoDB.py
Created June 22, 2019 03:44 — forked from cjgiridhar/mongoDB.py
CRUD for MongoDB with Pymongo
import pymongo
from pymongo import Connection
conn = Connection()
db = conn['myDB']
collection = db['language']
#Creating a collection
db.language.insert({"id": "1", "name": "C", "grade":"Boring"})
db.language.insert({"id": "2", "name":"Python", "grade":"Interesting"})
@ryanbekabe
ryanbekabe / ProceduralVsOop.php
Created June 21, 2019 00:53 — forked from agenticsim/ProceduralVsOop.php
PHP Procedural vs. Object-Oriented Programming (OOP)
<?php
// Procedural
function example_new() {
return array(
'vars' => array()
);
}
function example_set($example, $name, $value) {
$example['vars'][$name] = $value;
@ryanbekabe
ryanbekabe / port-forwarding.py
Created May 28, 2019 02:53 — forked from WangYihang/port-forwarding.py
port forwarding via python socket
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tcp Port Forwarding (Reverse Proxy)
# Author : WangYihang <[email protected]>
import socket
import threading
import sys
@ryanbekabe
ryanbekabe / start-video-stream-w-opencv.py
Created May 23, 2019 09:31 — forked from keithweaver/start-video-stream-w-opencv.py
Stream video in Python using OpenCV
# For more info: http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_gui/py_video_display/py_video_display.html
import cv2
import numpy as np
# Playing video from file:
# cap = cv2.VideoCapture('vtest.avi')
# Capturing video from webcam:
cap = cv2.VideoCapture(0)
currentFrame = 0