Skip to content

Instantly share code, notes, and snippets.

View BlendyDev's full-sized avatar
💛
:3

Blendy BlendyDev

💛
:3
View GitHub Profile
@BlendyDev
BlendyDev / mhtmlparse.c
Created November 16, 2024 05:50
script to parse newlines/carriage returns/CRLF's preceeded by a =, useful in the processing of mhtml files
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// deletes =\n =\r\n and =\r, meant for MHTML files
// -s flag for silent processing
int main(int argc, char *argv[])
{
int c;
int silent = 0;
if (argc > 1 && strcmp(argv[1], "-s") == 0) silent = 1;
#!/bin/sh
mkdir -p /tmp/zshrc-pluginless
cat ~/.zshrc | sed "s/^plugins=/#plugins=/" > /tmp/zshrc-pluginless/.zshrc
ZDOTDIR="/tmp/zshrc-pluginless" zsh
@BlendyDev
BlendyDev / pacrollback
Created October 15, 2023 00:21
Script to rollback Arch Linux packages to a certain date
#!/bin/bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi
echo -ne "Enter date (YYYY/MM/DD): "
read date
echo $date
mv -v /etc/pacman.d/mirrorlist /tmp/mirrorlist.bak
echo "Server = https://archive.archlinux.org/repos/$date/\$repo/os/\$arch" >> /etc/pacman.d/mirrorlist
@BlendyDev
BlendyDev / discupd
Last active August 31, 2023 14:33
Script to update discord
#!/usr/bin/bash
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
echo "Not running as root"
exit
fi
pkill Discord
cd /tmp
if ls | grep "discupd.tar.gz"; then
rm discupd.tar.gz
fi
rod1 = int(input("rod 1 DV: "))
rod2 = int(input("rod 2 DV: "))
print ("rod1 [" + str(64-rod1) + "/64], combine with DV " + str(68-rod1) + "[" + str(rod1-4) + "/64]\n")
print ("rod2 [" + str(64-rod2) + "/64], combine with DV " + str(68-rod2) + "[" + str(rod2-4) + "/64]\n")
print ("combination of rods gives DV " +str(rod1+rod2-67) + "[" + str(131-rod1-rod2) + "/64], combine with DV " + str(135-rod1-rod2) + "[" + str(rod1+rod2-71) + "/64]")
# bad code ik