Skip to content

Instantly share code, notes, and snippets.

Ali Kheyrollahi aliostad

Block or report user

Report or block aliostad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aliostad / stockfish-interface.txt
Created Aug 17, 2019
stockfish - Description of the universal chess interface (UCI)
View stockfish-interface.txt
Description of the universal chess interface (UCI) April 2006
* The specification is independent of the operating system. For Windows,
the engine is a normal exe file, either a console or "real" windows application.
* all communication is done via standard input and output with text commands,
View dotnet-core-location-header-bug.cs
var url = "";
var client = new HttpClient();
var result = client.GetAsync(url).Result;
aliostad /
Created Dec 2, 2018
Solving simple linear function using tensorflow
import keras
import tensorflow as tf
import keras.backend as K
import numpy as np
from tensorflow.contrib.layers import *
# What we want to do: aX + b = Y
''' This one is using without using feed
X = np.random.uniform(-100., 100., 1000)
aliostad /
Created Aug 25, 2017
Rolling upgrade for Elasticsearch and Kibana
nodecount=4 #change
oldesv=$(dpkg -s elasticsearch 2>/dev/null | grep Version | cut -f2 -d' ')
oldkibv=$(dpkg -s kibana 2>/dev/null | grep Version | cut -f2 -d' ')
aliostad / azure-data-centres-location-codes
Created Jun 18, 2017
Azure Data Centres - Location Codes
View azure-data-centres-location-codes
"value": [
"id": "/subscriptions/c3dfd792-49a4-4b06-80fc-6fc6d06c4742/locations/eastasia",
"name": "eastasia",
"displayName": "East Asia",
"longitude": "114.188",
"latitude": "22.267"
aliostad /
Created Jun 13, 2017
A simple script to find Amazon prime (UK) films and their rotten tomato score
from bs4 import BeautifulSoup
import codecs
import requests
def get_film_names(doc):
res = []
bs = BeautifulSoup(doc, 'html.parser')
for a in'ul li .s-item-container h2'):
name = a.text.replace('\t', ' ')
yearTags ='> span.a-color-secondary')
aliostad / get-cluster-spark-external-ip.scala
Created Jun 10, 2017
How to get Spark Cluster's external IP for IP whitelisting
View get-cluster-spark-external-ip.scala
val client = new org.apache.http.impl.client.DefaultHttpClient()
val request = new org.apache.http.client.methods.HttpGet("")
request.addHeader("accept", "application/json")
val response = client.execute(request)
val handler = new org.apache.http.impl.client.BasicResponseHandler()
aliostad /
Last active May 8, 2017
BASH script for increasing file descriptors on linux
CURRENT_MAXFILE=$(ulimit -n)
function update_sysctl(){
UPDT="fs.file-max = $MAXFILE"
if ! grep "$UPDT" /etc/sysctl.conf; then
echo "$UPDT" >> /etc/sysctl.conf
aliostad / benchmark.cs
Created Dec 8, 2016
Linq OrderBy vs Array.Sort
View benchmark.cs
class Program
static void Main(string[] args)
static void LinqVsArraySort()
aliostad /
Last active Aug 22, 2016
A python script to download Akamai log files from FTP drop folder to an Azure blob storage
from ftplib import FTP
import sys
import os
from import BlobService
import time
_tmp_list = []
def _accept_file(x):
_tmp_list.append(x.split(' ')[-1])
You can’t perform that action at this time.