Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding

Alberto Coletta boh717

👨‍💻
Coding
View GitHub Profile
@boh717
boh717 / akka-(de)serializer.scala
Created Feb 24, 2020
Akka http (de)serializer for Map[String, Any]
View akka-(de)serializer.scala
implicit object AnyJsonFormat extends JsonFormat[Any] {
def write(x: Any) = x match {
case n: Int => JsNumber(n)
case s: String => JsString(s)
case x: Seq[_] => seqFormat[Any].write(x)
case m: Map[String, _] @unchecked => mapFormat[String, Any].write(m)
case b: Boolean if b => JsTrue
case b: Boolean if !b => JsFalse
case x =>
serializationError(
@boh717
boh717 / mysqldump.sh
Last active Oct 18, 2018 — forked from jakeasmith/mysqldump.sh
A quick snippet for doing a compressed mysql dump with a pv to monitor progress
View mysqldump.sh
# Add -h <host> -u <user> -p if needed
mysqldump --single-transaction --skip-lock-tables database [table1 table2 table3] | pv -W | gzip -c > [filename].sql.gz
@boh717
boh717 / update_ghost.sh
Last active Jul 27, 2020
Script to update self-hosted Ghost blog to its latest version
View update_ghost.sh
#!/bin/bash
KillNode() {
NODE_PID=`ps aux | grep [n]ode | awk '{print $2}'`
kill $NODE_PID 2>/dev/null
}
if [ -z $1 ]; then
echo "I need ghost version number as parameter."