Skip to content

Instantly share code, notes, and snippets.

@BobyMCbobs
BobyMCbobs / kubectl-decodesecret
Created July 25, 2023 07:10
A small bash script to tidly base64 decode secrets
#!/bin/bash
POSITIONAL_ARGS=()
NAMESPACE=default
while [[ $# -gt 0 ]]; do
case $1 in
-n|--namespace)
NAMESPACE="$2"
shift # past argument
@BobyMCbobs
BobyMCbobs / fedora-ws2sb.sh
Last active May 23, 2023 09:35
[proof of concept] Convert Fedora Workstation to Fedora Silverblue
#!/bin/bash
# SUPERCEDED BY
# https://github.com/ublue-os/upgrade-tools
# TODO
# - [ ] take a look at any Linux OS to Silverblue (e.g Ubuntu)
# - [ ] install previous user installed packages as overlay
# - [ ] install previous system Flatpaks
@marcoarment
marcoarment / S3.php
Last active June 18, 2024 14:15
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@plembo
plembo / RPIwithQEMU.md
Last active June 27, 2024 18:19
Emulating a Raspberry Pi with QEMU

Emulating a Raspberry Pi with QEMU

Goal: Emulate a Raspberry Pi with QEMU in order to run the Raspbian O/S (based on Debian Linux).

The current setup is not ideal. For one thing, the maximum RAM allowed using the "versatile-pb" firmware is 256 Mb. In addition, only the most basic peripherals, a keyboard and mouse, are supported.

A number of articles have been written on this topic. Most are outdated, and the few recent ones are missing key information.

@binhqd
binhqd / remove-systemctl-service.sh
Created May 24, 2018 02:12
Remove systemctl service
sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
#rm /etc/systemd/system/[servicename]
#rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
@arthurdent
arthurdent / Get-FtpDirectory.ps1
Created April 1, 2015 22:11
Recursively list all files in FTP directory in PowerShell / List files (recursive)
$Server = "ftp://ftp.example.com/"
$User = "anonymous@example.com"
$Pass = "anonymous@anonymous.com"
Function Get-FtpDirectory($Directory) {
# Credentials
$FTPRequest = [System.Net.FtpWebRequest]::Create("$($Server)$($Directory)")
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($User,$Pass)
$FTPRequest.Method = [System.Net.WebRequestMethods+FTP]::ListDirectoryDetails