Skip to content

Instantly share code, notes, and snippets.

View ixaxaar's full-sized avatar
🏔️

ixaxaar ixaxaar

🏔️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ixaxaar on github.
  • I am ixaxaar (https://keybase.io/ixaxaar) on keybase.
  • I have a public key ASB1_GhKK6fgdyPZ7b47W-Ml_eVJZzPVa9M6YlAXm5ph5Ao

To claim this, I am signing this object:

@ixaxaar
ixaxaar / AgdaBasics.agda
Created February 8, 2019 07:02 — forked from bitonic/AgdaBasics.agda
Agda tutorial
module AgdaBasics where
apply : (A : Set)(B : A → Set) → ((x : A) → B x) → (a : A) → B a
apply A B f a = f a
_∘_ : {A : Set}{B : A → Set}{C : (x : A) → B x → Set}
(f : {x : A}(y : B x) → C x y)(g : (x : A) → B x)
(x : A) → C x (g x)
(f ∘ g) x = f (g x)
#!/bin/sh
###############################################################################################
# Run as ./run_on_save.sh ./file/to/watch ./script/to/run.sh --args --to --give --to --script
###############################################################################################
# get the current path
CURPATH=`pwd`
TO_WATCH=$1
@ixaxaar
ixaxaar / install-chrome.sh
Last active September 19, 2018 06:39 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/bin/bash
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install -y google-chrome-stable
@ixaxaar
ixaxaar / unmerge_backoff.py
Created July 11, 2018 07:02
Backoff by blocks when batch inserting data somewhere, and a few records tend to fail
from collections import Iterable
def flatten(l):
if not isinstance(l, Iterable):
yield l
else:
for el in l:
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
yield from flatten(el)
@ixaxaar
ixaxaar / hadoop_root.sh
Last active June 21, 2018 05:07
Find and extract hadoop root url for use in bash scripts
#!/usr/bin/env bash
HH=`awk '/fs\.defaultFS/{getline; print}' /etc/hadoop/conf/core-site.xml `
HH1=`echo "${HH/<value>/}"`
HADOOP_ROOT=`echo "${HH1/<\/value>/}"`
echo $HADOOP_ROOT
sudo pip uninstall -y azure
sudo pip uninstall -y azure-batch
sudo pip uninstall -y azure-common
sudo pip uninstall -y azure-cosmosdb-nspkg
sudo pip uninstall -y azure-cosmosdb-table
sudo pip uninstall -y azure-datalake-store
sudo pip uninstall -y azure-eventgrid
sudo pip uninstall -y azure-graphrbac
sudo pip uninstall -y azure-keyvault
sudo pip uninstall -y azure-mgmt
@ixaxaar
ixaxaar / mnist_one_shot_aae_classification.ipynb
Created April 30, 2018 07:30
One-shot exemplar classification using Adversarial Autoencoders
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
sudo su -
cd
apt update
apt install -y build-essential libssl-dev libcurl4-openssl-dev automake autoconf git pkg-config libtool libjansson-dev
git clone https://github.com/unitusdev/unitus-cpuminer.git
cd unitus-cpuminer
declare -a regions=('us-central1-a' 'us-west1-a' 'us-east1-b' 'northamerica-northeast1-a' 'us-east4-a' 'southamerica-east1-a' 'europe-west1-b' 'europe-west2-a' 'europe-west3-a' 'europe-west4-b' 'asia-south1-a' 'asia-southeast1-a')
for region in ${regions[@]}; do
gcloud compute instances create \
--machine-type=n1-highcpu-16 \
--preemptible \
--zone $region \
spotty-${region} \
--metadata-from-file startup-script=/home/ixaxaar/unitus_startup.sh