Skip to content

Instantly share code, notes, and snippets.

View swipswaps's full-sized avatar

#swipswaps swipswaps

View GitHub Profile
@swipswaps
swipswaps / README.md
Created September 22, 2022 13:15 — forked from Nokius/README.md
[Terraform][proxmox] small VM created with terraform on proxmox

terraform-provider-proxmox

simple VM created with terraform-provider-proxmox

  • one core
  • 512MB RAM
  • Ubuntu netinstall CDROM
  • 32GB IDE HDD
  • bridged network interface
@swipswaps
swipswaps / failover.sh
Created August 23, 2022 21:38 — forked from Apsu/failover.sh
An example failover script for dual WAN, using a ping healthcheck and managing default routes appropriately
#!/bin/bash
# Set defaults if not provided by environment
CHECK_DELAY=${CHECK_DELAY:-5}
CHECK_IP=${CHECK_IP:-8.8.8.8}
PRIMARY_IF=${PRIMARY_IF:-eth0}
PRIMARY_GW=${PRIMARY_GW:-1.2.3.4}
BACKUP_IF=${BACKUP_IF:-eth1}
BACKUP_GW=${BACKUP_GW:-2.3.4.5}
@swipswaps
swipswaps / using-svelte-vercel.md
Created December 23, 2021 01:01 — forked from PierBover/using-svelte-vercel.md
Using Svelte in a Vercel serverless function

Using Svelte in a Vercel serverless function

The easiest way of using Svelte for SSR in Node is by using svelte/register. This allows to require .svelte files without any bundling and render HTML, CSS, etc.

This is the example from the docs:

require('svelte/register');

const App = require('./App.svelte').default;
//install gh in linux
//Copyright ©2021 by @swipswaps, All rights reserved.
//from computingforgeeks.com/how-to-install-github-cli-on-linux-and-windows
//https://gist.github.com/swipswaps/e417ef24bfa759aad46bb9c3e9461edf
#VERSION=`curl "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2-` && echo $VERSION
#wget -c https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_amd64.tar.gz && tar xvf gh_${VERSION}_linux_amd64.tar.gz && sudo cp gh_${VERSION}_linux_amd64/bin/gh /usr/local/bin/ && gh version
#gh auth login
@swipswaps
swipswaps / swipswaps.txt
Last active December 21, 2021 17:04
clipboard substitution of forward slash characters to underscore using xsel or xclip
//xsel or xclip awk clipboard substitution of forward slash characters
//Copyright ©2021 by @swipswaps, All rights reserved.
//https://gist.github.com/swipswaps/2b366eb07168e0ec620ee6ea6b225cbe
//clipboard substitution of forward slash characters to underscore using xsel
#echo $(xsel -ob) |awk '{gsub(/\//,"_",$0)}1' |xsel -ib && xsel -ob
//clipboard substitution of forward slash characters to underscore using xclip
#echo $(xclip -o -selection clipboard) |awk '{gsub(/\//,"_",$0)}1' |xclip -selection c && echo $(xclip -o -selection clipboard)
@swipswaps
swipswaps / certbot-renew
Created December 2, 2021 23:11 — forked from ajaegers/certbot-renew
Simple Certbot (Let's Encrypt) script for auto-renewal certificates
# Put this file in folder /etc/cron.d/
MAILTO="debug@example.com"
0 1 * * * root /usr/local/sbin/certbot-renew.sh
https://openvpn.net/vpn-server-resources/managing-settings-for-the-web-services-from-the-command-line/#Installing_a_signed_SSL_certificate
https://certbot.eff.org/docs/using.html
https://serverfault.com/questions/215606/how-do-i-view-the-details-of-a-digital-certificate-cer-file
https://sideras.net/2016/02/24/lets-encrypt-https-certificates-for-openvpn-as-access-server/
https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
sudo certbot renew --dry-run ( use --verbose if you want )
sudo service openvpnas start ( or sudo ./sacli start )
sudo service openvpnas stop ( or sudo ./sacli stop )
@swipswaps
swipswaps / install.sh
Created December 2, 2021 00:06 — forked from planetoftheweb/install.sh
installation for Vue and Firebase single
npm i --save-dev @fortawesome/fontawesome-free @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/vue-fontawesome bootstrap jquery popper.js firebase
@swipswaps
swipswaps / README.md
Created November 4, 2021 13:44 — forked from vukhanhtruong/README.md
Multiple WordPress Sites on Docker with Letsencrypt

Host Multiple WordPress Sites behind Nginx Proxy

With the following “Docker recipe”, you will set up a Docker node running separate WordPress installation on two domains or subdomains. This setup is pretty much production ready, with:

  • nginx reverse proxy by Jason Wilder that automatically routes traffic to new containers that are created with the VIRTUAL_HOST=sub.domain.com environment variable. This nifty container performs a similar function to Traefik or HAProxy, but it is amazingly simple to use.
  • letsencrypt-nginx-proxy-companion by Yves Blusseau that obtains an SSL certificate from Let’s Encrypt, the free Certificate Authority, when you specify the LETSENCRYPT_HOST and LETS_ENCRYPT_EMAIL environment variables on any application container (i.e. WordPress) that needs to be served over HTTPS. The companion even pings Let’s Encrypt every 90 days to automatically renew your certificates!
  • Of
@swipswaps
swipswaps / ebay_scraper.py
Created October 16, 2021 15:56 — forked from fadere/ebay_scraper.py
python code to scrape ebay historical auction results
import csv
import requests
import bs4
import argparse
# parser = argparse.ArgumentParser(description='Process a list of search terms.')
# parser.add_argument('terms', metavar='N', type=str, nargs='+',
# help='comma separated list of terms to search for')
# args = parser.parse_args()