Skip to content

Instantly share code, notes, and snippets.

@9876691
9876691 / bionic.sh
Created April 12, 2024 17:29
Install Bionic
sudo curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC='server --write-kubeconfig-mode="644"' sh -
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config && sed -i "s,127.0.0.1,$(hostname -I | awk '{print $1}'),g" ~/.kube/config
curl -L -s https://github.com/derailed/k9s/releases/download/v0.24.15/k9s_Linux_x86_64.tar.gz | tar xvz -C /tmp
sudo mv /tmp/k9s /usr/bin
rm -rf k9s_Linux_x86_64.tar.gz
export BIONIC_VERSION=1.6.35
curl -OL https://github.com/bionic-gpt/bionic-gpt/releases/download/v${BIONIC_VERSION}/bionic-cli-linux && chmod +x ./bionic-cli-linux && sudo mv ./bionic-cli-linux /usr/local/bin/bionic
bionic install --pgadmin
class Bitcoins::Index < BrowserAction
get "/bitcoins" do
addresses = populate_balances(KeyPairQuery.new.user_id(current_user.id))
render IndexPage, addresses: addresses, form: KeyPairForm.new
end
private def populate_balances(key_pair_query)
// Lucky generates 3 folders to help you organize your CSS:
@import "~normalize-scss/sass/normalize/import-now";
@import "variables/colors";
@import "components/authentication";
body {
font-family: Sans-Serif;
}
.authentication {
background-color: $color-grey;
h1 {
text-align: center;
text-transform: uppercase;
color: $color-dark-grey;
}
$color-white: white;
$color-grey: #fafafa;
$color-dark-grey: #333;
abstract class GuestLayout
# Edit shared layout code in src/components/shared/layout.cr
include Shared::Layout
def render
html_doctype
html lang: "en" do
shared_layout_head
class SignIns::NewPage < GuestLayout
needs form : SignInForm
def content
h1 "Sign In"
render_sign_in_form(@form)
end
private def render_sign_in_form(f)
form_for SignIns::Create do
class CreateKeyPair::V20180810125258 < LuckyMigrator::Migration::V1
def migrate
create :key_pairs do
add user_id : Int32
add public_key : String
add private_key : String
end
end
def rollback
LuckyRecord::Repo.configure do
if Lucky::Env.production?
settings.url = ENV.fetch("DATABASE_URL")
else
settings.url = ENV["DATABASE_URL"]? ||
LuckyRecord::PostgresURL.build(
hostname: "localhost",
database: database,
username: "ubuntu",
password: "password")
github: onchain/onchain-shard