Skip to content

Instantly share code, notes, and snippets.

View TDFS-Dom's full-sized avatar
🎯
Focusing

Nguyễn Hữu Toàn TDFS-Dom

🎯
Focusing
View GitHub Profile
@TDFS-Dom
TDFS-Dom / M1_Python3.7.sh
Created May 24, 2023 15:15
Install python 3.7 in Mac OS M1 ARM
## create empty environment
conda create -n py37
## activate
conda activate py37
## use x86_64 architecture channel(s)
conda config --env --set subdir osx-64
## install python, numpy, etc. (add more packages here...)
#docker stack deploy -c swarm.yml runner
version: '3.7'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
@TDFS-Dom
TDFS-Dom / docker-install.sh
Last active April 14, 2023 05:09
docker-install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@TDFS-Dom
TDFS-Dom / 1024_increase_swap.sh
Created March 26, 2023 11:45
1024 Increase Swap
#!/bin/sh
# size of swapfile in megabytes
swapsize=1024
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@TDFS-Dom
TDFS-Dom / Docker-Portainer-HTTPS.sh
Created November 23, 2022 07:17
Docker + Portainer + Let's Encrypt
#!/bin/bash
#
# Docker + Portainer + Let's Encrypt
# Author: Daniel M. Hendricks
# Web Site: https://www.danhendricks.com/
# Feedback: https://daniel.hn/contact/
#
# IMPORTANT: Once deployed, visit https://{host}:9000 to change the default admin password!
#
# <UDF name="hostname" label="Hostname" example="Example: docker01" />
@TDFS-Dom
TDFS-Dom / First-Install.sh
Created November 23, 2022 07:14
Cockpit + Docker + Docker-Compose + Portainer + Portainer-Agent + Nginx-Proxy-Manager + ctop
#!/bin/bash
# SIMPLE WAYS TO MAKE LIFE EASIER
# Better Performance use Linode 2 GB
# Ubuntu 21.10 , Ubuntu 21.04 , Ubuntu 20.04 , Ubuntu 18.04 , Ubuntu 16.04 , Debian 11 , Debian 10 , Debian 9
# Cockpit + Docker + Docker-Compose + Portainer + Portainer-Agent + Nginx-Proxy-Manager + ctop
#
# Fixed repo full update and upgrade - REBOOT after upgrade
# UPGRADE disable if not need line 141 # not upgrade first or not working all ubuntu releases ,tested
# UPGRADE take some time about 3 min after that there is a reboot,Don't be surprised if the connection is lost for a while.
# All Docker Official Images
@TDFS-Dom
TDFS-Dom / gdrive.js
Created December 1, 2021 09:39
gdrive.js
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdfDocumentName = "Document-GDrive.VIP";
let doc;
function generatePDF (){
let imgTags = document.getElementsByTagName("img");
let checkURLString = "blob:https://drive.google.com/";
let validImgTagCounter = 0;
for (i = 0; i < imgTags.length; i++) {
if (imgTags[i].src.substring(0, checkURLString.length) === checkURLString){
@TDFS-Dom
TDFS-Dom / wp_permistion.sh
Created October 24, 2021 00:51
wp_permistion.sh
#!/bin/bash
WP_OWNER=root # &lt;-- wordpress owner
WP_GROUP=root # &lt;-- wordpress group
WS_GROUP=www-data # &lt;-- webserver group
# reset to safe defaults
find . -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
@TDFS-Dom
TDFS-Dom / apache_install.sh
Last active June 15, 2021 12:48
apache_install.sh
#!/bin/sh
# This script will install a new BookStack instance on a fresh Ubuntu 18.04 server.
# This script is experimental and does not ensure any security.
# Fetch domain to use from first provided parameter,
# Otherwise request the user to input their domain
DOMAIN=$1
if [ -z $1 ]
then
echo ""
@TDFS-Dom
TDFS-Dom / remove_apache.sh
Last active June 15, 2021 12:33
remove_apache.sh
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2