Skip to content

Instantly share code, notes, and snippets.

@etissieres
etissieres / bookmark.go
Last active August 18, 2023 09:17
Browser HTML bookmarks file parsing
package webbr
import (
"context"
"errors"
"io"
"net/url"
"regexp"
"slices"
@etissieres
etissieres / script_path.sh
Created November 26, 2018 08:51
Get script path
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
@etissieres
etissieres / pom.xml
Last active September 21, 2018 19:17
Aggregator pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0.0</version>
@etissieres
etissieres / mongo-counter.js
Created September 12, 2017 14:50
Old repo, no more used
#!/usr/bin/env node
var commander = require('commander');
var mongo = require('mongodb');
var moment = require('moment');
commander
.version(require('./package').version)
.option('-d, --database <str>', 'Database name')
.option('-c, --collection <str>', 'Collection name')
@etissieres
etissieres / utils.kt
Created August 17, 2017 08:10
Kotlin utilities
inline fun <reified T : Any> getLogger() = LoggerFactory.getLogger(T::class.java)!!
fun runInGui(runnable: () -> Unit) = SwingUtilities.invokeLater(Runnable(runnable))
class EventBus {
private val publisher = PublishSubject.create<Any>()
private val busExecutor = Executors.newSingleThreadExecutor()
fun emit(event: Any) {
@etissieres
etissieres / mongodb.ips.js
Created February 9, 2017 10:44
Get all mongodb connection ips
db.currentOp(true)
@etissieres
etissieres / uninstall-java.sh
Last active January 25, 2023 21:33
Uninstall Java From Mac
#!/bin/bash
sudo rm -rvf /Library/Java/JavaVirtualMachines/jdk<version>.jdk
sudo rm -rvf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rvf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rvf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rvf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rvf /Library/LaunchDaemons/com.oracle.java.JavaUpdateHelper.plist
sudo rm -rvf /Library/Preferences/com.oracle.java.Helper-Tool.plist
@etissieres
etissieres / jenkins_nexus_install.md
Created June 1, 2016 09:49
Jenkins & Nexus install

Jenkins & Nexus

Installation

  • On part sur une base de Ubuntu 16.04 LTS.
  • On prend pour hypothèse que le domaine sample.com pointe notre serveur.
  • On va installer Jenkins et Nexus derrière un reverse-proxy Nginx sécurisé par https.
  • Le domaine jenkins.sample.com pointera sur Jenkins.
  • Le domaine nexus.sample.com pointera sur Nexus.
@etissieres
etissieres / nginx
Created February 10, 2016 14:15
Nginx config
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/myapp/webapp;
index index.html index.htm;
server_name www.server.com;
location / {