A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
#!/bin/bash | |
ls -d /usr/src/linux-headers-* \ | |
| sed -e 's/.*linux-headers-//' \ | |
| grep generic \ | |
| sort -V \ | |
| tac \ | |
| sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start |
A list of useful commands for the ffmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
This is a script I made to check the health of the ZFS pools on my Ubuntu server and send a notification with a summary to a Discord server channel (see image of example notification below) I have made for my servers. I borrowed and modified some parts for the actual ZFS health check from this Gist. The script checks ZFS pools overall condition, capacity, errors and time since last scrub. If an issue is detected with a pool a role on the Discord channel is pinged.
This script is only tested on Ubuntu Server 20.04.
Copy the two bash files to a Linux server with ZFS pools and modify as required based on distro/version. Fill inn the Discord variables in the discord-variables.sh file.
#!/bin/bash | |
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line | |
echo "Checking Xcode CLI tools" | |
# Only run if the tools are not installed yet | |
# To check that try to print the SDK path | |
xcode-select -p &> /dev/null | |
if [ $? -ne 0 ]; then | |
echo "Xcode CLI tools not found. Installing them..." |
#!/usr/bin/python | |
# For mojave only | |
# In order for this to work, you will need to go to System Preferences in Mojave -> Security & Privacy -> Privacy -> Full Disk Access and grant Terminal.app permissions | |
import sqlite3 | |
conn = sqlite3.connect('/var/db/SystemPolicyConfiguration/KextPolicy') | |
c = conn.cursor() | |
query = 'SELECT * FROM kext_policy' | |
c.execute(query) |
Add the following chunk to your existing ISC dhcpd.conf
file.
if exists user-class and ( option user-class = "iPXE" ) {
filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
filename "undionly.kpxe";
}
(or see https://gist.github.com/4008017 for a more elaborate setup
#install gcc git build-essential python3 | |
$ sudo aptitude install gcc git build-essential python3 | |
#from http://www.pip-installer.org/en/latest/installing.html | |
$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py | |
$ mkdir python3_prole | |
$ cd python3_prole/ | |
$ python virtualenv.py -p /usr/bin/python3 env | |
$ python virtualenv.py --relocatable -p /usr/bin/python3 env |
#!/usr/bin/env python | |
""" | |
Python functions for finding open files and PIDs that have opened a file. | |
""" | |
import numbers | |
import subprocess | |
try: |