Skip to content

Instantly share code, notes, and snippets.

View loopyd's full-sized avatar

Robert Michael Smith loopyd

View GitHub Profile

Keybase proof

I hereby claim:

  • I am loopyd on github.
  • I am lupinedream (https://keybase.io/lupinedream) on keybase.
  • I have a public key ASDTZWEUBjsIoUKW7V5GfS-lJSEySTmiWDhNCH33DE4cKgo

To claim this, I am signing this object:

@loopyd
loopyd / getopts.cmd
Last active June 27, 2019 04:36
Command line options for windows batch
@echo off
setlocal enableDelayedExpansion enableExtensions
REM @filename getopts.cmd
REM @link <a href="https://gist.github.com/loopyd">gist.github.com/loopyd</a>
REM @editor loopyd &lt;<a href="mailto:loopyd@lupinedream.com">loopyd@lupinedream.com</a>&gt; LupineDream
REM @author <a href="https://stackoverflow.com/users/1012053/dbenham">dbenham</a>
REM @description Use is always free, with credit! \
REM \
REM You may use this script at your leasure for testing purposes. \
REM \
@loopyd
loopyd / start_mc.cmd
Last active June 29, 2019 02:09
Basic minecraft server startup script for Windows with a bunch of configurable command-line arguments and easy JVM auto-optimization. Debug mode argument set fully compatible with IDE of your choice for plugin / server development.
@ECHO OFF
setlocal enableDelayedExpansion enableExtensions
REM @filename start_mc.cmd
REM @author loopyd &lt;<a href="mailto:loopyd@lupinedream.com">loopyd@lupinedream.com</a>&gt; LupineDream
REM @link <a href="https://gist.github.com/loopyd">gist.github.com/loopyd</a>
REM @description Use is always free, with credit! \
REM \
REM You may use this script at your leasure for testing purposes. \
REM \
@loopyd
loopyd / pacrevert.sh
Created July 10, 2019 02:23
[ArchTricks] Uninstall last x packages
#!bin/bash
# ArchTricks pacrevert.sh
# By: HeavyPaws "Heavy H. Paws" <loopyd@lupinedream.com>
#
# About:
# This script will remove the last n packages specified by its first argument
#
# Packages are sorted by date. If you ever fuck up and your system won't boot because of a bad group of packages, this
# script is your life preserver.
@loopyd
loopyd / ezkernelpatches.sh
Created July 10, 2019 02:39
Helpful snippets for patching a kernel created for the Arch pkgbuild system.
#!/bin/bash
# [ArchTricks] ezkernelpatches.sh - code snippets to help patch your kernel...
# For source=() section
for ln in $(find ./*.patch -type f -exec sha256sum {} \; | awk '{print $1}'); do echo " '$ln'"; done
# For sha256sum=() section
for ln in $(find *.patch -type f -exec echo {} \; | awk '{print $1}'); do echo " $ln"; done
@loopyd
loopyd / testicle.sh
Created July 10, 2019 07:16
Gifsicle wrapper, bash - Convert your stuff!
#!/bin/bash
# It has a funny name, but a valuable purpose. It will convert movies to optimized gif images of an extremely small size
# while preserving a decent amount of their quality. It uses the standard stream and DOES NOT create any junk on the
# filesystem, making it extremely fast!
#
# Dependencies required: gifsicle, ffmpeg
# By: HeavyPaws "Heavy H. Paws" <loopy@lupinedream.com>
#
# Example use:
# testicle.sh my_lewd_movie.webm my_lewd_animation.gif
@loopyd
loopyd / starfield.sh
Created August 27, 2019 23:50
[ANSI Starfield for SSH] Warp warp warp WORP WORP WORP!
#!/bin/bash
# have an ascii starfield a really half ass one i wrote while drunk. it looked good
# while i was drinking, now i'm sober and it has problems. have at.
display_center(){
local x
local y
text="$*"
x=$(( ($(tput cols) - ${#text}) / 2))
echo -ne "\E[6n";read -sdR y; y=$(echo -ne "${y#*[}" | cut -d';' -f1)
@loopyd
loopyd / cpu_vendor.sh
Last active August 31, 2019 11:08
Programmable CPU architecture table for use with Gentoo. Fill out the table as you like. ``/proc/cpuinfo`` is used to match at least 1 entry in the table.
# This gist is a useful little programmable tool I wrote to test and
# expand CPU arcitecture auto-detection for Gentoo. It allows you to identify
# for cross-compiler what machine you will be building the system for.
# ...and now its a programmable gist ! Enjoy ! - Heavy H. Paws
#
function cpu_arch () {
local OS_ARCH=
## Examples
@loopyd
loopyd / sandboxed-firefox-installer.sh
Created September 2, 2019 11:47
Installs sandboxed firefox on gentoo
#!/bin/bash
# Validate cli arguments
if [[ "$1 x" == " x" ]]; then
>&2 echo 'Invalid argument specified: missing username'
exit
fi
if ! id -u $1 ; then
>&2 echo 'Invalid argument specified: username does not exist'
fi
@loopyd
loopyd / qtwebengine-patch.sh
Created September 17, 2019 18:27
dev-qt/qtwebengine patch
#!/bin/bash
mkdir --parents /etc/portage/patches/dev-qt/qtwebengine-5.12.3/
cat <<'EOF' > /etc/portage/patches/dev-qt/qtwebengine-5.12.3/linux-headers-5.2.patch
--- a/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/rtc_base/physicalsocketserver.cc
@@ -67,6 +67,7 @@ typedef void* SockOptArg;
#endif // WEBRTC_POSIX
#if defined(WEBRTC_POSIX) && !defined(WEBRTC_MAC) && !defined(__native_client__)