Skip to content

Instantly share code, notes, and snippets.

View selimb86's full-sized avatar

Selim B. selimb86

  • Professional Consultant
  • In The World
View GitHub Profile
@selimb86
selimb86 / gist:da6ebcfaf23f1d6ce8af2b4ef5d3dc9e
Last active May 6, 2021 12:41
odoo-commands-restore-db
createdb -O odoo_dbuser db_name
pg_restore -v -U odoo_dbuser -Fc -d db_name your_dump.dump --no-owner -W
@selimb86
selimb86 / docker-machine
Last active January 16, 2024 05:08
docker-machine
# Ubuntu 20.04
```
sudo apt update
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
@selimb86
selimb86 / microk8s--gitlab-ci.txt
Last active January 6, 2021 12:55
microk8s--gitlab-ci
# Hint: the usage of sudo instead of becoming root user is prefered
$ sudo apt install -y snap
$ sudo snap install microk8s --classic --channel=1.17/stable
$ sudo usermod -a -G microk8s $USER
$ sudo chown -f -R $USER ~/.kube
# Add public IP to CA if it is not already added as this may differ from a vm to another
@selimb86
selimb86 / ovh-sys-proxmox-cloudimg-templates-preparation
Last active July 31, 2022 10:49
OVH/SoYouStart Proxmox cloud images templates preparation
# Prerequisites:
# - OVH/SoYouStart IPS
# - OVH/SoYouStart Dedivated Server
#
* Step 1 (GUI)
Chose an ip for each cloud image template amd create Virtual MACs from OVH/SoYouStart Manager
* Step 2 (CLI)
# cd /var/lib/vz
@selimb86
selimb86 / clean-up-boot-partition-ubuntu.md
Created June 25, 2018 00:17 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@selimb86
selimb86 / letsencrypt_cert.sh
Last active January 14, 2017 12:30
Generate LetsEncrypt certificates for use in your servers
# Download the certbot and make it executable
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
# When using --standalone make sure to turn your servers are down
./certbot-auto certonly --standalone -d hostname.exemple.com
# Certifications will be created under:
# Certificate: /etc/letsencrypt/live/hostname.exemple.com/fullchain.pem;
# AND
@selimb86
selimb86 / extract_youtube_video_id_from_any_youtube_URL.js
Last active December 12, 2015 09:19
This snippets show how to extract the video id of a youtube video from its URL
// Source : http://stackoverflow.com/questions/3452546/javascript-regex-how-to-get-youtube-video-id-from-url
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
var match = url.match(regExp);
if (match&&match[2].length==11){
return match[2];
}else{
//error
}