Skip to content

Instantly share code, notes, and snippets.

View ElanHasson's full-sized avatar
💥
Building Stuff

Elan Hasson ElanHasson

💥
Building Stuff
View GitHub Profile
@ElanHasson
ElanHasson / delete-all-released-pvs.sh
Last active April 9, 2024 03:01
This script deletes all PVCs and restarted degraded pods.
#!/bin/bash
# Get all PVs in the 'Released' state in JSON format
RELEASED_PVS_JSON=$(kubectl get pv -o json | jq -r '.items[] | select(.status.phase == "Released")')
# Check if there are no 'Released' PVs
if [ -z "$RELEASED_PVS_JSON" ]; then
echo "No PVs in 'Released' state found."
exit 0
fi
@ElanHasson
ElanHasson / README
Created March 25, 2023 02:33 — forked from xbb/README
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@ElanHasson
ElanHasson / instructions.md
Created January 30, 2023 19:53 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

Find and create a partition with free space:

# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: ATA Crucial_CT240M50 (scsi)
Disk /dev/sda: 240GB
Sector size (logical/physical): 512B/4096B
@ElanHasson
ElanHasson / relays.txt
Created January 12, 2023 17:25
Mastodon Relays
https://mastodon-relay.moew.science/inbox
https://relay.beckmeyer.us/inbox
https://relay.fedinet.social/inbox
https://relay.gruenehoelle.nl/inbox
https://mastodon-relay.thedoodleproject.net/inbox
https://relay.intahnet.co.uk/inbox
https://relay.fedibird.com/inbox
https://relay.minecloud.ro/inbox
https://relay.national-defence.network/inbox
https://rel.re/inbox
@ElanHasson
ElanHasson / Fediverse Moderation Tools Proposal.md
Last active October 31, 2023 14:54
Fediverse Moderation Tools Proposal

2023-10-25: The name FediMod and all assets have been transfered to @thisismissem and this document's title and references to FediMod have been replaced with The System .

NOTE: below is the first draft, I'm working to incorporate feedback into it from various folks. Below is a summary of the feedback

To be clear:

Everything would be opt-in by default and admins and mods can choose which other admins or mods see what they're sharing. Think Circles in Google+, as some things they may want to share with one group and other things with another group. They may even choose to share 100% publicly with anyone verified mod or admin.

There would be no centralized authority here-- everything would be run over ActivityPub.

@ElanHasson
ElanHasson / AssemblyInformation.cs
Last active August 12, 2022 19:06
Adding Git Commit Hash to your .NET project assemblies.
using System.Reflection;
public record class AssemblyInformation(string Product, string Description, string Version, string InformationalVersion)
{
public static readonly AssemblyInformation Current = new(typeof(AssemblyInformation).Assembly);
public AssemblyInformation(Assembly assembly)
: this(
assembly.GetCustomAttribute<AssemblyProductAttribute>()!.Product,
assembly.GetCustomAttribute<AssemblyDescriptionAttribute>()!.Description,
@ElanHasson
ElanHasson / curlpool.sh
Created April 9, 2022 21:20 — forked from g105b/curlpool.sh
Pool 100 parallel curl requests at a time
#!/bin/bash
target=${1:-http://example.com}
while true # loop forever, until ctrl+c pressed.
do
for i in $(seq 100) # perfrom the inner command 100 times.
do
curl $target > /dev/null & # send out a curl request, the & indicates not to wait for the response.
done
wait # after 100 requests are sent out, wait for their processes to finish before the next iteration.
@ElanHasson
ElanHasson / git-commit-author-rewrite.md
Created November 20, 2021 03:43 — forked from trey/git-commit-author-rewrite.md
Change the email address for a git commit.

Change the email address for a git commit.

$ git commit --amend --author="Author Name <email@address.com>"

or

$ git commit --amend --reset-author
@ElanHasson
ElanHasson / BatchEnumerableExtensions.cs
Created July 7, 2021 23:42
A set of extensions for batching in Linq
public static class BatchEnumerableExtensions
{
public static IEnumerable<IList<T>> InBatchesOf<T>(this IEnumerable<T> items, int batchSize)
{
var batch = new List<T>(batchSize);
foreach (var item in items)
{
batch.Add(item);