Skip to content

Instantly share code, notes, and snippets.

View heyimblake's full-sized avatar
Need more coffee.

Blake Khan heyimblake

Need more coffee.
View GitHub Profile
@heyimblake
heyimblake / config.yml
Last active June 7, 2021 15:13
cloudflared Config from "Creating/Securing a Remote Dev Environment"
tunnel: XXX
credentials-file: /etc/cloudflared/XXX.json
ingress:
- hostname: YOUR.DOMAIN.HERE
service: ssh://localhost:22
- service: http_status:404
@heyimblake
heyimblake / userdata.sh
Last active June 7, 2021 15:13
Initial Server Script from "Creating/Securing a Remote Dev Environment"
#!/bin/bash
# The name of the user to create (feel free to change)
# You will be logging into this user instead of root
USER_NAME="sammy"
# Create User, copy ssh key from root, remove password
adduser $USER_NAME
usermod -aG sudo $USER_NAME
rsync --archive --chown=$USER_NAME:$USER_NAME ~/.ssh /home/$USER_NAME

Keybase proof

I hereby claim:

  • I am heyimblake on github.
  • I am blakekhan (https://keybase.io/blakekhan) on keybase.
  • I have a public key ASCO3hHP41xebqh7td9JqrVMVhR6sUBt9fQ-_xWUWnG5NAo

To claim this, I am signing this object:

@heyimblake
heyimblake / md_to_pdf.sh
Last active August 15, 2019 05:59 — forked from hugorodgerbrown/md_to_rst.sh
Bash script for converting a batch of *.md files into *.pdf using LaTeX and pandoc.
#!/bin/bash
# This script was created to convert a directory full
# of markdown files into PDF files. It uses
# pandoc and LaTeX to do the conversion.
#
# 1. Install pandoc from https://pandoc.org/
# 2. Install LaTeX from https://www.latex-project.org/
# 3. Copy this script into the directory containing the .md files
# 4. Ensure that the script has execute permissions
# 5. Run the script
@heyimblake
heyimblake / bst.c
Last active January 26, 2020 06:26
C Binary Search Tree Implementation. Adding, searching, ordering, and tree deletion included.
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
// Node Structure
typedef struct node {
// Ordered from grestest member size to smallest member size for reducing memory used.
struct node *left; // Pointer pointing to left child node.
struct node *right; // Pointer pointing to right child node.
int val; // The value the node is holding.
@heyimblake
heyimblake / demo_pointer.c
Last active October 19, 2018 06:34
What is a Pointer? Compile with "gcc -o demo_pointer demo_pointer.c" and run with "./demo_pointer"
#include <stdio.h>
#include <stdlib.h>
int main() {
// Declare a variable named i
// Initialize i with value of 10.
int i = 10;
printf("i = %d\n", i);
@heyimblake
heyimblake / Referal Links
Last active December 26, 2023 16:27
Use these referral links for discounts at DigitalOcean, Vultr, GSuite, and more!
@heyimblake
heyimblake / Example.java
Last active February 24, 2017 12:52
ItemBuilder
public ItemStack getCompass() {
return new ItemBuilder(Material.COMPASS)
.displayName(ChatColor.GREEN + "You shall not com-PASS!")
.lore(ChatColor.GRAY + "I'm not even sorry for that pun.")
.enchant(Enchantment.KNOCKBACK, 1)
.enchant(Enchantment.DAMAGE_UNDEAD, 1)
.unbreakable(true)
.flag(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE)
.build();
}

Keybase proof

I hereby claim:

  • I am heyimblake on github.
  • I am heyimblakee (https://keybase.io/heyimblakee) on keybase.
  • I have a public key ASAYWyNDafoX6H3dPxuC1Oko2WxdiqsrtxDjorwUjwP8lgo

To claim this, I am signing this object:

@heyimblake
heyimblake / gist:1f7874898c22b1ab13257b5d02acfd08
Created July 27, 2016 06:36
Method to get a random BarColor excluding a given BarColor
public BarColor getRandomColorExcluding(BarColor excludeColor) {
int rdmint = new Random().nextInt(BarColor.values().length);
BarColor color = BarColor.values()[rdmint];
if (color == excludeColor)
color = BarColor.values()[rdmint == 0 ? rdmint + 1 : rdmint - 1];
return color;
}