Skip to content

Instantly share code, notes, and snippets.

View akerouanton's full-sized avatar

Albin Kerouanton akerouanton

View GitHub Profile
@akerouanton
akerouanton / todo.md
Last active December 4, 2017 00:21
Disable Ubuntu trackers

Disable Ubuntu trackers

It's totally useless, put your privacy at risk and might hogs your CPU (usually up to one core)... Citing the official documentation, using bullshit words to describe it:

Tracker is a synergy of technologies that are designed to provide a highly sophisticated, innovative and integrated desktop.

You can't uninstall tracker because the package ubuntu-gnome-desktop itself requires it (believe me, it'll deinstall gnome if you try to do it). Still, you can prevent it from autostarting when you open your session:

for file in `ls /etc/xdg/autostart/tracker*`; do

tracker=$(basename ${file/.desktop//})

<?php
require __DIR__ . '/vendor/autoload.php';
$snappy = new \Knp\Snappy\Pdf('/home/knplabs/.config/composer/vendor/bin/wkhtmltopdf-amd64');
$snappy->generateFromHtml('<html>aze</html>', '/tmp/out/repro216.pdf', ['page-size' => 'A4', 'footer-right' => 'Page [page] of [toPage]'], true);
<?php
require __DIR__ . '/vendor/autoload.php';
$snappy = new \Knp\Snappy\Pdf('/home/knplabs/.config/composer/vendor/bin/wkhtmltopdf-amd64');
for ($i = 0; $i < 1500; $i++) {
$snappy->generateFromHtml('<html>aze</html>', tempnam('/tmp/out/repro235', $i), ['page-size' => 'A4', 'footer-right' => 'Page [page] of [toPage]'], true);
}
<?php
require __DIR__ . '/vendor/autoload.php';
use hollodotme\FastCGI\Client;
use hollodotme\FastCGI\SocketConnections\NetworkSocket;
use hollodotme\FastCGI\SocketConnections\UnixDomainSocket;
use hollodotme\FastCGI\Requests\GetRequest;
if ($argc < 3) {
@akerouanton
akerouanton / list.go
Last active March 1, 2018 00:00
ls and mv (partially) rewritten in go (without perf issues on directory with hundreds of thousands of files)
package main
import (
"os"
"log"
"fmt"
)
func main() {
dir, err := os.Getwd()
#!/usr/bin/env node
const Remarkable = require('remarkable');
const toc = require('markdown-toc');
const fs = require('fs');
const puppeteer = require('puppeteer');
const express = require('express');
const generateHtml = (file, serverAddress) => {
const md = new Remarkable({
!includeurl https://raw.githubusercontent.com/DaniilSolovyov/plantuml-bells-and-whistles/v1.0/release/theme/darcula.puml
!includeurl https://raw.githubusercontent.com/DaniilSolovyov/plantuml-bells-and-whistles/v1.0/release/palette/material.puml
skinparam DefaultFontName "Ubuntu Mono"
skinparam title {
FontColor MD_LBLUE_A400
}
skinparam actor {
@akerouanton
akerouanton / list.md
Created June 11, 2018 20:13
Liste de youtubeurs produisant des contenus à caractère éducatif ou de debunking | Curated list of french educational/debunking video makers
@akerouanton
akerouanton / grievances.md
Last active June 13, 2018 15:44
swarm grievances
  • Does not always update services in dev env (new images)
    • ↳ Image digest should be resolved based on local images
  • Does not always update services in prod env (new/updated labels)
    • ↳ Update should be automatically forced when only label update detected
  • No one-off commands
    • ↳ Use JASS?
  • No log duplication (would improve DX)
    • ↳ Need custom log driver
package main
import (
"bufio"
"bytes"
"context"
"fmt"
"os"
"text/template"
"time"