Skip to content

Instantly share code, notes, and snippets.

View JeremyMorgan's full-sized avatar

Jeremy Morgan JeremyMorgan

View GitHub Profile
@JeremyMorgan
JeremyMorgan / head.html
Last active March 20, 2025 09:04
Some Liquid tags for adding in Opengraph data in your meta tags for Octopress
{% if page.title %}<meta property="og:title" content="{{ page.title }}" /><meta itemprop="name" content="{{ page.title }}" />{% endif %}
{% if page.author %}<meta name="author" content="{{ site.author }}" />
<meta property="article:author" content="https://plus.google.com/+JeremyMorgan" />
<meta property="og:type" content="article" />{% endif %}
{% if page.date %}<meta property="article:published_time" content="{{ page.date }}" />{% endif %}
{% capture category %}{% if page.categories %}{{ page.categories }}{% endif %}{% endcapture %}
{% if page.categories %}<meta property="article:section" content="{{ page.categories }}" />{% endif %}
{% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ content | raw_content }}{% endif %}{% endcapture %}
<meta name="description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" />
<meta property="og:description" content="{{ description | strip_html | condense_spaces | truncate:150 }}" />
@JeremyMorgan
JeremyMorgan / Orange Pi PC and Arch Linux ARM.md
Last active March 9, 2025 20:48 — forked from maximtrp/Orange Pi PC and Arch Linux ARM.md
Guide on how to install Arch Linux ARM on SD card for your Orange Pi PC board

Orange Pi PC & Arch Linux ARM: installation guide

This guide is based on multiple guides as well as official instructions for the other boards found on the Internet:

  1. https://github.com/RoEdAl/alarm-uboot-sunxi-armv7
  2. https://uthings.uniud.it/building-mainline-u-boot-and-linux-kernel-for-orange-pi-boards
  3. https://archlinuxarm.org/platforms/armv7/allwinner/pcduino3

I have gone through all these steps recently and got a working board with my favorite Arch Linux ARM. I hope it will be helpful for someone else.

@JeremyMorgan
JeremyMorgan / mutethisshit.txt
Last active January 31, 2025 04:12
Great terms to mute on Twitter
#politics
#election
#government
#policy
#vote
#democracy
#republican
#democrat
#conservative
#liberal
@JeremyMorgan
JeremyMorgan / shake.go
Last active January 16, 2025 20:12
The most important code I've ever written
package main
import (
"fmt";
)
func loopit(phrase string, repeat int)(string){
var outputphrase string = "";
@JeremyMorgan
JeremyMorgan / workstationsetup.sh
Last active September 18, 2024 16:57
Setup for my FreeBSD Workstation
# This may be runnable as a script, but keep in mind -y is not always acknowledged.
# These are the drop dead basics
pkg -y install vim
pkg -y install git
pkg -y install chromium
pkg -y install gimp
pkg -y install sudo
# Install Rust
@JeremyMorgan
JeremyMorgan / getip.sh
Last active May 19, 2024 09:22
List your interfaces, and IP (v4) addresses if they're available.
#!/bin/bash
# Define color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Run the ip -c a command and process its output
ip -c a | awk -v green="$GREEN" -v red="$RED" -v nc="$NC" '
/^[0-9]+:/ {
@JeremyMorgan
JeremyMorgan / getbadguys.sh
Created February 8, 2020 04:35
Get a list of IP addresses trying to attack your CentOS server
#/usr/bin/bash
# strings to look for in our file
# Note: you could just parse the whole file. But if you put in a bad password your IP
# could end up on the bad guy list
declare -a badstrings=("Failed password for invalid user"
"input_userauth_request: invalid user"
"pam_unix(sshd:auth): check pass; user unknown"
"input_userauth_request: invalid user"
"does not map back to the address"
"pam_unix(sshd:auth): authentication failure"
import unittest
"""
This is a function to extract numbers from the string.
It is implemented in my main script that reads the entire input file and runs
this function against each line.
"""
from [YOURSCRIPT] import extract_numbers
class TestExtract(unittest.TestCase):
@JeremyMorgan
JeremyMorgan / states.sql
Last active October 3, 2023 12:55
An SQL Query to insert 50 U.S. States into a database.Make sure your auto increment is set in MySQL, and Identity_insert is set in MS-SQL.
CREATE TABLE [state](
[stateID] [int] IDENTITY(1,1) NOT NULL,
[stateCode] [nchar](2) NOT NULL,
[stateName] [nvarchar](128) NOT NULL,
CONSTRAINT [PK_state] PRIMARY KEY CLUSTERED
( [stateID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY])
ON [PRIMARY]
@JeremyMorgan
JeremyMorgan / cmake.sh
Last active May 25, 2023 19:01
My latest OpenCV CMake config
export OPENCV_DOWNLOAD_PATH=/tmp/opencv-cache
cmake -D CMAKE_C_COMPILER=/usr/bin/clang-15 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_PREFIX_PATH=/usr/lib -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -D WITH_CUDA=ON -D CUDA_ARCH_BIN=8.9 -D ARCH=sm_89 -D gencode=arch=compute_89,code=sm_89 -D ENABLE_FAST_MATH=ON -D CUDA_FAST_MATH=ON -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_NVCUVID=ON -D WITH_OPENMP=ON -D BUILD_EXAMPLES=ON -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_TBB=ON -D WITH_IPP=ON -D WITH_NVCUVID=ON -D WITH_CSTRIPES=ON -D WITH_OPENCL=ON -D WITH_FFMPEG=ON -D BUILD_opencv_apps=ON -D OPENCV_DOWNLOAD_PATH=/tmp/opencv-cache -D WITH_PNG=ON -D WITH_JPEG=ON -D WITH_WEBP=ON -D WITH_V4L=ON -D WITH_GTK=ON -D WITH_QT=ON -D WITH_GPHOTO2=ON -D WITH_GSTREAMER=ON -D WITH_PROTOBUF=ON -D OPENCV_DNN_CUDA=ON -D CMAKE_PREFIX_PATH=/usr/lib -D CMAKE_CXX_FLAGS="-Ofast" ../opencv