Skip to content

Instantly share code, notes, and snippets.

View bbhoss's full-sized avatar
🎯
Focusing

Preston bbhoss

🎯
Focusing
View GitHub Profile
@bbhoss
bbhoss / Dockerfile
Created January 19, 2024 23:45
Palworld dedicated server
# Dockerfile
FROM cm2network/steamcmd:latest
# Set environment variables for the container
ENV STEAMCMD_DIR=/home/steam/steamcmd
ENV SERVER_DIR=/home/steam/palserver
# Switch to user steam
USER steam
@bbhoss
bbhoss / mirthconnect.service
Created August 21, 2014 19:21
Mirth systemd descriptor for CentOS/RHEL 7. Just extract the mirthconnect tarball to /opt/mirthconnect, create a system user for mirth, chown accordingly, and install/enable this config file.
[Unit]
Description=Mirth Connect Interface Engine
After=network.target
[Service]
Type=forking
User=mirth
Group=mirth
ExecStart=/opt/mirthconnect/mcservice start
@bbhoss
bbhoss / fun.sql
Last active June 20, 2017 23:29
Using Google Natural Language API from PL/Python. Make sure to set up authentication and install the proper libraries to the PL/Python PYTHONPATH first.
CREATE EXTENSION plpython3u;
CREATE TYPE GOOGSENTIMENTRESULT AS (
sentiment FLOAT,
magnitude FLOAT
);
CREATE OR REPLACE FUNCTION GOOGsentiment(txt TEXT)
RETURNS GOOGSENTIMENTRESULT
AS $$
# Imports the Google Cloud client library
from google.cloud import language
# bash <(curl -s https://gist.githubusercontent.com/bbhoss/b2af48ba6426568b51da25fc93c4896c/raw/15b978487149d5ea478fb1597e9a5771d70f024a/minikube_test.sh)
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
# ----------------------
# adding resolver for test domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
@bbhoss
bbhoss / opener.c
Created July 26, 2012 04:06
Onity lock opener
#define CONSERVATIVE
int ioPin = 3;
#define BUFSIZE 200
unsigned char buf[BUFSIZE];
#define pullLow() pinMode(ioPin, OUTPUT)
#define pullHigh() pinMode(ioPin, INPUT)
unsigned char dbits[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0};
@bbhoss
bbhoss / awesome.txt
Created January 28, 2016 20:38
Nerves booting on an Intel Edison
******************************
PSH KERNEL VERSION: b0182b2b
WR: 20104000
******************************
SCU IPC: 0x800000d0 0xfffce92c
PSH miaHOB version: TNG.B0.VVBD.0000000c
microkernel built 11:24:08 Feb 5 2015
11:55:08.809 [error] GenServer #PID<0.83.0> terminating
** (ArgumentError) argument error
:erlang.iolist_size([27, 91, 51, 54, 109, 27, 91, 49, 109, 9475, 32, 104, 32, 69, 110, 117, 109, 13, 10, 9475, 32, 104, 32, 69, 110, 117, 109, 46, 109, 97, 112, 13, 10, 9475, 32, 104, 32, 69, 110, 117, 109, 46, 114, 101, 118, 101, 114, 115, 101, 47, ...])
(ssh) ssh_cli.erl:434: :ssh_cli.write_chars/3
(ssh) ssh_cli.erl:193: :ssh_cli.handle_msg/2
(ssh) ssh_channel.erl:266: :ssh_channel.handle_info/2
(stdlib) gen_server.erl:615: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:681: :gen_server.handle_msg/5
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: {#PID<0.84.0>, {:put_chars_sync, :unicode, "\e[36m\e[1m┃ h Enum\n┃ h Enum.map\n┃ h Enum.reverse/1\e[0m\n", {{#PID<0.87.0>, #Reference<0.0.8.169>}, :ok}}}
@bbhoss
bbhoss / autopoker.js
Last active January 1, 2016 06:59
Automatically poke your friends back!
var autoPokerIndex = null;
var autoPoke = function() {
// LOL, do you even DOM bro?
document.evaluate('//*[text()="Poke Back"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE).snapshotItem(0).click();
}
var startAutoPoker = function() {
autoPokerIndex = setInterval(autoPoke, 2000);
}
@bbhoss
bbhoss / xcode_emulation.patch
Last active December 28, 2015 04:09
patch to xcode_emulation for older (<v0.10.22) versions of node
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index 806f92b..5256856 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -224,8 +224,7 @@ class XcodeSettings(object):
def _GetSdkVersionInfoItem(self, sdk, infoitem):
job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem],
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
@bbhoss
bbhoss / xcode_emulation.patch
Last active December 28, 2015 04:08
patch to xcode_emulation for node > v0.10.22
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index f9cec33..4b3c035 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -285,8 +285,14 @@ class XcodeSettings(object):
if sdk_root.startswith('/'):
return sdk_root
if sdk_root not in XcodeSettings._sdk_path_cache:
- XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
- sdk_root, 'Path')