Skip to content

Instantly share code, notes, and snippets.

View seralf's full-sized avatar
🎯
Focusing

Alfredo Serafini seralf

🎯
Focusing
View GitHub Profile
@seralf
seralf / split_flac.sh
Last active March 7, 2024 07:52
Simple shell script to split a single flac file using a cue file. The .flac file and .cue file must have the same name.
#!/bin/bash
sudo apt-get install cuetools shntool flac
cuebreakpoints $1.cue | shnsplit -o flac $1.flac
@seralf
seralf / airports.csv
Last active October 26, 2023 02:48
example 02 with D3
We can't make this file beautiful and searchable because it's too large.
ident,type,name,latitude_deg,longitude_deg,elevation_ft,iso_country,municipality
00AK,small_airport,Lowell Field,59.94919968,-151.695999146,450,US,Anchor Point
00AL,small_airport,Epps Airpark,34.86479949951172,-86.77030181884766,820,US,Harvest
00AZ,small_airport,Cordes Airport,34.305599212646484,-112.16500091552734,3810,US,Cordes
00CA,small_airport,Goldstone /Gts/ Airport,35.350498199499995,-116.888000488,3038,US,Barstow
00CO,small_airport,Cass Field,40.62220001220703,-104.34400177001953,4830,US,Briggsdale
00FA,small_airport,Grass Patch Airport,28.64550018310547,-82.21900177001953,53,US,Bushnell
00FL,small_airport,River Oak Airport,27.230899810791016,-80.96920013427734,35,US,Okeechobee
00GA,small_airport,Lt World Airport,33.76750183105469,-84.06829833984375,700,US,Lithonia
00ID,small_airport,Delta Shores Airport,48.145301818847656,-116.21399688720703,2064,US,Clark Fork
@seralf
seralf / webserver.py
Last active July 17, 2023 02:49
Start a local webserver into the current directory, for serving local static files. (This is useful when testing ajax locally on json, for example.)
#!/usr/bin/python
# start an http webserver serving static files from the local directory, using python
python -m SimpleHTTPServer 7777 &
@seralf
seralf / MainIgnite.scala
Last active February 28, 2023 17:33
Naive Mock for JDBC in scala
package examples
import java.sql.DriverManager
import db.jdbc.JDBC
import com.typesafe.config.ConfigFactory
object MainIgnite extends App {
// SEE: https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/IgniteJdbcThinDriver.html
@seralf
seralf / Vagrantfile
Last active February 23, 2020 15:43 — forked from malev/Vagrantfile
Vagrantfile: Ubuntu with miniconda 2 installed and working
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provision "shell", inline: <<-SHELL
apt-get update -q
su - vagrant
wget -q https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
chmod +x miniconda.sh
./miniconda.sh -b -p /home/vagrant/miniconda
echo 'export PATH="/home/vagrant/miniconda/bin:$PATH"' >> /home/vagrant/.bashrc
@seralf
seralf / index.html
Last active January 20, 2019 00:19
exp 01
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>TESTING for RDF!</title>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style type="text/css">
@seralf
seralf / StanfordNERExample.scala
Last active June 6, 2018 22:39
A simple, introductory example, to play with Stanford Named Entity Recognition tool with the scala language. NOTE: the model used here is one of the provided model in the standard distribution.
package ner
import edu.stanford.nlp.ie.crf.CRFClassifier
import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import edu.stanford.nlp.ling.CoreAnnotations
import java.util.ArrayList
import java.util.HashMap
import java.util.Map
import scala.xml.XML

Useful Commands

Get kubectl version

kubectl version

Get cluster info:

kubectl cluster-info

@seralf
seralf / _virtuoso_VOD7_ubuntu_installation.sh
Last active July 31, 2017 13:07
This is a simple checklist for installing a Virtuoso Opens Source 7 on ubuntu (debian? sholud be the same) environment.
## VIRTUOSO
http://localhost:8890/
http://localhost:8890/sparql
http://localhost:8890/conductor
#### pre-install:
These commands are suggested in the documentation
@seralf
seralf / MinimalHttpServer.java
Last active May 9, 2017 18:10
Jetty9 / Jersey2 / minimal http server (with Java and Scala)
package example.server.embedded;
import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.eclipse.jetty.server.Server;
import org.glassfish.jersey.jetty.JettyHttpContainerFactory;
import org.glassfish.jersey.server.ResourceConfig;