Skip to content

Instantly share code, notes, and snippets.

View belgareth's full-sized avatar
👓
Aut iveniam viam aut faciam

Ben T. K belgareth

👓
Aut iveniam viam aut faciam
  • FLT
  • mars
View GitHub Profile
@belgareth
belgareth / a way to download the latest files using PHP through SFTP (SSH2)
Last active June 5, 2017 10:06
Tried this code to retrieve the newest files from a server using php/ ssh2. The problem is that it only downloads one file instead of multiple files. Any help would be appreciated .
#!/usr/bin/php
<?php
$username = "username";
$password = "passwor";
$url = 'adress';
// Make our connection
$connection = ssh2_connect($url);
// Authenticate
@belgareth
belgareth / mkvextractTracks.sh
Last active January 8, 2023 10:06 — forked from kampfgnu/mkvextractTracks.sh
batch extract subtitles from mkv files
#!/bin/bash -e
# a script that extracts the subtitle file of every mkv movie file and saves it with the same name
# copy to the folder where the mkv files live and run "./mkvextractTracks.sh" in terminal
# options: [trackID]
@belgareth
belgareth / mkvextractTracks2.sh
Last active January 8, 2023 10:14 — forked from DrSwagsalot/mkvextractTracks.sh
batch extract subtitles from mkv files
#!/bin/bash
# Extract all subtitles from every MKV file and save them with the same name as SRT files,
# with an optional prefix or suffix added to the file name.
# Copy to the folder where the MKV files live and run "./mkvextractTracks.sh [prefix] [suffix]" in terminal.
#
# info:
# mkvextract is used to extract the subtitles, so mkvtoolnix app (which contains the mkvextract binary) is used:
# https://mkvtoolnix.download/downloads.html
# please adjust below path to point to mkvextract or this script won't work