Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
@bitsnaps
bitsnaps / ubuntu-20.04-lts-perfect-setup.sh
Created July 19, 2020 16:28 — forked from eRQee/ubuntu-20.04-lts-perfect-setup.sh
Ubuntu 20.04 LTS Apps Server Installation Wizard
clear
##############
# Am I root? #
##############
if [ "x$(id -u)" != 'x0' ]; then
echo 'Error: this script can only be executed by root.'
echo 'Try re-run the script after switched to root account by type "sudo su"'
exit 1
fi
@bitsnaps
bitsnaps / webrtc.js
Created May 20, 2020 16:41 — forked from tauren/webrtc.js
Using RxJS for WebRTC icecandidate handling via WebSocket signaling server
// Create WebRTC peer and setup event handlers
let peer = new RTCPeerConnection(iceConfig)
// Subject for the websocket signalling server
let socketSubject = Observable.webSocket({
// deserialize each binary message received
resultSelector: e => deserialize(e.data)
})
// Filter for only icecandidate messages
.filter(msg => msg && msg.header && msg.header.event === 'icecandidate' && msg.body && msg.body.candidate)
@bitsnaps
bitsnaps / psv_decryptor.py
Last active September 27, 2023 22:10
Decrypt PSV file for mac
# This script is inspired from: https://github.com/kigaita/PsvDecryptCore
# It allows you to decrypt psv video files for online developer training website
# The original code was written with .NET for Windows users, this one with Python tested for Mac users.
# *** Disclaimer ****
# Please only use it for your convenience so that you can watch the courses on your devices offline or for educational purposes.
# Piracy is strictly prohibited. Decrypted videos should not be uploaded to open servers, torrents, or other methods of mass distribution. Any consequences resulting from misuse of this tool are to be taken by the user.
# packages you may need to install:
# pip install python-magic
@bitsnaps
bitsnaps / links_grabber.py
Last active April 16, 2020 13:40
Quick and dirty link scarp from wistia video
@bitsnaps
bitsnaps / dataset_clustering.py
Last active April 9, 2024 12:11
Clustering using AgglomerativeClustering and silhouette scoring
# Create a file "dataset.csv" with these values (don't forget to remove the '#' before each line):
# ID,Height,time_of_day,resolution
# 272,1.567925,1.375000,0.594089
# 562,1.807508,1.458333,0.594089
# 585,2.693542,0.416667,0.594089
# 610,1.036305,1.458333,0.594089
# 633,1.117111,0.416667,0.594089
# 658,1.542407,1.458333,0.594089
# 681,1.930844,0.416667,0.594089
# 802,1.505548,1.458333,0.594089
@bitsnaps
bitsnaps / README.md
Created February 25, 2020 00:06
Odoo v9 installation on ubuntu 14

Odoo v9 Installation Guide:

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/9.0/nightly/deb/ ./" >> /etc/apt/sources.list
apt-get update && apt-get install odoo
apt-get upgrade

Download & install wkhtmltox:

@bitsnaps
bitsnaps / odoo9-install.sh
Last active April 13, 2023 16:24 — forked from bistaray/Install Odoo v9 YENTHE
Ubuntu Scripts Installing Odoo v9
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
@bitsnaps
bitsnaps / bellman.groovy
Last active February 6, 2020 11:01
Bellman-Ford Algorithm using Edge List with Groovy
/**
* An implementation of the Bellman-Ford algorithm. The algorithm finds the shortest path between a
* starting node and all other nodes in the graph. The algorithm also detects negative cycles.
* Original Source: https://github.com/williamfiset/Algorithms/blob/master/src/main/java/com/williamfiset/algorithms/graphtheory/BellmanFordEdgeList.java
*/
@groovy.transform.Canonical
class Edge {
int from, to
double cost
@bitsnaps
bitsnaps / jgrapht_demo.groovy
Created January 20, 2020 16:39
jGrapht using groovy example
@Grab('org.jgrapht:jgrapht-core:1.3.1')
import org.jgrapht.*
import org.jgrapht.graph.*
import org.jgrapht.io.*
import org.jgrapht.traverse.*
class Main {
static void main(args){
@bitsnaps
bitsnaps / mysql.sql
Last active January 20, 2020 11:46
A small paper for teaching MySQL the first time through command line
MacBook-Pro-de-mac:~ mac$ mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 25
Server version: 10.1.32-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;