Skip to content

Instantly share code, notes, and snippets.

# Initial updates and necessary tools
aptitude update && aptitude full-upgrade && \
aptitude install gcc gcc-4.4 gcc-4.5 gcc-4.6 gcc-4.7 git-core binutils curl \
bcc psmisc htop hdparm cpufrequtils screen autoconf \
make texinfo bc build-essential bzip2 libbz2-dev \
zlib1g-dev libssl-dev libreadline6 libreadline6-dev \
sqlite3 libsqlite3-dev ncurses-dev sudo \
libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
@Nebukad93
Nebukad93 / fix.md
Created December 18, 2017 13:37 — forked from nicosomb/fix.md
Fix for wallabag 2.2 and SQLite

After upgrading wallabag to 2.2, if you use SQLite for database, you may have a blank page or an internal server error (error 500). It can be due to migrations which failed.

The migrations who failed are migrations which try to create new columns on tables.

To fix this problem, please execute these commands on your webserver:

    php bin/console doctrine:migration:execute 20161024212538 -e=prod
    php bin/console doctrine:migration:execute 20161106113822 -e=prod
@Nebukad93
Nebukad93 / daemon.json
Created September 7, 2017 14:57
Example Docker daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,
@Nebukad93
Nebukad93 / randomize.rb
Created May 6, 2017 20:39 — forked from aeris/randomize.rb
Fast (>100MBps) CSPRNG to randomize hard drive before encryption
#!/usr/bin/env ruby
require 'openssl'
BLOCK_SIZE = 1024*1024 # 1M
CIPHER_BLOCK_SIZE = 128
loop do
n = 0
cipher = OpenSSL::Cipher::AES.new CIPHER_BLOCK_SIZE, :CBC
cipher.encrypt
@Nebukad93
Nebukad93 / Dockerfile
Created April 18, 2017 15:03 — forked from toniher/Dockerfile
Example of changing uid and gid of a Docker image - MariaDB
FROM mariadb:10.1
# To be changed here
ENV MYSQL_UID 27
ENV MYSQL_GID 27
RUN usermod -u $MYSQL_UID mysql; groupmod -g $MYSQL_GID mysql;
RUN chown -R mysql:mysql /var/lib/mysql /var/run/mysqld
#!/bin/bash
USER="root"
PASSWORD=""
FILES="/Users/tenold/Backups/MySQL/*"
for f in $FILES
do
echo "Processing $f file..."
#!/bin/bash
USER="root"
PASSWORD=""
databases=`docker exec mariadb /usr/bin/mysql --user=$USER --password=$PASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database`
for db in $databases; do
if [[ "$db" != "information_schema" ]] && [[ "$db" != "performance_schema" ]] && [[ "$db" != "mysql" ]] && [[ "$db" != _* ]] ; then
echo "Dumping database: $db"
@Nebukad93
Nebukad93 / torrent-telegram.sh
Last active December 6, 2016 13:55 — forked from pugson/run_scripts.sh
Envoi d'une notification sur Telegram quand un téléchargement est fini sur rtorrent/rutorrent
#!/bin/bash
# Remplacer VOTRE_CHAT_ID par votre identifiant Telegram obtenu depuis @myidbot
# Remplacer XXXXXXXXX:yyyyyyyyyyyyyyyyyyyyy avec le Token de votre Bot depuis @BotFather
DESTINATAIRE="VOTRE_CHAT_ID"
TOKEN="XXXXXXXXX:yyyyyyyyyyyyyyyyyyyyy"
curl -s --data chat_id=$DESTINATAIRE --data-urlencode text="$1 terminé!" "https://api.telegram.org/bot$TOKEN/sendMessage" > /dev/null