Skip to content

Instantly share code, notes, and snippets.

View samiam2013's full-sized avatar
:octocat:

Samuel Myres samiam2013

:octocat:
  • Wildfire
  • Western Kensucky
View GitHub Profile
@samiam2013
samiam2013 / check_notify_restart.sh
Created March 13, 2022 15:41
code for checking the websites (specifically in apache) are running and restarting the server gracefully (so no users get kicked) after notifying an email address about it's down status
#!/bin/bash
#
# ADD SUBDOMAINS THAT NEED TO BE KEPT RUNNING AND WARNED ABOUT IN THIS LIST SEPARATED BY SPACES
#
sites_list=(localhost 127.0.0.1 example.com subdomain.example.com)
#
# ADD YOUR EMAIL HERE, MAKING SURE THAT `echo "message" | sendmail user@domain.tld`
@samiam2013
samiam2013 / CSharpJack.cs
Created January 18, 2022 01:42
a simple blackjack game implemented in c#
using System;
using System.Collections.Generic;
namespace blackjack
{
class Program
{
static void Main(string[] args)
{
Deck deck = new Deck();
@samiam2013
samiam2013 / perl_assignment_error.pl
Last active January 9, 2022 17:41
use diagnostics; # they're very very good
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
=pod
██╗░░░██╗░██████╗███████╗
██║░░░██║██╔════╝██╔════╝
██║░░░██║╚█████╗░█████╗░░
@samiam2013
samiam2013 / suGoKu.go
Last active September 27, 2021 05:42
This is close to a solution, needs unit tests.
package main
import (
"fmt"
)
// very simple puzzle
// https://www.7sudoku.com/view-puzzle?date=20161117
/*
var puzzle = [9][9]int{
@samiam2013
samiam2013 / Emigrant.php
Created September 27, 2021 05:22
PHP is best used to learn about other languages to use, I think
<?php
// make a list of the subreddits to pull news from
$subreddits = array(
"javascript",
"Python",
"java",
"csharp",
"cpp",
"typescript",
"bash",
@samiam2013
samiam2013 / Snek.py
Created September 27, 2021 05:20
Snake Game written in Python with PyGame
import time, pygame
from random import randint
#for some reason you have to start modules? whatever.
pygame.init()
#can't make the numbers unequal? TODO: FIX THIS
blocks_square = 25