Here is what I do on my projects in jupyter notebook,
import sys
sys.path.append("../") # go to parent dir
from customFunctions import *
| import requests | |
| from bs4 import BeautifulSoup | |
| import os | |
| from urllib.parse import urljoin, urlparse | |
| from tqdm import tqdm | |
| # Create a folder to save images | |
| os.makedirs('maurelia_images', exist_ok=True) |
| #!/bin/bash | |
| # This script will stop the service, backup the data folder including | |
| # the database, the attachments and keys of your vaultwarden installation. | |
| # Only the last 14 backups will be kept. If you want to keep more or less, please | |
| # adjust the time on the last line of the script | |
| # for this script to work to work adjust the following 4 folders to your environment | |
| # timestamp added to the backup filename e.g. 20220130-1325 | |
| NOW=$(date +'%Y%m%d-%H%M') |
| cat > /etc/apk/repositories << EOF; $(echo) | |
| http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main | |
| http://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community | |
| EOF | |
| apk update |
ORIGINAL BLOG POST https://www.atlassian.com/git/tutorials/dotfiles
Disclaimer: the title is slightly hyperbolic, there are other proven solutions to the problem. I do think the technique below is very elegant though.
Recently I read about this amazing technique in an Hacker News thread on people's solutions to store their dotfiles. User StreakyCobra showed his elegant setup and ... It made so much sense! I am in the process of switching my own system to the same technique. The only pre-requisite is to install Git.
| #!/bin/bash | |
| # -------------------- | |
| # place this file anywhere where it can be execute fromthe webhook.php file. | |
| # make sure, you put the correct path to this file into the webhook.php | |
| # webdirectory is a directory accessible via internet, but not the main websites directory | |
| # .. ideally webdirectory is a access via subdomain | |
| # -------------------- | |
| # set PATH |
| <?php | |
| /** | |
| * GitLab Web Hook | |
| * See https://gitlab.com/kpobococ/gitlab-webhook | |
| * | |
| * This script should be placed within the web root of your desired deploy | |
| * location. The GitLab repository should then be configured to call it for the | |
| * "Push events" trigger via the Web Hooks settings page. | |
| * | |
| * Each time this script is called, it executes a hook shell script and logs all |
| <html> | |
| <head> | |
| <style> | |
| body { | |
| font-family: Verdana, sans-serif; | |
| margin: auto; | |
| padding: 20px; | |
| text-align: left; | |
| background-color: #fff; |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" |