Skip to content

Instantly share code, notes, and snippets.

View xrobin's full-sized avatar

Xavier Robin xrobin

View GitHub Profile
install.packages(c("Rcpp", "plotrix", "RcppEigen", "BH", "devtools"))
library("devtools")
install_github(repo = "mnist", username = "xrobin", ref = "master")
install_github(repo = "DeepLearning", username = "xrobin", ref = "master")
my.diag.function <- function(rbm, batch, data, iter, batchsize, maxiters, layerFromCpp) {
print(iter)
}
@xrobin
xrobin / fail2ban-allstatus.sh
Created January 19, 2017 10:38 — forked from kamermans/fail2ban-allstatus.sh
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done
@xrobin
xrobin / TestOSTVerbosityLevels.py
Created May 24, 2018 15:10
Tests the verbosity levels of OST, with argparse magic. Pass -v, -vv, to increase verbosity, -q, -qq, -qqq to decrease.
#!/usr/bin/env python2.7
import argparse
from ost import *
def testVerbosityLevel():
print("Verbosity: %d" % GetVerbosityLevel())
LogError("LogError") # >= 0
LogWarning("LogWarning") # >= 1
LogScript("LogScript") # >= 2
import errno
import tempfile
import os
class ScopedTemporaryFile(object):
""" Temp file to use in a with statement.
with ScopedTemporaryFile() as f:
... do stuff with f ...
@xrobin
xrobin / robo3T_desktop_entry.md
Last active March 27, 2020 10:03 — forked from LogansUA/robomongo_desktop_entry.md
Example of desktop entry on Ubuntu system for Robo 3T

Creating desktop entry

$ touch /usr/share/applications/robo3t.desktop

Edit

$ vim /usr/share/applications/robo3t.desktop