Skip to content

Instantly share code, notes, and snippets.

View karagenit's full-sized avatar

Caleb Smith karagenit

View GitHub Profile
[remote "origin"]
fetch = refs/heads/*:refs/remotes/origin/*
fetch = refs/tags/*:refs/tags/*
push = refs/heads/*:refs/heads/*
push = refs/tags/*:refs/tags/*
@karagenit
karagenit / rails.md
Last active June 9, 2017 02:12
TechHOUNDS Web Server Ruby+Rails+Passenger+Apache Installation Guide

Alrighty, this one took me a while, mostly figuring out the permissions.

First, I followed this tutorial for installing Passenger onto Apache. The installer tells you "all you need to do is add this tiny snipped (the bit that imports the Apache module). This isn't true.

You actually have to set up a virtual host for the rails application. I set it up on caleb.techhounds.com. Note: if you make a VirtualHost for a subdomain, you need to also create a VirtualHost for the main web server! I'm not sure if you can set up multiple VirtualHosts on the same domain.

This tutorial gives you the full config you need, as does this one.


@karagenit
karagenit / header.sh
Last active July 30, 2017 20:21
Rename WPI File Headers
#!/bin/sh
find . -type f -exec sed -i -e 's/FIRST (20[0-1][0-9])-(20[0-1][0-9])\./FIRST \1-2017./g' {} \;
find . -type f -exec sed -i -e 's/FIRST (20[0-1][0-9])\./FIRST \1-2017./g' {} \;
#!/bin/bash
if [ ! $1 ]
then
echo "Usage: gemfind.sh GEMNAME"
exit
fi
echo `gem list | grep $1`
@karagenit
karagenit / node.sh
Created November 12, 2017 17:14
Fix Node on Debian
#!/usr/bin/env bash
sudo ln -s /usr/bin/nodejs /usr/bin/node
@karagenit
karagenit / birthday
Last active November 17, 2017 17:17
#define OUT_A 0
#define OUT_B 1
#define OUT_C 2
#define OUT_D 3
#define SEG_G 4
#define DRIVER_ENABLE 5
#define DISP_DASH -1
#define DISP_BLANK -2
// TODO: fix imports
public class EfficientSwap {
/**
* This method should print its parameters in opposite order.
* E.g. swap(3, 4) should print 4 then 3.
*/
public static void swap(int a, int b) {
a = a * b;
@karagenit
karagenit / alsa.sh
Created November 24, 2017 03:40
Fix Audio Drivers on Debian 9 + ThinkPad T530
#!/usr/bin/env bash
sudo modprobe snd-hda-intel
sudo alsactl init
@karagenit
karagenit / Makefile
Last active December 1, 2017 00:32
PHP Hardcoded Credential Cleaner
main: install
install:
sudo cp ./clean-creds.sh /usr/bin/clean-creds
sudo chmod 777 /usr/bin/clean-creds