Skip to content

Instantly share code, notes, and snippets.



View GitHub Profile
souhaiebtar /
Created Dec 17, 2020
[vagrantfile debian with bridged network and nested virtualization] vagrantfile debian with bridged network and nested virtualization #vagrant #virtualization
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
souhaiebtar / pre-commit
Last active Dec 10, 2020
[pre-commit git hook for DB] pre-commit git hook for DB #git #hooks #linux
View pre-commit
#!/usr/bin/env bash
git --work-tree=../ --git-dir=../.git
now=$(date -Is)
cd ../laradock
docker-compose exec -T mysql mysqldump -u root --password=root project_db > ../public/DB/PROJECT-NAME_$now.sql
cd ../public
git add DB/PROJECT-NAME_$now.sql
exit 0
souhaiebtar /
Created Nov 27, 2020
[remove empty line using CLI] removing empty line using CLI #unix #sed #removeLine
sed -i '/^$/d' FILE.txt
souhaiebtar /
Created Nov 25, 2020
[configure sendmail on ubuntu to enable sending email] configure sendmail in ubuntu #mail #ubuntu
### RUN
apt install --no-install-recommends sendmail-bin mailutils
mkdir -m 700 /etc/mail/authinfo
### --- START
vim /etc/mail/authinfo/gmail-smtp-auth
## add this to file
AuthInfo: "U:root" "" "P:GMAIL_USER_PASSWORD"
souhaiebtar / 404.html
Created Nov 24, 2020
[404.html] 404.html #html #redirect
View 404.html
<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1">
body, html {
height: 100%;
margin: 0;
font: 400 15px/1.8 "Lato", sans-serif;
color: #777;
souhaiebtar /
Created Nov 18, 2020
[clean up efi bootloader on linux] clean up efi bootloader on linux #EFI #linux
# lists entries
efibootmgr -v
# remove entry number 2
efibootmgr -b 0002 -B
souhaiebtar / php.ini
Last active Nov 18, 2020
[disable showing error and warning in php] disable showing error and warning in php #php #errors
View php.ini
; add those lines to php.ini file, you can find it's location using command `php --ini | grep -i php.ini`
; if you are using ondrej/php repo, you should add it to /etc/php/7.*/fpm/php.ini
error_reporting = E_ALL & ~E_NOTICE
error_reporting = E_ALL & ~E_NOTICE | E_STRICT
error_reporting = E_ALL & ~E_NOTICE
souhaiebtar /
Created Nov 12, 2020
[disable snap in ubuntu] disable snaps in ubuntu #ubuntu #snap
snap list
## than remove every package
sudo umount /snap/core/xxxx # replace xxx
sudo umount /var/snap
sudo apt purge snapd
rm -rf ~/snap
souhaiebtar /
Last active Nov 9, 2020
[stop removing file by making file immutable] stop removing file #linux #delete #immutable
chattr +i file.desktop
souhaiebtar /
Created Nov 7, 2020
[install dependency needed to compile sushi, vala-lint, sequeler, eddy, clipper on ubuntu 2010] install dependency needed to compile sushi, vala-lint, sequeler, eddy, clipper on ubuntu 2010 #ubuntu #dependency

sudo apt-get install gnome-shell-extension-prefs curl vim tmux zsh chrome-gnome-shell

sudo apt install --no-install-recommends meson libevince-dev gir1.2-gstreamer-1.0 librust-gstreamer-audio-sys-dev librust-gstreamer-audio-sys-dev libgtksourceview-4-dev libmusicbrainz5-dev libwebkit2gtk-4.0-dev libgirepository1.0-dev ninja-build ### needed for compiling gnome-sushi because there is a bug in version shipped with ubuntu 2010

sudo apt install valac libgranite-dev libpackagekit-glib2-dev libunity-dev sudo apt install --no-install-recommends valac libgranite-dev libpackagekit-glib2-dev libunity-dev sudo apt-get install --no-install-recommends build-essential sudo apt-get install libgee-0.8-dev sudo apt-get install libgda-5.0-dev sudo apt-get install libssh2-1-dev