Skip to content

Instantly share code, notes, and snippets.

View omnituensaeternum's full-sized avatar
💭
Committing crimes against humanity

H1V3 omnituensaeternum

💭
Committing crimes against humanity
  • Low Earth Orbit
View GitHub Profile
@omnituensaeternum
omnituensaeternum / genVarStrings.py
Created November 12, 2021 15:42
Generates strings from chars incrementally
import string, random
# Credit to dunnousername#8672
# return all unique strings from charset y of length l.
# y must be entirely unique chars.
def g(y, l):
if l == 1:
# we're just looking for single-char sequences
# just yield each char in the charset
@omnituensaeternum
omnituensaeternum / urlPing.sh
Created August 20, 2021 09:17
Check if a website at URL is up in bash using curl.
#!/bin/bash
# FUNCTION
isSiteUp () { check=`curl -Is $1 | head -1 | awk '{print $2}'`;if [ "$check" = "200" ]; then return 1; else return 0; fi; }
# EXAMPLE USAGE
siteToCheck="https://qrng.anu.edu.au/API/jsonI.php?" #This is a quantum random number api but any url should work.
test=`isSiteUp $siteToCheck`
if [ "$?" = "1" ];then
echo "The website at: [$siteToCheck] is [ONLINE]"
else
@omnituensaeternum
omnituensaeternum / snowflake.py
Created August 18, 2021 06:25
Discord Snowflake to Time & Date
#This works for most things with discord, such as servers, messages, etc.
import datetime
def getSnowflakeTimestamp(snowflake):
DiscordEpoch = 1420070400000
input = snowflake
UnixTSinMS = input / 4194304 + DiscordEpoch
out = str(datetime.datetime.fromtimestamp(UnixTSinMS/1000.0))
print("Creation date: " + out)
@omnituensaeternum
omnituensaeternum / RandomCoordGen.java
Created July 16, 2021 06:41
Java method for random Minecraft coordinate generation
// This is a basic program on Java
//
// Try to modify and run it and check out
// the output in the terminal below
//
// Happy coding! :-)
import java.util.Random;
public class App {
public int min;