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 / 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 / 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 / foo.ex
Last active October 25, 2015 02:23
defmodule TicketBuyer do
use GenServer
@ticket_sites [:ticketscalper, :feemaster, :concertoverhead]
def start_link do
GenServer.start_link __MODULE__, []
end
def init(_args) do
{:ok, %{}}
defmodule MyServer do
use GenServer
def init(_args) do
:gproc.reg({:p, :l, :my_little_server})
{:ok, []}
end
def handle_info(msg, state) do
IO.inspect "Got #{inspect msg} in process #{inspect self()}"
{:noreply, state}
{module, erl_list}. %% version = 0
{exports, [{hello_pipe,1},{hello_pp,1},{module_info,0},{module_info,1}]}.
{attributes, []}.
{labels, 9}.
{function, hello_pp, 1, 2}.
-module(erl_list).
-export([hello_pp/0]).
-export([hello_pipe/0]).
hello_pp() ->
List1 = [1,2,3,4,5],
List2 = [1,2,3,4,5],
List1 ++ List2.
hello_pipe() ->
{module, erl_list}. %% version = 0
{exports, [{hello_pipe,0},{hello_pp,0},{module_info,0},{module_info,1}]}.
{attributes, []}.
{labels, 9}.
{function, hello_pp, 0, 2}.