Skip to content

Instantly share code, notes, and snippets.

@lslqtz
lslqtz / drcom_autologin_padavan.sh
Last active December 24, 2024 10:54
drcom_autologin_padavan.sh
#!/bin/bash
DRCOM_ENDPOINT="http://172.19.233.233:8080"
DRCOM_USERNAME="username"
DRCOM_PASSWORD="password"
DRCOM_ISP="telecom"
ETH_IPPREFIX="172.18"
drcom_login() {
CURRENT_IP=$(ip addr show | grep 'inet' | grep ${ETH_IPPREFIX} | grep -v 'inet6' | awk '{print $2}' | cut -d/ -f1)
@lslqtz
lslqtz / uue.php
Last active February 14, 2024 19:40
UUEncode/UUDecode functions suitable for use with ASS subtitle attachments
<?php
function UUEncode_ASS($filename, $newLine = true): string {
$filesize = filesize($filename);
if ($filesize <= 0) {
return '';
}
$retStr = '';
$written = 0;
$fileContent = file_get_contents($filename);
for ($pos = 0; $pos < $filesize; $pos += 3) {