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
#!/bin/bash | |
# | |
# Scales down (or up) a video to 720p, re-encoding it as MPEG4. | |
# | |
# Useful as a Nautilus Script in Gnome. | |
# | |
# https://help.ubuntu.com/community/AndroidVideoEncoding#Expert mode: Using ffmpeg (command line) | |
ffmpeg -strict experimental -i "$1" -s 1280x720 -vcodec mpeg4 -b 3000k -acodec aac -ac 1 -ar 16000 -r 13 -ab 64000 "$1.shrinked.mp4" |
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
# iw wlan0 scan | sed -e 's#(on wlan# (on wlan#g' | awk -f scan.awk | |
$1 == "BSS" { | |
MAC = $2 | |
print $2 | |
e = wifi[MAC] | |
e["enc"] = "Open" | |
} | |
$1 == "SSID:" { | |
e = wifi[MAC] | |
e["SSID"] = $2 |
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 | |
# To install: | |
# mkdir ~bin | |
# Paste this in ~bin/open_mailto.sh | |
# chmod a+x ~bin/open_mailto.sh | |
# Go to System \ Preferences \ Preferred Applications | |
# Under Mail Reader, select Custom, and then put /home/username/bin/open_mailto.sh into the Command window, changing "username" to your username. | |
# Voilà! Credits to: http://www.howtogeek.com/howto/ubuntu/set-gmail-as-default-mail-client-in-ubuntu/ | |
google-chrome "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`" |
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
mencoder in.flv -quiet -oac pcm -ovc xvid -ofps 15 -vf scale=160:-2 -xvidencopts bitrate=256:vhq=4:me_quality=4:max_bframes=0 -o tmp.avi && transcode -i tmp.avi -P1 -b 0,1 -o out.avi |
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 |
NewerOlder