Skip to content

Instantly share code, notes, and snippets.

View anton-dealmeida's full-sized avatar

Antonio De Almeida anton-dealmeida

View GitHub Profile
@anton-dealmeida
anton-dealmeida / untangle_letsencrypt.md
Created September 21, 2021 11:11 — forked from fizzyade/untangle_letsencrypt.md
Set Untangle certificate to an auto renewing LetsEncrypt certificate

This uses acme.sh to generate a certificate which replaces the one shown in the certificate section in the Untangle UI.

It updates on each run and if the certificate is renewed it replaces the one used by untangle and restarts apache.

if the certificate isn’t renewed, it still checks if the certificate untangle is using is the one cached by acme.sh and it will replace it and restart apache if necessary.

The crontab entries allow it to do a certificate check at reboot and also at 4am every morning.

You’ll need to download acme.sh, but it requires no extra dependencies over what is supplied in untangle, you will need to edit the acme.sh configuration file to match how you update the cert.

@anton-dealmeida
anton-dealmeida / git_easy_squash.ps1
Last active September 13, 2022 12:37
A simply little snippet to squash your git commits into one commit for merging back to your source branch.
# Roll back all the commits done since branching from a develop branch but keep the changes.
# Note: Be careful to not loose your changes after running this command.
Write-Host "Rolling back commit tree to source branch."
git reset $(git merge-base develop $(git rev-parse --abbrev-ref HEAD))
Write-Host "Remember to commit all your changes and to run git push -f"
@anton-dealmeida
anton-dealmeida / docker-cleanup-resources.md
Last active September 13, 2022 12:37 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

This is forked from here

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes    

$ docker volume rm $(docker volume ls -qf dangling=true)

@anton-dealmeida
anton-dealmeida / sqlserver-db-docker.md
Last active June 14, 2024 19:53
Docker: SQL Server with mounted Volume

SQL Server with Docker

The following script will create a Docker container which will run SQL Server and assign a password for user 'sa' This container will mount my C:\SQL_DB directory which contains my .mdf and .ldf files, it will then make those available to my container in the /sql_data directory. I can then open SQL Server Management Studio and attach my mdf files and go nuts from there.

Pull the image version you would prefer