# List images
k3s crictl images
# Remove unused images
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Shell script to automate the backup of Microsoft SQL Server vNEXT backups on Linux. | |
| # Written by Bobby Allen <[email protected]>, 26/04/2017 | |
| # | |
| # Download this script and put into your servers' /usr/bin directory (or symlink) then make it executable (chmod +x) | |
| # | |
| # Usage example (backup databases into /var/backups, keep backups for 5 days, connect to server "localhost" with the account "sa" and a password of "P455w0RD"): | |
| # mssqlbackup "/var/dbbackups" 5 "localhost" "sa" "P455w0rD" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Query the database to calculate a recommended innodb_buffer_pool_size | |
| -- and get the currently configured value | |
| -- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB. | |
| SELECT | |
| TABLE_SCHEMA, | |
| CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) | |
| Recommended_InnoDB_Buffer_Pool_Size, | |
| ( | |
| SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import time | |
| def query_10k(cur): | |
| t = time.time() | |
| for _ in range(10000): | |
| cur.execute("SELECT 1,2,3,4,5") | |
| res = cur.fetchall() | |
| assert len(res) == 1 | |
| assert res[0] == (1,2,3,4,5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "log": { | |
| "logelevel": "info" | |
| }, | |
| // Run a local SOCKS proxy for apps to connect to. | |
| "inbounds": [{ | |
| "port": 1080, | |
| "listen": "127.0.0.1", | |
| "protocol": "socks", | |
| "sniffing": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from time import sleep | |
| import requests | |
| import json | |
| def vote(): | |
| req = requests.post('https://www.menti.com/core/identifiers', | |
| headers={'authority': 'www.menti.com', | |
| 'content-length': '0', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # file: ttfb.sh | |
| # curl command to check the time to first byte | |
| # ** usage ** | |
| # 1. ./ttfb.sh "https://google.com" | |
| # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Code from best solution in page below: | |
| # https://help.zoho.com/portal/community/topic/zoho-mail-servers-reject-python-smtp-module-communications | |
| import smtplib | |
| from email.mime.text import MIMEText | |
| from email.header import Header | |
| from email.utils import formataddr | |
| # Define to/from | |
| sender = '[email protected]' |
NewerOlder