September 16 2018, 09:23#

YggTorrent

Lien : https://yggtorrent.qa

Réseaux :

Tags : p2p torrent

September 05 2018, 00:00#

Compiler Monero sur FreeBSD

La première fois que j'ai compilé le logiciel Monero, j'ai réalisé qu'il y avait un tas de dépendances qui méritaient d'être noté quelque part !

Installer les dépendances

sudo pkg install gcc cmake pkgconf boost-all openssl cppzmq openpgm unbound \
libsodium libunwind lzmalib readline ldns expat googletest doxygen \
graphviz pcsc-lite

Cloner le dépôt Git

git clone --recursive https://github.com/monero-project/monero
cd monero

Se positionner sur la branche la plus récente.

Exemple

git branch --list -a
git checkout release-v0.12

Compilation

make

Quand la compilation est terminée, les binaires résident dans monero/build/release/bin.

Tags : unix freebsd blockchain monero crypto

August 13 2018, 00:00#

Installer Ruby on Rails avec rbenv

J'ai rencontré par mal de soucis la première fois que j'ai installé Ruby on Rails, essentiellement à cause des dépendances. Un petit billet pour expliquer comment j'ai procédé pour l'installer proprement avec rbenv pourrait aider.

Installer les dépendances (en tant que root)

sur Debian

apt install libssl-dev libyaml-dev zlib1g-dev libncurses5-dev libffi-dev \
libgdbm3 libgdbm-dev libreadline7 libreadline-dev libsqlite3-dev nodejs

sur FreeBSD

pkg install gcc node ruby sqlite3

Installer rbenv et ruby-build

Prérequis

  • Bash (optionnel, mais recommandé)
  • Git

rbenv

Pour installer simplement rbenv, il suffit de suivre les instructions Basic GitHub Checkout de son excellent README.

Exemple

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
~/.rbenv/bin/rbenv init

Penser à redémarrer le Shell après l'installation de rbenv.

ruby-build

Pour installer simplement ruby-build en tant que plugin de rbenv, il suffit de suivre les instructions rbenv plugin de son excellent README.

Exemple

mkdir -p "$(rbenv root)"/plugins
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

Installer une version de Ruby

Exemple

rbenv install 2.4.4

Définir cette version en tant que version globale

rbenv global 2.4.4

Ruby on Rails

Installation

gem install rails

Créer un nouveau projet

rails new project

Tags : unix freebsd debian ruby rails rbenv

July 19 2018, 14:05#

Sécurité informatique Global Security Mag Magazine Online antivirus spywares offres emploi sécurité télécom réseau

Lien : https://www.globalsecuritymag.fr/

Tags : cybersécurité linux unix hack

June 29 2018, 15:13#

SomaFM: Commercial-free, Listener-supported Radio

Lien : https://somafm.com/

Tags : radio musique

June 29 2018, 15:13#

RadioTunes | Enjoy amazing Free Internet Radio stations

Anciennement SkyFM

Lien : http://www.radiotunes.com/

Tags : musique

May 29 2018, 00:00#

Installer un serveur Radicale sur FreeBSD

À ce jour, la dernière version de Radicale n'est pas encore disponible sous forme de paquet pour FreeBSD. Il est possible qu'il faille adapter les instructions en fonction de la version de FreeBSD.

Vous devez suivre les instructions en tant que root.

Installer les paquets prérequis

  • Apache 2.4 (pour l'outil htpasswd)
  • Python 3.6
  • pip (Gestionnaire de paquet Python)
  • Librairies Python requises pour Radicale
pkg install apache24 python36 py36-pip py36-bcrypt py36-passlib py36-cffi py36-six py36-vobject

L'utilisateur radicale

Afin d'améliorer la sécurité, il est vivement recommandé de lancer une application Web à l'aide d'un compte utilisateur dédié et restreint.

pw useradd -n radicale -c "Radicale user" -s /usr/sbin/nologin -h - -d /nonexistent

Voir aussi :

man pw

Installer Radicale

python3.6 -m pip install radicale

Configuration

Création des répertoires

mkdir -p /var/db/radicale/collections /usr/local/etc/radicale /var/log/radicale

Définition des permissions

chown -R radicale:radicale /var/db/radicale /var/log/radicale
chmod 750 /var/db/radicale /var/log/radicale

Créer /usr/local/etc/radicale/config

[server]
hosts = 0.0.0.0:5232

[auth]
type = htpasswd
htpasswd_filename = /usr/local/etc/radicale/users
htpasswd_encryption = bcrypt

[rights]
type = owner_only

[storage]
filesystem_folder = /var/db/radicale/collections

[logging]
config = /usr/local/etc/radicale/logging

Plus

Créer /usr/local/etc/radicale/logging

[loggers]
keys = root

[handlers]
keys = file

[formatters]
keys = full

[logger_root]
level = WARNING
handlers = file

[handler_file]
class = handlers.TimedRotatingFileHandler
args = ("/var/log/radicale/radicale.log", "midnight", 1, 7)
formatter = full

[formatter_full]
format = %(asctime)s - [%(thread)x] %(levelname)s: %(message)s

Plus

Gestion des utilisateurs de Radicale

Créer un utilisateur avec htpasswd pour initialiser le fichier qui contient les utilisateurs

htpasswd -Bc /usr/local/etc/radicale/users johndoe

Définition des permissions du fichier

chown root:radicale /usr/local/etc/radicale/users
chmod 640 /usr/local/etc/radicale/users

Pour ajouter un utilisateur ou modifier son mot de passe

htpasswd -B /usr/local/etc/radicale/users katsmith

Pour supprimer un utilisateur

htpasswd -D /usr/local/etc/radicale/users katsmith

Plus

rc script

Créer /etc/rc.d/radicale

#!/bin/sh

# PROVIDE: radicale
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name=radicale
rcvar=radicale_enable
pidfile=/var/run/${name}/${name}.pid
start_precmd=do_precmd

load_rc_config $name
: ${radicale_enable:=NO}
: ${radicale_user:=radicale}
: ${radicale_group:=radicale}
: ${radicale_config:=/usr/local/etc/radicale/config}

command=/usr/local/bin/python3.6
command_args="-m radicale -d -p ${pidfile} -C ${radicale_config}"

do_precmd()
{
  if [ ! -d ${pidfile%/*} ]
  then
    install -d -o ${radicale_user} ${pidfile%/*}
  fi
}

run_rc_command "$1"

Définition des permissions

chmod 555 /etc/rc.d/radicale

Plus

Démarrer

sysrc radicale_enable=YES
service radicale start

Tags : unix freebsd radicale caldav carddav

July 17 2017, 00:00#

Ragnarok Online sur Debian et FreeBSD

Ragnarok Online est un MMORPG coréen officiellement disponible uniquement sous Windows. Ce qui suit est un petit guide qui couvre uniquement l'installation du client officiel du serveur européen Ragnarok Europe sur Debian et FreeBSD à l'aide de Wine.

Téléchargement du client

Le client officiel est téléchargeable ici.

Installation de Wine

Sur Debian 9 amd64

dpkg --add-architecture i386
apt-get update
apt-get install wine32 winetricks

Sur FreeBSD 11

pkg inst i386-wine winetricks

Préparation du lecteur virtuel

export WINEPREFIX=~/.wine-euRO
WINEARCH=win32 winecfg

Installation des composants nécessaires au jeu

winetricks vcrun2008
winetricks ie8

À l'installation d'IE 8 :

  • Choisir I do not want to participate right now
  • Décocher Install updates
  • Cliquer sur Restart later puis répondre Yes

En cas d'erreur 404 lors du téléchargement des différents composants nécessaires à l'installation d'IE 8, voir ici pour récupérer ce qui manque et fournir ~/.cache/winetricks.

Installation du client

wine setup.exe

Enjoy!

Tags : unix jeu ragnarok linux freebsd debian wine

July 12 2017, 00:00#

Désactiver l'historique dans Chromium

Il est possible de désactiver l'enregistrement de l'historique dans Chromium en attribuant un droit de lecture seule sur le fichier History.

Mais avant tout il faut :

  1. purger les données de navigation (Ctrl + H et Clear browsing data)
  2. puis quitter le navigateur pour éviter tout conflit

Enfin :

chmod 444 ~/.config/chromium/Default/History

À priori cela ne perturbe pas le bon fonctionnement du navigateur.

Tags : unix linux web google chromium sécurité confidentialité

August 17 2016, 00:00#

Jekyll sur Debian 8

Prérequis

apt-get install curl build-essential ruby ruby-dev rubygems-integration

nodejs

Installation de la dernière version LTS de NodeJS

curl -sL https://deb.nodesource.com/setup_4.x | bash -
apt-get install nodejs

Installation

Installation de Jekyll

gem install jekyll

Tags : unix linux debian jekyll nodejs ruby

August 11 2016, 00:00#

Molly Guard

molly-guard est un petit outil (compatible systemd) permettant de se protéger des arrêts/redémarrages accidentels.

Pour la petite histoire : https://en.wiktionary.org/wiki/molly-guard

Installation

apt install molly-guard

Configuration

Ajouter ou décommenter la ligne suivante dans le fichier /etc/molly-guard/rc

ALWAYS_QUERY_HOSTNAME=true

Tags : unix linux debian systemd

August 09 2016, 00:00#

LXC on Debian 8

LXC (Linux Containers) is an operating-system-level virtualization method for running multiple isolated Linux systems (containers) on a control host using a single Linux kernel.

We will see how to quickly setting up a container.

Prerequisites

We need a network bridge br0. If needed, take a look on my post about that: "Setting up a network bridge on Debian 7".

Installation

# apt install lxc
# mkdir -p {/srv/lxc,/etc/lxc/auto}
# chmod 750 /srv/lxc

Creating a container

Copy the desired template and edit it.

# cp /usr/share/doc/lxc/examples/lxc-veth.conf /srv/lxc/example.conf

Configuration example

# Container with network virtualized using a pre-configured bridge named br0 and
# veth pair virtual network devices
lxc.utsname = example
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.hwaddr = 
lxc.network.ipv4 = 10.0.0.3/24
lxc.network.ipv4.gateway = 10.0.0.1

# Autostart
lxc.start.auto = 1
lxc.start.delay = 30

Creating a Debian container

The root password must be defined at the end of the creation process.

# lxc-create -n example -f /srv/lxc/example.conf --dir /srv/lxc/example -t debian

If we want to start automatically our container at boot, we have to link the configuration file into the /etc/lxc/auto directory.

# ln -s /var/lib/lxc/example/config /etc/lxc/auto/example

Network configuration

Edit /srv/lxc/example/etc/network/interfaces

To disable DHCP, comment iface eth0 inet dhcp.

auto lo
iface lo inet loopback

auto eth0
#iface eth0 inet dhcp

Informations about a container

# lxc-info -n example

Start

Normal mode

# lxc-start -n example

Daemon mode

# lxc-start -dn example

Console

Useful when the container run in the daemon mode

# lxc-console -n example

Stop

# lxc-stop -n example

Destroy

# lxc-destroy -n example

Tags : unix linux debian containerization virtualization

August 05 2016, 00:00#

Generate a self-signed certificate with OpenSSL

In my self-hosting adventure, I have to secure my web applications with SSL/TLS. The simple and free way is to generate my own certificates.

Edit 2020-10-09: today, for services exposed to the public, the best and simple way is to use Let's Encrypt.

Prerequisites

OpenSSL of course! :)

Install it on Debian GNU/Linux

apt install openssl

On FreeBSD

pkg install openssl

Generate

The following command generates a RSA key and a certificate valid for one year.

openssl req -x509 -nodes -newkey rsa:2048 -keyout example.key -out example.crt -days 365

Some questions will appear, fill it as your needs, but pay attention to the Common Name question.

For a website, this information must be a valid FQDN.

We can use wildcard to secure all subdomains. Example, if we want to secure www.example.com and blog.example.com, we can define the Common Name as *.example.com.

Tags : unix linux security ssl freebsd

May 31 2016, 00:00#

KVM virtualization on Debian 8

Kernel-based Virtual Machine (KVM) is a virtualization module in the Linux kernel that allows the kernel to function as a hypervisor. We will see how to setup quickly a hypervisor on Debian 8 using KVM.

Prerequisites

Check processor flags

KVM requires a processor with hardware virtualization extensions, such as Intel VT or AMD-V. So, we have to check if our processor has such an extension.

egrep 'svm|vmx' /proc/cpuinfo

You have to see at least one result.

Packages

apt install qemu-kvm libvirt-bin virtinst

GUI

If you need a GUI to manage your VMs, you can install virt-manager.

apt install virt-manager

virt-manager is able to provide a GUI for local KVM instance, but also for remote instances.

Network configuration

The main way to setup the network for the VMs is to make a network bridge. You can read my post "Setting up a network bridge on Debian 7" about that.

When the network bridge is up, we can configure the KVM network.

Edit /etc/libvirt/qemu/networks/host-bridge.xml

<network>
  <name>host-bridge</name>
  <forward mode="bridge"/>
  <bridge name="br0"/>
</network>

Then

virsh net-define /etc/libvirt/qemu/networks/host-bridge.xml

Finally, start the network.

virsh net-start host-bridge

Create a new pool

Now we will create a default pool for our VMs in /srv/kvm

mkdir -p /srv/kvm
virsh pool-create-as default dir --target /srv/kvm

Create a new virtual machine

Here is an example of creating a new CentOS VM:

  • OS CentOS 7
  • Type Linux RHEL7 (Red Hat Enterprise Linux 7)
  • Memory 512M
  • Disk 8G (qcow2 format)
  • Network host-bridge (defined previously)

Creating a VM can be done just in one command

virt-install --connect qemu:///system \
--virt-type kvm \
--name centos7 \
--ram 512 \
--disk /srv/kvm/centos7.qcow,format=qcow2,size=8 \
--cdrom /media/iso/os/linux/CentOS-7-x86_64-Minimal-1511.iso \
-w network=host-bridge \
--vnc \
--os-type linux --os-variant rhel7

Need explanations about the arguments? Please, take a look in the manual.

man virt-install

libvirt group

If you want to manage your VMs without passing through the root user, you can add your user into the libvirt group.

gpasswd -a user libvirt

Tags : unix linux debian virtualization kvm

April 23 2016, 00:00#

Add a Certification Authority on Debian 8

This is just a little note to remember how to add properly a new Certification Authority (CA) on Debian 8.

Copy the certificate
# cp example-ca.crt /usr/local/share/ca-certificates/
Update
# update-ca-certificates
Checking
$ ls -la /etc/ssl/certs | grep "example-ca"

The certificate is now present in the /etc/ssl/certs directory.

Tags : linux debian securité

April 23 2016, 00:00#

Txt2tags files syntax coloring in Vim

This is a little note to remember how to enable syntax highlighting for Txt2tags .t2t files in Vim.

Prerequisite

Download the Vim script txt2tags.vim here.

Installation

$ if [ ! -d "$HOME/.vim/syntax" ] ; then mkdir -p $HOME/.vim/syntax ; fi
$ cp txt2tags.vim $HOME/.vim/syntax/

Activation

Edit your .vimrc file at $HOME/.vimrc and add the following line

au BufNewFile,BufRead *.t2t set ft=txt2tags

Tags : unix software

April 22 2016, 00:00#

Build Homebank on Debian 8

Homebank is a free software that will assist you to manage your personal accounting. Designed to be easy to use and to be able to analyse your personal finance and budget in detail using powerful filtering tools and beautiful charts.

At the time of this writing the 5.0.6 version is not available in the Debian 8 repositories. So, we will see how to built it from source code.

Prerequisites

 # apt install build-essential libgtk-3-dev libofx6 libofx-dev intltool

Download the source code

$ wget https://get.nosheep.fr/src/homebank/homebank-5.0.6.tar.gz

Compilation

$ cp homebank-5.0.6.tar.gz /tmp/
$ cd /tmp
$ tar -xzpf homebank-5.0.6.tar.gz
$ cd homebank-5.0.6
$ ./configure --prefix=/usr
$ make

Installation

As root user

# cd /tmp/homebank-5.0.6
# make install

Tags : unix linux debian software

February 06 2016, 00:00#

Setup Radicale server on Debian 8

Radicale is a small but powerful CalDAV (calendars, to-do lists) and CardDAV (contacts) server.

We will see how to setup it quickly with a basic HTTP authentication using a file to store the users credentials.

Prerequisites

# apt install radicale apache2-utils

Authentication

Create the users file.

# htpasswd -cd /etc/radicale/users johndoe
# chown root:radicale /etc/radicale/users
# chmod 640 /etc/radicale/users

Add a new user or change his password

# htpasswd -d /etc/radicale/users katsmith

Delete a user

# htpasswd -D /etc/radicale/users katsmith

Data

Create the data directory

# mkdir -p /srv/radicale/collections
# chown -R radicale:radicale /srv/radicale
# chmod 750 /srv/radicale

The user and group radicale are generated automatically during the package installation.

Configuration

Edit /etc/radicale/config

# Authentication method
type = htpasswd

# Rights backend
type = owner_write

# Folder for storing local collections, created if not present
filesystem_folder = /srv/radicale/collections

Edit /etc/default/radicale and uncomment the following line

ENABLE_RADICALE=yes

Reboot

Tags : unix linux debian server

September 25 2015, 00:00#

Microsoft TrueType core fonts on Manjaro Linux

We will see how to install the Microsoft's TrueType core fonts on Manjaro Linux.

Prerequisites

cabextract is a little soft which can extract the files from a .cab Microsoft file.

Install it now as root user

pacman -Sy cabextract

Download the fonts

The fonts are available on the corefonts project website.

Extraction

Example with the Impact font

cabextract -F *.TTF impact32.exe
Extracting cabinet: impact32.exe
  extracting Impact.TTF

All done, no errors.

Installation

So, now just move the font on your ~/.fonts folder.

mkdir ~/.fonts
mv Impact.TTF ~/.fonts/

Tags : unix linux manjaro

August 16 2015, 00:00#

Setting up a network bridge on Debian 7

I need to setup a network bridge br0 to connect my virtual machines under KVM to the wired network eth0 without DHCP. I do not use Network Manager, but the /etc/network/interfaces configuration file.

Install the prerequisites as root user

aptitude install bridge-utils

Disable eth0 as root user

ifdown eth0

Setting up the network interfaces

Edit /etc/network/interfaces

auto lo br0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet manual

iface br0 inet static
    address 192.168.1.3
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1
    bridge_ports eth0
    # I use the OpenDNS nameservers
    dns-nameserver 208.67.222.222
    dns-nameserver 208.67.220.220

Activate interfaces as root user

ifup eth0 br0

Tags : linux debian réseau kvm