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 | |
# The name of the wireless interface (e.g., wlp2s0). You may need to change this. | |
INTERFACE="wlp2s0" | |
# URL to check for internet connectivity | |
CHECK_URL="http://www.google.com" | |
# Function to check internet connectivity | |
check_internet() { |
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
{ | |
"v": "1", | |
"id": "16d81e2a-796f-4c01-8906-13baf066dd1e", | |
"rev": 2, | |
"name": "Nginx-syslog-geodata", | |
"summary": "This content pack supports the NGINX syslog feature and adds geo data based on MaxMind GeoLite2 Database.", | |
"description": "This content pack includes:\n- a syslog UDP input listening on port 12501\n- an extractor to extract the JSON data from the syslog message\n- a pipeline rule to extract fields from `json_message`\n- a pipeline rule to lookup GeoIP data based on remote_addr", | |
"vendor": "Hervé Le Roy", | |
"url": "", | |
"parameters": [], |
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
# cd_reminder | |
# - Add bash excerpt below to your .bashrc or .bash_aliases | |
# - Restart your terminal or run `source .bashrc` | |
# - Add a file named `.cd-reminder` into a directory | |
# - `cd` into this directory: the content of `.cd-reminder` will be printed out | |
# Slightly modified version from https://unix.stackexchange.com/questions/18532/show-message-when-cd-into-specific-directory | |
# to allow printing ANSI colors | |
cd_reminder() { | |
builtin cd "$@" && { [ ! -f .cd-reminder ] || echo -ne $(cat .cd-reminder | sed 's/$/\\n/' | sed 's/ /\\a /g'); } |
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
# According to Django documentation, it’s preferable to use non-deterministic collations | |
# instead of the citext extension for Postgres > 12. | |
# Example migation to create the case insensitive collation | |
class Migration(migrations.Migration): | |
operations = [ | |
CreateCollation( | |
'case_insensitive', |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
''' | |
check_mtu.py -- Check link MTU by sending UDP packets with increasing payload size | |
positional arguments: | |
host host to send packet to. If omitted, defaults to | |
www.google.com | |
optional arguments: |
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
[Desktop Action compressVideo] | |
Exec=konsole --noclose -e HandBrakeCLI -i "%u" -t 1 --angle 1 -c 1 -o "`FILE="%u"; echo ${FILE%%.*}"_720p.MP4"`" -f m4v -O --decomb -w 1280 --loose-anamorphic --modulus 2 -e x264 -q 19 --vfr -a 1 -E faac -6 dpl2 -R 48 -B 128 -D 0 --gain 0 --audio-fallback ffac3 --x264-preset=placebo --x264-profile=high --x264-tune="film" --h264-level="4.1" --verbose=1 | |
Icon=/home/hleroy/Images/Divers/Icones/handbrake-icon.png | |
Name=Conversion en MP4 720p | |
[Desktop Entry] | |
Actions=compressVideo; | |
MimeType= | |
ServiceTypes= | |
Type=Service |
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 | |
# | |
# This script will delete all Canon RAW (CR2) files in a folder when the corresponding JPG is unrated. | |
# The purpose is to keep only Raw files for photos which are worth it | |
# (assuming you have gone through the effort of rating the JPG) | |
# | |
# It requires a filename as argument. It is meant to be called through a "context menu" | |
# (right-click) on a CR2 file. | |
# | |
# Example .desktop file for KDE (to be placed in ~/.local/share/applications/myRawCleaner.desktop) |