Skip to content

Instantly share code, notes, and snippets.

View yanbab's full-sized avatar

yanbab

  • Nantes, France
View GitHub Profile
@yanbab
yanbab / systemd.md
Created November 20, 2020 09:23
Systemd Cheat Sheet

Services (systemctl)

systemctl stop apache2
systemctl start
systemctl 

Logs (journalctl)

Read entries from specific unit

** Install Debian Sid **
The fatest way is to download the daily builds 'mini.iso' on [daily]()
This will leaves you with a lightweight system of ~1Gb
**Change console keyboard layout (optional)**
$ sudo dpkg-reconfigure keyboard-configuration
$ sudo service keyboard-setup restart
$ sudo reboot
#/bin/sh
#
# Setup Kiosk mode for Alpine Linux
#
#!/bin/sh
USER=kiosk
KEYBOARD_LAYOUT=fr
KEYBOARD_MODEL=mac
WIDTH=1024
@yanbab
yanbab / README.md
Created September 25, 2019 15:47
SCRIPT-8
@yanbab
yanbab / minimal.md
Last active July 6, 2019 18:56
Setup a minimal Ubuntu 19.04

Console resolution

Add 'nomodeset' in /etc/default/grub :

GRUB_CMDLINE_LINUX_DEFAULT="splash quiet nomodeset" 

Run update-grub to save change

Console font

{
"basics": {
"name": "Yan Babilliot",
"label": "Senior Web Developer at Self-employed",
"summary": "Experienced Web Developer with 15+ years history of working in startups and agencies. \nSkilled in backend and frontend developement, UX design, project management and agile methodologies.",
"location": {
"address": "Nantes, Pays de la Loire, France",
"postalCode": "",
"city": "",
"countryCode": "US",
@yanbab
yanbab / wp-create.sh
Last active December 16, 2017 17:53
Bootstraps a fully working WordPress install in one command
#!/bin/sh
#
# Usage: 'wp-create.sh site_name [site_url]'
#
# Creates 'site_name' database, user and WordPress install
#
# Note : On MacOS you may need to fix mysql with
# export PATH=/usr/local/mysql/bin:$PATH
# sudo mkdir /var/mysql && sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
#
@yanbab
yanbab / sqlite2mysql.py
Created March 23, 2015 16:27
Convert SQLite database toMySQL/MariaDB
#! /usr/bin/env python
#
# Usage:
#
# 1. Dump your sqlite db : sqlite3 database.sqlite3 .dump > dump.sql
# 2. run script : cat dump.sql | python sqlite2mysql.py > dump.my.sql
# 3. import SQL schema in MySQL : mysql -u USER -p DBName < dump.my.sql
#
import sys
.leaflet-div-icon {
background: transparent;
border: none;
}
.leaflet-marker-icon .number{
position: relative;
top: -37px;
font-size: 12px;
width: 25px;
@yanbab
yanbab / distance.js
Created May 16, 2014 12:56
distance between 2 lat/long coord
/* This function calculates distance with the Haversine formula, t
his formula assumes that our Earth is spherical,
but it isn’t since it’s more like a big orange fruit also compresses at poles.
I’ve read that this function has an error about + o – 3 meters (it depends),
but it’s a small error for many purposes.
http://snipplr.com/view/25479/
*/
function distance(lat1,lon1,lat2,lon2) {
var R = 6371; // km (change this constant to get miles)