Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Focusing

souhaiebtar

:octocat:
Focusing
View GitHub Profile
@souhaiebtar
souhaiebtar / Dockerfile
Created March 9, 2023 10:38
[php fpm image WIP] php fpm image #fpm #php #docker
View Dockerfile
FROM php:7.3.33-fpm-bullseye
COPY libenchant1c2a_1.6.0-11.1+b1_amd64.deb libenchant-dev_1.6.0-11.1+b1_amd64.deb /tmp/
RUN apt-get update && apt-get install -y unixodbc-dev libpng-dev libgmp-dev libicu-dev libldap2-dev libpq-dev libpspell-dev \
libsnmp-dev libxml2-dev libtidy-dev libxslt1-dev libzip-dev libbz2-dev librecode-dev \
&& apt install -y -f /tmp/libenchant1c2a_1.6.0-11.1+b1_amd64.deb && apt install -y -f /tmp/libenchant-dev_1.6.0-11.1+b1_amd64.deb \
&& rm -f /tmp/libenchant1c2a_1.6.0-11.1+b1_amd64.deb /tmp/libenchant-dev_1.6.0-11.1+b1_amd64.deb \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure pdo_odbc --with-pdo-odbc=unixODBC,/usr \
@souhaiebtar
souhaiebtar / linux_distro.md
Last active February 26, 2023 23:15
[linux distro] linux distro #linux #distro
View linux_distro.md

----distro--- BunsenLabs / Crunchbang++ mabox sparkylinux mxlinux archcraft linux lite bodhi garuda elementary

@souhaiebtar
souhaiebtar / ntfs-console-and-kernel-linuxRelated.md
Created February 26, 2023 16:39
[ntfs, console ui and kernel version] ntfs, console ui and kernel version] #linux #ntfs #kernel #console
@souhaiebtar
souhaiebtar / share_folder_using_nfs_on_linux.md
Last active March 1, 2023 17:10
[share folder using nfs] share folder using nfs on linux #nfs #linux #share
View share_folder_using_nfs_on_linux.md

In the server side ( the machine that contain the folder you want to share)

sudo dnf install nfs-utils
sudo systemctl enable rpcbind
sudo systemctl enable nfs-server
sudo service rpcbind start
sudo service nfs-server start

edit /etc/exports

@souhaiebtar
souhaiebtar / symfony terminology.md
Created February 15, 2023 09:16
[terminology and info symfony] terminology and info symfony #symfony
View symfony terminology.md

dependency injection

serializer

autowiring

http request response flow

@souhaiebtar
souhaiebtar / ssh_cheat_sheet.md
Created January 14, 2023 13:13
[ssh cheat sheet] ssh cheat sheet #ssh
View ssh_cheat_sheet.md

ssh using password

ssh -o PreferredAuthentications=password vagrant@172.16.26.157

ssh using public key

ssh -o pubKeyAuthentication=yes -i ~/.ssh/pub_key2 tunknown@192.168.22.1

@souhaiebtar
souhaiebtar / logSqlQueryToFile.md
Created December 7, 2022 13:14
[log all sql queries in mariadb or mysql] log all sql queries in mariadb or mysql to a file #log #sql #mysql #maria
View logSqlQueryToFile.md

for mysql 5.6+, add to the mysql config file the next block of code

[mysqld]
general_log = on
general_log_file=/usr/log/general.log

for mariadb, add to the mariadb config file the next block

@souhaiebtar
souhaiebtar / util_sql_query.sql
Created November 30, 2022 11:03
[util sql query] util sql query #sql #util #db
View util_sql_query.sql
-- list all tables that have column with name 'ID_CAT'
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('ID_CAT')
AND TABLE_SCHEMA='ppgt01';
--
@souhaiebtar
souhaiebtar / give_user_sudo.sh
Created November 15, 2022 07:43
[give user sudo permision on alpine] give user sudo permission on alpine #sudo #alpine #linux
View give_user_sudo.sh
adduser -D $USER && mkdir -p /etc/sudoers.d \
&& echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \
&& chmod 0440 /etc/sudoers.d/$USER