Skip to content

Instantly share code, notes, and snippets.

View mohamed-ea's full-sized avatar

Mohamed El Allali mohamed-ea

View GitHub Profile
@mohamed-ea
mohamed-ea / gist:dde6263fcd95eb18f793ce663b942d1a
Created September 11, 2023 08:45
HomeLab: NextCloud with ISPConfig
# Nginx:
server {
if ($host = mcloud.MY-HOMELAB.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name mcloud.MY-HOMELAB.com;
}
server {
@mohamed-ea
mohamed-ea / used-ports.sh
Created September 11, 2023 08:42
linux commands: Used ports
# To check the listening ports and applications on Linux:
# Open a terminal application i.e. shell prompt.
# Run any one of the following command on Linux to see open ports:
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo ss -tulpn | grep LISTEN
sudo lsof -i:22 ## see a specific port such as 22 ##
sudo nmap -sTU -O IP-address-Here
@mohamed-ea
mohamed-ea / gist:4cbddf5e9e8be600e1026749c1144a55
Created October 20, 2022 10:59
DBeaver: unexpected end of stream, read 0 bytes from 4
BUG:
Could not connect to address=(host=127.0.0.1)(port=2234)(type=master) : Could not connect to 127.0.0.1:2234 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Could not connect to 127.0.0.1:2234 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
Could not connect to 127.0.0.1:2234 : unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
SOLUTION:
set connect string :
@mohamed-ea
mohamed-ea / Fix LC_* notifications
Last active November 13, 2018 08:55
Cannot set LC_ALL to default locale: No such file or directory
vim .bashrc
et ajoutez cette ligne:
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
export LANGUAGE="en_US.UTF-8"
Enregistrez le fichier et validez vos changements immédiatement avec la commande source :
source .bashrc
@mohamed-ea
mohamed-ea / settings.php
Last active May 10, 2018 16:07
subfolder as root
<?php
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation program.
* If you make changes to this file, be sure to protect it again after making
* your modifications. Failure to remove write permissions to this file is a
@mohamed-ea
mohamed-ea / howto.md
Created August 8, 2017 00:36 — forked from romuloctba/howto.md
Android 4.0.3 with Ionic Framework

I want to make Ionic Framework projects work on Android 4.0.3

  • Android 4.0.3 is API Lvl 15, download it via ADV

  • npm install -g cordova@4.0.0 (Newer versions may not work with android-15)

  • ionic platform add android

  • edit config.xml > ``

@mohamed-ea
mohamed-ea / init-git-existingsource.sh
Created January 17, 2017 23:56
Convert existing non-empty directory into a Git repository
cd <localdir>
git init
git add .
git commit -m 'message'
git remote add origin <url>
git push -u origin master
@mohamed-ea
mohamed-ea / git-change-origin.sh
Created January 2, 2017 16:17
Change "origin" of a GIT repository
$ git remote -v
$ git remote rm origin
$ git remote add origin git@github.com:newgit/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
$ git push
@mohamed-ea
mohamed-ea / dev-env-setup
Last active January 6, 2017 18:07
My Development Environment Setup on Linux (ElementaryOS)
# Update system
sudo apt-get update -y
# Install the software-properties-common Package
sudo apt install -y build-essential libssl-dev software-properties-common python-software-properties curl autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev git-core
# Elementary Tweaks
sudo add-apt-repository ppa:philip.scott/elementary-tweaks
sudo apt-get update