Skip to content

Instantly share code, notes, and snippets.

View SalahAdDin's full-sized avatar
🎯
Focusing

José Luis SalahAdDin

🎯
Focusing
View GitHub Profile
@SalahAdDin
SalahAdDin / nginx-phpfpm-phppgadmin configuration
Last active October 2, 2023 16:50
Take care so much, this is Arch Linux configuration, not other. See the arch phppgadmin wiki for know where are fpm.socket, it's very important! Really, really, really importante create the log files.
#user html;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@SalahAdDin
SalahAdDin / commands.md
Created January 21, 2019 14:48
Repairing Arch/Manjaro Grub

If we have access to the grub rescue, we can do the next steps:

grub rescue > ls
(hd0)... (hd0,gpt8)...
grub rescue > ls (hd2,gpt8) # try to recognize which partition is this
grub rescue > ls (hd2,gpt6) # let's assume this is the linux partition
grub rescue > set root=(hd2,gpt6)
grub rescue > set prefix=(hd2,gpt6)/boot/grub # or wherever grub is installed
grub rescue > insmod normal # if this produced an error, reset root and prefix to something else ..
grub rescue > normal
@SalahAdDin
SalahAdDin / LectureWidget.cpp
Created August 9, 2019 09:56
A try to create a default widget totally in c++.
// Fill out your copyright notice in the Description page of Project Settings.
#include "LectureWidget.h"
#include "Blueprint/WidgetTree.h"
#include "Components/Button.h"
#include "Components/Image.h"
#include "Components/CanvasPanel.h"
#include "Components/CanvasPanelSlot.h"
#include "Layout/Anchors.h"
@SalahAdDin
SalahAdDin / Steps.md
Last active May 29, 2022 06:11
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk
@SalahAdDin
SalahAdDin / solution.js
Created May 13, 2022 20:16
Code Challenge Solution
const getNonConstructibleChange = (input) => {
const coins = input.sort((a, b) => a - b);
let currentChange = 0;
coins.forEach((coint) => {
const aimedChange = currentChange + 1;
if (coint > aimedChange) return aimedChange;
@SalahAdDin
SalahAdDin / DockerFile
Created September 17, 2016 23:56
Django + Docker + Postgres + ElasticSearch + Redis recipe
FROM python:3.5.2
RUN apt-get update \
&& apt-get install -y gettext curl sudo \
&& curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - \
&& apt-get install -y nodejs \
&& apt-get install -y libpng-dev libtiff5-dev libjpeg62-turbo-dev zlib1g-dev \
libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk \
libopenjpeg-dev pngquant libmagickwand-dev imagemagick \
&& apt-get autoremove -y --purge \
@SalahAdDin
SalahAdDin / instructions.md
Last active July 3, 2020 11:55
Loading SVGR as URL react

First, install url-loader along side with svgr: yarn add -D url-loader.

Add the loader to svg test option:

{
  test: /\.svg$/,
  use: ["@svgr/webpack", "url-loader"],
},
@SalahAdDin
SalahAdDin / command.md
Last active May 16, 2019 14:32
Setup to Darknet and Deeplearning

First, we need to install allr required libraries:
sudo pacman -S python-numpy vtk hdf5 openmp opencv cuda cudnn
It installs all requirements to work with the GPU and the OpenCv's support to Darknet and other libraries; hdf5 is required to work with opencv in python; vtk is required to compile Darknet.
By default Darknet handles libraries' references on Debians based linux systems, then, it requires opencv's as well as cuda references to work; in ArchLinux, opencv is in its 4.1.0 and it used opencv4 as environment variable, we need change the reference then:
sudo cp /usr/lib/pkgconfig/opencv4.pc /usr/lib/pkgconfig/opencv.pc.
While the cuda library is installed in a different folder than Debian's based systems, we need to created a symbolic link to solve this problem:
sudo ln -s /opt/cuda/ /usr/local/cuda.

@SalahAdDin
SalahAdDin / Installing Arch Linux
Last active May 16, 2019 13:40
Custom arch linux installation
sudo pacman -Syyu
sudo pacman -S noto-fonts-emoji docker python-pip python-virtualenv python-numpy vlc variety inkscape krita linux-headers nodejs npm opera nginx postgresql pgadmin4 postgresql-old-upgrade postgresql-docs postgresql-libs elasticsearch clang ttf-aboriginal-sans
sudo pacman -S llvm firefox-i18n-es-mx firefox-i18n-es-ar firefox-i18n-tr wxpython openmp ttf-freefont lua-socket tk sane
sudo pacman -S postgis gdal hdf5 libreoffice-extension-writer2latex libreoffice-extension-texmaths libreoffice-fresh-ar libreoffice-fresh-eu libreoffice-fresh-tr yarn yay code opencv
yay -S hunspell-tr hunspell-ar rar libreoffice-extension-libregreek libreoffice-extension-dictionaries-es libreoffice-extension-languagetool libreoffice-extension-writer2epub spotify kitekatic gitkraken
sudo pacman -S noto-fonts-emoji deepin-voice-recorder deepin-grub2-themes docker zsh opera-ffmpeg-codecs python-pip python-virtualenv vlc variety neofetch inkscape krita 0ad gedit-plugins gparted linux-headers 0ad-data nodejs npm oper
@SalahAdDin
SalahAdDin / Commands.md
Last active May 2, 2019 12:46
PostgresSQL commands

Enter to superuser: sudo su
Enter to postgres user: sudo -iu postgres
Enter to user: sudo -iu $username$
Enter to console with authentication: psql -d $databasename$ -U $username$ -W
Enter to postgres console(default database): psql
Enter to postgres console(other database): psql -d $databasename$
Disconnect: \q

List all databases: \l
List all schemas: \dn