Skip to content

Instantly share code, notes, and snippets.

View miromasat's full-sized avatar

Miro Masat miromasat

View GitHub Profile
@miromasat
miromasat / userdata.sh
Created March 5, 2018 12:25
publish random ruble into kinesis stream
#!/bin/sh
cat <<EOF >/home/ec2-user/kinesis_client.sh
#!/bin/sh
while true
do
eventTime=\$(date +"%Y-%m-%d-%T")
userId=\$(( ( RANDOM % 100000 ) + 1 ))
appId=\$(( ( RANDOM % 1000 ) + 1 ))
appScore=\$(( ( RANDOM % 100 ) + 1 ))
appData=SomeTestData
@miromasat
miromasat / function
Last active September 22, 2017 09:27
from __future__ import print_function
import boto3
import time
import random
import threading
import sys
@miromasat
miromasat / emulate.sh
Created October 31, 2014 15:34
This was an only solution for debugging Ionic apps for me.
#!/bin/bash
# Manually emulate ionic/cordova application
# Miroslav Masat 2014
echo "Emulating..."
cd ./platforms/ios/build/emulator
var=$(pwd)
ios-sim launch "$var"/*.app
@miromasat
miromasat / du_UOS1.sh
Created October 21, 2012 19:02
domaci ukol na UOS c.1.
#!/bin/bash
#Miroslav Masat 2013
echo "Zadaj vstupny subor [relativna cesta od umiestnenia tohto skriptu]";
read a;
echo "Zadaj velkost jednej casti suboru [ -b (bytecount)]";
read b;
velkost=`echo $b | cut -d"/" -f5 | cut -d"." -f1|tr -d [:alpha:]`; #tento riadok extrahuje zo vstupu cislo. Napriklad z "4k" vyberie len "4", nanestastie som este nezaintegroval ten feature dalej do kodu, aby vedel podla postfixu nahodit exponent desiatky, cize teraz je to len bezpredmetna validacia vstupu...
split -b $b $a;