Skip to content

Instantly share code, notes, and snippets.

@mezhgano
mezhgano / playwright_save_mhtml.py
Created May 1, 2023 14:58
Save .mhtml web archive using playwright
from playwright.sync_api import sync_playwright
def save_mhtml(path: str, text: str):
with open(path, mode='w', encoding='UTF-8', newline='\n') as file:
file.write(text)
def save_page(url: str, path: str):
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active June 29, 2024 11:18
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@jianyun8023
jianyun8023 / book-convert.sh
Created April 21, 2022 10:36
ebook convert base on eCore
#!/bin/bash
workdir=$(pwd)
filepath=$1
format=$2
outdir=$3
book_convert(){
filepath=$1
format=$2
tmp_dir="$HOME/Downloads/eCoreCmdtmp/$(uuidgen)"
mkdir -p $tmp_dir
@MikeeI
MikeeI / geekbench5.sh
Last active September 12, 2023 10:04
Script - Geekbench 5
#!/bin/bash
wget http://cdn.geekbench.com/Geekbench-5.4.5-Linux.tar.gz
tar -zxvf Geekbench-5.4.5-Linux.tar.gz
cd Geekbench-5.4.5-Linux
./geekbench_x86_64
echo END
@dimMaryanto93
dimMaryanto93 / 01-network-manager-all.dhcp.yml
Last active January 23, 2021 10:30
network settings for ubuntu 18.04 server with wifi and ethernet
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
dhcp4: yes
dhcp6: no
optional: false
@sutlxwhx
sutlxwhx / README.md
Last active March 13, 2024 14:44
Enable RDP and access to the virtual machines for your Proxmox installation

Introduction

This tuturial will help you configure network for your fresh Proxmox istallation.
Be aware that Proxmox configuration was made using this tutorial.

Installation

Backup your current /etc/network/interfaces using this command:

cp /etc/network/interfaces /etc/network/interfaces.backup
@victoraguilarc
victoraguilarc / prestashop-nginx.conf
Last active March 24, 2020 10:31
NGINX Configuration for Prestashop 1.7.3, its works fully
server {
charset utf-8;
#listen <YOUR_IP>:80;
server_name <YOUR_DOMAIN> www.<YOUR_DOMAIN>;
root /PATH/TO/YOUR/PRESTASHOP/INSTALLATION;
index index.php;
access_log /var/log/nginx/domains/<YOUT_DOMAIN>.log combined;
@AlexeySetevoi
AlexeySetevoi / build-nginx-geoip2-deb.sh
Last active April 17, 2020 11:33
nginx geoip2 debian
#!/bin/bash
nginxver=`apt show nginx-full |grep Version | awk '{print $2}' |awk -F '-' '{print $1}'`
nginxname=nginx-$nginxver.tar.gz
nginxdir=nginx-$nginxver
#apt -y install libmaxminddb0 libmaxminddb-dev mmdb-bin
if [ -f "$nginxname" ]
@cbcafiero
cbcafiero / replacements.py
Last active November 3, 2022 09:00
Easy multiple search and replace by tag and attribute with BeautifulSoup
"""
Sometimes you want to make several different replacements. Search by tag with
optional attributes. Replace with tag with optional attributes.
Thank you to Dan @ University of Exeter for bug fix
"""
from bs4 import BeautifulSoup
REPLACEMENTS = [('b', {}, 'strong', {}),
package main
import (
"database/sql"
"gopkg.in/gorp.v1"
"log"
"strconv"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"