Skip to content

Instantly share code, notes, and snippets.

View babolivier's full-sized avatar

Brendan Abolivier babolivier

View GitHub Profile
### Keybase proof
I hereby claim:
* I am babolivier on github.
* I am brenabolivier (https://keybase.io/brenabolivier) on keybase.
* I have a public key whose fingerprint is E1D4 B745 7A82 9D77 1FBA 8CAC E860 1572 74A2 8D7E
To claim this, I am signing this object:
var cozydb = require("cozydb");
var data = cozydb.getModel('User', {})
update = function(id) {
data.updateAttributes(id, {
otpKey: "7lmt5npm7p",
hotpCounter: 0,
authType: "hotp"
}, function(err) {
#!/usr/bin/env coffee
#################################################################################
# This is a proof of concept to demonstrate the lack of security of ISEN Brest's#
# who's who (trombinoscope). In order to have it running stand-alone, just copy-#
# paste this file, cd to the paste's directory, install node.js, npm, then run: #
# # npm install -g coffee-script #
# $ npm install request cheerio async express printit #
# Then, all you have to do is to run #
# coffee ./[FILE_NAME] #
var cozydb = require("cozydb");
var data = cozydb.getModel('User', {
authType: String
})
update = function(id) {
data.updateAttributes(id, {
authType: null
}, function(err) {
@babolivier
babolivier / install-riot.sh
Created July 11, 2018 13:32
Script to quickly install the desired version of Riot.im
#!/bin/bash -e
# VARIABLES
HTTP_USER="http"
RIOT_REPO="https://github.com/vector-im/riot-web"
WEB_ROOT="/srv/http"
# PERMISSIONS CHECK
sudo -u $HTTP_USER whoami 2>&1 > /dev/null
if [ $? != 0 ]; then
package main
import (
"fmt"
"strings"
"github.com/matrix-org/gomatrix"
)
func main() {
@babolivier
babolivier / backup.sh
Last active October 8, 2018 09:28
Script run as a cron task that launch backups creation and upload created backups to an OpenStack Swift container, after having deleted every backup older than a week old. Place the scripts creating backups in /etc/backup. If you want the backups directory to be cleaned first, create a script named like "00_clean.sh" that does that.
#!/bin/bash -e
# Log in error log
1>&2 echo "--- `date -Is` ---"
# Log in output log
echo "--- `date -Is` ---"
if [ "$#" != "1" ]; then
1>&2 echo "Usage: backup.sh HOST_NAME"
exit 1

Step 0: SSH into the server

You will be provided with a domain name looking like xxxxx.ubucon.abolivier.bzh, which points to your dedicated VPS. To access the server's command line, run ssh ubuntu@xxxxx.ubucon.abolivier.bzh from a terminal (or connect with your favourite SSH client with the user ubuntu), and use the password ubucon2019.

Step 1: Install the Matrix.org repository

wget -qO - https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg | sudo apt-key add -
sudo add-apt-repository "deb https://packages.matrix.org/debian/ bionic main"
#!/bin/bash
# Init.
if [ "$1" == "--silent-fail" ]; then
SILENT_FAIL=true
else
SILENT_FAIL=false
fi
ACCESS_TOKEN="[REDACTED]"