Skip to content

Instantly share code, notes, and snippets.

View jakenotjacob's full-sized avatar
🐼

Jake Campbell jakenotjacob

🐼
View GitHub Profile
@jakenotjacob
jakenotjacob / thingie.rb
Created May 12, 2021 19:35
Using Ruby module hooks to inject class methods
module Executor
def self.included(classname)
puts "#{classname} included me, #{self}! I feel loved!"
puts "Now I am going to automagic some methods into #{classname}..."
classname.class_eval do
def scream
"OH MY GLOB"
end
end
end
@jakenotjacob
jakenotjacob / main.go
Created March 8, 2021 21:20
Jobrunner POC snippet
package main
import (
"fmt"
"sync"
"time"
)
type State string
##Dockerfile
FROM centos:7
RUN yum update -y && yum install -y wget perl openssl-devel dmidecode
RUN wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash
RUN yum install -y srvadmin-idracadm7
RUN cp /opt/dell/srvadmin/bin/idracadm7 /usr/local/bin/racadm
##Build via... (run inside somedir/Dockerfile)
@jakenotjacob
jakenotjacob / gooey.vim
Created April 10, 2020 03:23
Gooey a colorscheme for vim with Ruby in mind
set background=dark
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
set t_Co=256
let g:colors_name = "gooey"
@jakenotjacob
jakenotjacob / proxythinger.conf.erb
Created April 9, 2020 22:03
Basic proxy app NGINX
upstream <%= @name %> {
server <%= @upstream_server %> fail_timeout=0;
}
server {
<%= "listen #{@listen};" unless @listen.nil? %>
<%= "root #{@root};" unless @root.nil? %>
client_max_body_size 0;
try_files $uri/index.html $uri.html $uri @<%= @name %>;
location @<%= @name %> {
@jakenotjacob
jakenotjacob / lockit.rb
Created June 18, 2019 05:01
Locking/unlocking of an OSX screen based on Bluetooth proximity of a paired device
#!/usr/bin/env ruby
#Avoid pressing a few keys, lock your OSX machine in a more terrible way!
#Make changes where you need (ie replace 'Pixel 3a' with your paired device)
#and whatnot... (also, put the wifi-button on your toolbar thingie)
require 'io/console'
require 'yaml'
package main
import (
//"fmt"
"os"
"io/ioutil"
"time"
"net/http"
"fyne.io/fyne"
"fyne.io/fyne/app"
@jakenotjacob
jakenotjacob / poop.lua
Created February 5, 2018 13:49
lewahhhh pewp
CreateThread(function()
GiveWeaponToPed(PlayerPedId(), "WEAPON_SMG", 10000, false, true)
while true do
Wait(0)
local handle, ped = FindFirstPed()
local success
repeat
local pos = GetEntityCoords(ped)
@jakenotjacob
jakenotjacob / playerthingy.lua
Created November 5, 2017 05:40
playerthingy.lua
Player = {}
Player.__index = Player
function Player.init(p)
local p = p or {}
local _env = _ENV
setmetatable(p,
{
__index = function() end,
__newindex = function() end,
@jakenotjacob
jakenotjacob / http-https_rockstar_http2-2
Created September 8, 2017 12:20
FiveM http2 investigation 2
curl --http2-prior-knowledge -svo /dev/null https://patches.rockstargames.com/prod/gtav/Launcher_EFIGS/GTA_V_Launcher_1_0_440_2.exe -w "\nContent Type: %{content_type} \
\nHTTP Code: %{http_code} \
\nHTTP Connect:%{http_connect} \
\nNumber Connects: %{num_connects} \
\nNumber Redirects: %{num_redirects} \
\nRedirect URL: %{redirect_url} \
\nSize Download: %{size_download} \
\nSize Upload: %{size_upload} \
\nSSL Verify: %{ssl_verify_result} \
\nTime Handshake: %{time_appconnect} \