Skip to content

Instantly share code, notes, and snippets.

View simone-gasparini's full-sized avatar

Simone Gasparini simone-gasparini

View GitHub Profile
private fun connectToWifi(ssid:String, password:String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
val wifiNetworkSpecifier = WifiNetworkSpecifier.Builder()
.setSsid(ssid)
.setWpa2Passphrase(password)
.build()
val networkRequest = NetworkRequest.Builder()
#!/bin/bash
# INSTALL UPDATE AND PACKAGES
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y iftop htop iotop git vim mlocate install build-essential \
ubuntu-desktop libssl-dev yasm libgmp-dev libpcap-dev pkg-config
libbz2-dev libopenmpi-dev openmpi-bin cmake bison flex libicu-dev
# NVIDIA DRIVER
@simone-gasparini
simone-gasparini / event_hub_sas_token.py
Last active August 29, 2015 14:21
Azure Event Hub SAS Token creation
import time
from azure import _validate_not_none
from azure.http import HTTPRequest
from azure.servicebus.servicebusservice import ServiceBusService, ServiceBusSASAuthentication
service_namespace = 'test-namespace'
key_name = 'Test'
key_value = 'YOUR-TOKEN='
@simone-gasparini
simone-gasparini / event_hub_sas_token_test.html
Last active August 29, 2015 14:20
Azure Event Hub SAS Token creation
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="https://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js"></script>
<script type="text/javascript" src="https://crypto-js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<title>EVENT HUB - SAS Token Test</title>