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 / 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 / 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 / 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">

Useful Commands

Get kubectl version

kubectl version

Get cluster info:

kubectl cluster-info

EMAIL tools

counting the number of messages in a MBOX:

$ grep "From" {MBOX} | wc -l
@seralf
seralf / ng_debug.html
Created July 28, 2016 21:46
code snippet for prototyping a simple angular debug component
<!-- initialize ng-app ... -->
<!-- debug -->
<hr/>
<section id="debug" ng-controller="debugCtrl">
<style>
#debug {
padding: 1em;
background: #DDD;
}
@seralf
seralf / node-and-npm-in-30-seconds.sh
Created July 7, 2016 10:18 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@seralf
seralf / classes_usage.scala
Last active March 29, 2016 23:02
examples with simple Scala "bean" classes
package examples.scala.php
object MainProve extends App {
Predef println "Hello world!"
val p1 = new Person1("John", "Doe")
println(p1)
val p2 = new Person2("John", "Doe")
@seralf
seralf / MinimalHTTPServer.scala
Last active March 28, 2016 04:44
minimal scala HTTP server (proof of concept, for courses)
package scala.examples.web
import java.net.InetSocketAddress
import java.util.concurrent.Executors
import com.sun.net.httpserver.HttpExchange
import com.sun.net.httpserver.HttpHandler
import com.sun.net.httpserver.HttpServer
import java.io.BufferedReader
import java.io.InputStreamReader
import java.net.InetAddress