Skip to content

Instantly share code, notes, and snippets.

View oalee's full-sized avatar
:octocat:
Meow

oalee oalee

:octocat:
Meow
View GitHub Profile
@oalee
oalee / ga.js
Last active December 24, 2016 18:59
Traveling Sales Person solution via GeneticAlgorithm
var fs = require('fs');
//run with
//node ga.js inputfile
//this is a example of badly written code :D, dont use javascript for this kind of problems. python is much better
var args = process.argv.slice(2);
getIndex = function functionName(index) {
@oalee
oalee / decoder.py
Created December 22, 2016 11:28
decode binary string using a defined decode function and prints assci of decoded binary
#! /usr/bin/python
def decode(input):
if input == "0001":
return "00"
if input == "0010":
return "01"
if input == "0100":
return "10"
@oalee
oalee / search.js
Created November 30, 2016 17:15
UCS, BFS, DFS search in js
var tree = {
'A': ['B', 'C', 'D', 'E'],
'B': ['A', 'F', 'G'],
'C': ['A', 'H'],
'D': ['A', 'I', 'J'],
'E': ['A', 'K', 'L'],
'F': ['B', 'G', 'M', 'N', 'O'],
'G': ['B', 'F', 'P', 'Q', 'R'],
'H': ['C', 'S'],
'I': ['D'],
@oalee
oalee / p2p-vs-clientserver.py
Created November 11, 2016 13:45
p2p vs client server time
# -*- coding: utf-8 -*-
"""
Spyder Editor
"""
import plotly.offline as py
import plotly.graph_objs as go
@oalee
oalee / restart.py
Created July 10, 2016 23:37
a python script which will reset the router trough telnet if there is no internet connection . this script will reopen transmission-qt too . works in windows machines
import telnetlib
import time
import re
import subprocess
import os
resCount=0
pingCount=0
@oalee
oalee / README.md
Last active April 14, 2016 10:35
Openvpn scripts

this is some scripts for using openvpn in linux easier.

vpn function usage

use vpn server . example :

vpn de

Requirements

make .openvpn_profile in your home directory .