Skip to content

Instantly share code, notes, and snippets.

View Africanpride's full-sized avatar

AfricanPride Africanpride

View GitHub Profile
@Africanpride
Africanpride / setperms.sh
Created January 27, 2023 18:21 — forked from eritislami/setperms.sh
Set permissions for laravel application on ubuntu/nginx
# Allow execution
# chmod +x ./setperms.sh
# Usage
# ./setperms.sh /var/www/domain.com
cd $1
sudo chown -R $USER:www-data .
sudo find . -type f -exec chmod 664 {} \;
sudo find . -type d -exec chmod 775 {} \;
@Africanpride
Africanpride / docker-examples.md
Created June 1, 2022 10:18 — forked from thaJeztah/docker-examples.md
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@Africanpride
Africanpride / tailwind-darkmode-toggle.html
Created May 18, 2022 09:04 — forked from sjones6/tailwind-darkmode-toggle.html
A darkmode toggle using tailwindcss
<div class="w-14 h-8">
<input type="checkbox" id="dark-mode-toggle" class="hidden" onchange="document.documentElement.classList.toggle('dark')" />
<label for="dark-mode-toggle" class="w-full h-full bg-gray-800 dark:bg-white rounded-full p-1 flex justify-between cursor-pointer">
<span class="inline dark:hidden">🌞</span>
<span class="w-6 h-6 rounded-full bg-white dark:bg-gray-800 block float-right dark:float-left"></span>
<span class="hidden dark:inline">🌛</span>
</label>
</div>
@Africanpride
Africanpride / docker-cleanup.sh
Created March 11, 2022 14:24 — forked from skounis/docker-cleanup.sh
Stop and Remove all Docker containers. Clean up
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)
docker system prune --volumes
@Africanpride
Africanpride / index.html
Created November 5, 2021 09:37 — forked from CodeMyUI/index.html
Ken Burns effect - pure css
<div class="image-wrap">
<img src="https://unsplash.it/900/700">
</div>
@Africanpride
Africanpride / wget.sh
Created December 11, 2020 17:11 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@Africanpride
Africanpride / oselab_dns_installer.sh
Created May 17, 2017 23:17 — forked from rafaeltuelho/oselab_dns_installer.sh
Bash script to configure a DNS Server (Bind) to be used in a OSEv3 environment (RHEL 7.1 >)
#!/bin/bash
guid=`hostname|cut -f2 -d-|cut -f1 -d.`
yum -y install bind bind-utils
systemctl enable named
systemctl stop named
### firewalld was being a bit problematic
### Since we turn it off later anyway, I've skipped this step.
#firewall-cmd --permanent --zone=public --add-service=dns