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 / 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 / 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 / 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
@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 / 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 / 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
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 / 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