This file contains 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
""" | |
This module contains functions for estimating the cost of OpenAI's image recognition API. | |
https://platform.openai.com/docs/guides/vision | |
Usage: | |
import openai_vision_cost | |
cost = openai_vision_cost.estimate_image_cost(image_width, image_height, detail_level) | |
Generated with the help of ChatGPT: |
This file contains 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
""" | |
OCR with ChatGPT Plus | |
Convert a bunch of image files into text, using Playwright to control your Chrome browser. | |
Prerequisites: | |
- Run `chrome --remote-debugging-port=9222` | |
- Log in to ChatGPT | |
- Select GPT-4 | |
""" |
This file contains 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
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/xenial64" | |
config.ssh.forward_x11 = true | |
config.vm.provision "shell", path: "https://gist.githubusercontent.com/elecnix/dd31ee274c5e721ce42acd27412ad3f0/raw/dbf9c3fff720c2e8aa768bf8cb264ede37cedfe2/gistfile1.txt" | |
end |
This file contains 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
wget -q https://s3.amazonaws.com/beersmith2-3/BeerSmith-2.3.12_amd64.deb | |
apt-get update | |
apt-get download libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libjavascriptcoregtk-1.0-0 | |
dpkg -i *.deb |
This file contains 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
# Ce fichier sert à exécuter un collecteur, un dashboard, et une base de données InfluxDB. | |
# | |
# 1. git clone https://gist.github.com/51637af8e7bea6d4faf8471397e4b0e5.git erabliere | |
# 2. cd erabliere | |
# 3. git clone https://github.com/elecnix/ErabliCollecteur.git | |
# 4. git clone https://github.com/elecnix/ErabliDash.git | |
# 5. docker-compose up -d | |
# 6. Ouvrir http://localhost:3000/ pour ErabliDash | |
# 7. Ouvrir http://localhost:3001/ pour Grafana | |
# |
This file contains 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 | |
repos=$(ls ~/repos) | |
for repo in $repos ; do | |
if [ -d ~/repos/$repo/.hg ] ; then | |
echo -e "\e[93m$repo\e[0m" | |
hg --cwd ~/repos/$repo qseries -v -s | |
if [ -d ~/repos/$repo/intelebase/.hg ] ; then | |
hg --cwd ~/repos/$repo/intelebase qseries -v -s | |
fi |
This file contains 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<head> | |
<script type="text/javascript" src="jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="jquery.sparkline.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
for (row = 0; row < 80; row++) { | |
var myvalues = []; | |
for (i = 0; i < 500; i++) { |
This file contains 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
#include "SparkIntervalTimer/SparkIntervalTimer.h" | |
//SYSTEM_MODE (MANUAL); | |
volatile int i = 0; // Variable to use as a counter volatile as it is in an interrupt | |
volatile boolean zero_cross = 0; // Boolean to store a "switch" to tell us if we have crossed zero | |
int AC_pin = D7; // Output to Opto Triac | |
int dim = 0; // Dimming level (0-128) 0 = on, 128 = 0ff | |
int inc = 1; // counting up or down, 1=up, -1=down |
This file contains 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
cat top-1m.csv | sed -e 's_.*,\(.*\)_echo | openssl s\_client -connect \1:443 > certs/\1.pem\&_' > certs.sh | |
bash certs.sh | |
ls certs | xargs -L1 -I DOMAIN echo 'openssl x509 -in certs/DOMAIN -text -noout > checks/DOMAIN.check' > checks.sh | |
bash checks.sh | |
cat top-1m.csv | sed -e 's#.*,\(.*\)#\1#'| xargs -n1 -P20 -I DOM grep -H 'Not After' checks/DOM.pem.check 2>/dev/null | cut -d ':' -f 1,3-|sed -e 's_checks/\(.*\).pem.check: \(.*\)_\1,\2_' > top-1m-expiry.csv |
This file contains 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
BASE_URL=https://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/ | |
TARGET_IP=192.168.1.1 | |
TARGET_USER=root | |
KERNEL_VERSION=3.10.49-1 | |
HARDWARE=ar71xx | |
MODULES="kmod-fs-vfat kmod-nls-base kmod-nls-cp437 kmod-nls-iso8859 kmod-scsi-core kmod-usb2 kmod-usb-storage" | |
for MOD in MODULES do | |
wget $MOD_$KERNEL_$VERSION_$HARDWARE.ipk | |
done | |
wget $BASE_URL/block-mount_2014-06-22-e0430f5c62f367e5a8e02755412977b02c3fc45e_ar71xx.ipk |
NewerOlder