Skip to content

Instantly share code, notes, and snippets.

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
View Vagrantfile
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
View MainIgnite.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
View index.html
<!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">
View gist:c5deb711c36e9bca60dd6373b5b6a13c

Useful Commands

Get kubectl version

kubectl version

Get cluster info:

kubectl cluster-info

View email_tools.md

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
View ng_debug.html
<!-- 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.
View node-and-npm-in-30-seconds.sh
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
View classes_usage.scala
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)
View MinimalHTTPServer.scala
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