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 / README.md
Created July 20, 2020 00:43 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
@ryanbekabe
ryanbekabe / emoji.php
Created July 15, 2020 13:39 — forked from battis/emoji.php
Trying to store/retrieve/display Unicode emoji in a MySQL database
<?php
// MySQL schema
/*
CREATE TABLE `test` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`text` text,
`blob` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@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 - bekabeipa@gmail.com - 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
@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)
@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