Skip to content

Instantly share code, notes, and snippets.

View sabrysuleiman's full-sized avatar

Sabry Suleiman sabrysuleiman

View GitHub Profile
@sabrysuleiman
sabrysuleiman / social sharing URLs
Last active April 18, 2024 12:59 — forked from csknk/social sharing URLs
Social Share URLs
https://twitter.com/intent/tweet?text={$encodedText}&url={$encodedUrl}
http://pinterest.com/pin/create/bookmarklet/?media=[MEDIA]&url=[URL]&is_video=false&description=[TITLE]
http://www.facebook.com/share.php?u=[URL]&title=[TITLE]
http://www.reddit.com/submit?url=[URL]&title=[TITLE]
http://del.icio.us/post?url=[URL]&title=[TITLE]]&notes=[DESCRIPTION]
@sabrysuleiman
sabrysuleiman / How to Enable or Disable php mod_* in Apache Ubuntu
Last active January 21, 2023 14:48
How to Enable/Disable php mod_* in Apache Ubuntu
# If you want to install Apache module such as mod_headers, you need to issue the a2enmod command
sudo a2enmod <module_name>
# Like
sudo a2enmod headers
sudo a2enmod rewrite
sudo a2enmod alias
# Restart Apache Web Server
sudo service apache2 restart
@sabrysuleiman
sabrysuleiman / Remove slug from custom post type post URLs
Created December 24, 2022 14:24
Remove slug from custom post type post URLs
'rewrite' => [
'slug' => '/',
'with_front' => false
]
@sabrysuleiman
sabrysuleiman / reset DNS settings Ubuntu
Created November 26, 2022 22:13
reset DNS settings Ubuntu
sudo rm /etc/resolv.conf && sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
systemctl restart systemd-resolved.service
@sabrysuleiman
sabrysuleiman / Install Let's Encrypt SSL on Ubuntu
Created November 24, 2022 14:41
Install Let's Encrypt SSL on Ubuntu
# Installing Certbot
sudo apt install certbot python3-certbot-apache
# Checking Apache VHost Configuration
sudo nano /etc/apache2/sites-available/your_domain.conf
# validate your changes
sudo apache2ctl configtest
# reload Apache to load the new configuration
@sabrysuleiman
sabrysuleiman / Install an FTP Server On Ubuntu
Last active November 24, 2022 12:49
Install an FTP Server On Ubuntu
# install vsftpd
sudo apt install vsftpd
# launch the service and enable it at startup
sudo systemctl start vsftpd
sudo systemctl enable vsftpd
# Create a backup copy of the default configuration file
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf_default
# Add PPA repository
sudo apt update
sudo apt install lsb-release ca-certificates apt-transport-https software-properties-common -y
sudo add-apt-repository ppa:ondrej/php
# sudo apt update
# install
sudo apt install php8.1
# ADD username to group
sudo usermod -aG www-data iain
addgroup www-data
#
sudo chown -R www-data:www-data /var/www/example.com/public_html
sudo chmod -R 770 /var/www/example.com/public_html
# Create the Directory Structure
sudo mkdir -p /var/www/example.com/public_html
# Grant Permissions
sudo chown -R $USER:$USER /var/www/example.com/public_html
sudo chmod -R 755 /var/www
# Create New Virtual Host File
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
# Install the build-essential packages
sudo apt-get install build-essential
# Write a C program
# save the file with .c extension
# Compile the C program with gcc Compiler
gcc [programName].c -o programName
# Run the program