Skip to content

Instantly share code, notes, and snippets.

View vgribok's full-sized avatar

Vlad Hrybok vgribok

View GitHub Profile
@vgribok
vgribok / ollama-install-and-run.md
Last active April 26, 2024 01:47
How to run local LLM on your computer with Ollama
@vgribok
vgribok / gist:1b43d166747e138f4f99ab78387fd129
Last active March 19, 2024 02:04 — forked from nekiee13/gist:c8ec43bce5fd75d20e38b31a613fd83d
Install Ollama under Win11 & WSL - CUDA Installation guide

CMD prompt - verify WSL2 is installed

wsl --list --verbose
or
wsl -l -v

git clone CUDA samples - I used location at disk d:\LLM\Ollama , so I can find samples with ease

d: && cd d:\LLM\Ollama git clone --recursive -j6 https://github.com/NVIDIA/cuda-samples.git

@vgribok
vgribok / rds-parameter-group-exporter-importer.ps1
Last active June 21, 2023 18:40
Allows copying RDS parameter groups between AWS Regions and Accounts. Enables version-controlling values of RDS param groups via JSON files. Makes possible RDS cluster provisioning automation for custom parameter groups.
<#
Allows exporting RDS Parameter Group parameters as a file and importing it in another AWS Account or a region.
Inspired by https://gist.github.com/phill-tornroth/f0ef50f9402c7c94cbafd8c94bbec9c9.
PowerShell is a *cross-platform* shell compatible with Linux, MacOS and Windows.
PowerShell can be installed in seconds: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell
Usage:
To *export* a cluster parameter group named "custom-aurora-postgresql13-babelfish-compat-1", run:
# These commands are DANGEROUS! They may DELETE ALL YOUR DATA in AWS S3!
# Use at your own risk! NO WARRANTY OR LIABILITY IS ASSUMED OR WILL BE ACCEPTED!
# The main purpose is to delete multiple (non-empty) S3 buckets using
# bucket name prefix, converted by the script to a wildcard.
# Uses PowerShell Tools for AWS.
# You may need to swtich to bucket's AWS Region if you are getting the following error:
# "The bucket you are attempting to access must be addressed using the specified endpoint.
# Please send all future requests to this endpoint."
@vgribok
vgribok / CancellationToken.dart
Last active September 6, 2022 13:59
Dart/Flutter CancellationToken class friendly to the CancelableOperation and Future
part of flutter_nav2_oop;
/// Enables cancelling multiple cancellable operations at once,
/// and provides less error-prone pattern for using [CancelableOperation].
///
/// This class augments two flaws of the [CancelableOperation]:
/// 1. Ability to cancel multiple operations at once.
/// 2. Using correct method - `valueOrCancellation()` - of the [CancelableOperation]
/// to access async result, ensuring cancellation works properly.
class CancellationToken {
@vgribok
vgribok / AmplifyCompWithAuth.tsx
Last active June 6, 2021 01:37
Showing how to customize AWS Amplify UI components for React Native using withAuthenticator() function, by 1) changing username to email address, 2) supplying a theme overriding Amplify orange, and 3) updating sign up form with removing phone number field and adding person's name field
/*
AWS Amplify withAuthenticator() function for React Natvive has two arguments sets, and combining signUpConfig, a theme,
and replacing username with email was hard to figure out, and no internet samples shown how to do that.
Here's the example of how to all of the above.
*/
// @ts-ignore
import { withAuthenticator, AmplifyTheme } from 'aws-amplify-react-native'
import Local from "~/constants/Strings";
import cloneDeep from 'lodash/cloneDeep';
import { ColorValue, Platform } from "react-native";
@vgribok
vgribok / App.js
Last active February 13, 2021 17:08
An expanded sample for the "Building Offline-first Cross-platform Apps with Expo and Amplify DataStore" youtube video
import * as React from 'react'
import Constants from 'expo-constants'
import Amplify from '@aws-amplify/core'
import { DataStore } from '@aws-amplify/datastore'
import { TapGestureHandler, State } from 'react-native-gesture-handler'
import {
Text,
View,
TextInput,
@vgribok
vgribok / how-can-they-be-so-brainwashed.md
Last active July 21, 2023 16:58
An attempt at understanding of how humans think: the natural limit of power of reasoning

How can the other side be so brainwashed?

How can people on the other side of the political or phylosophical devide be so incredibly blind? How can they be so impervious to the obvious truth and evidence?

Abstract

This paper (a work in progress) seeks to put forward a hypothesys (framework) - really a minimal set of assumptions - in which irrational human behavior makes sense. The paper analyzes a few ways, both destructive and productive, in which humanity responds to challenges within this framework. Finally it provides recommendations for ways of improving our chances for continual peaceful and prosperous existance, hopefully replacing total falls of civilizations with just temporary dips.

The unfinished nature of this arcticle means that some parts of it a well tought out and written somewhat coherently, others represent a more raw idea or observation, needing future refinement.

Key observations

@vgribok
vgribok / install-k8s-dashboard-on-EKS-Fargate.ps1
Last active September 10, 2020 21:20
PowerShell script installing Kubernetes web Dashboard on EKS Fargate cluster
<#
Installs Kubernetes Dashboard on AWS EKS Fargate cluster.
To run, execute following PowerShell commands:
curl -o $env:TMP/install-k8s-dashboard-on-EKS-Fargate.ps1 https://gist.githubusercontent.com/vgribok/f3b5b16ad06a508d232d9b3166738267/raw/3da6564b2f1250e2ec7b3eff319985d12542ad96/install-k8s-dashboard-on-EKS-Fargate.ps1
. $env:TMP/install-k8s-dashboard-on-EKS-Fargate.ps1
Pre-requisites:
- An AWS Account
@vgribok
vgribok / open-K8s-dashbord-locally.ps1
Created September 10, 2020 20:51
PowerShell script opening Kuberntes dashboard on local computer and copying auth token to the clipboard for easy login
<#
Opens K8s Dashboard installed on EKS with `kubectl proxy`,
and copies authentication token to the clipboard for the easy of login.
Assumes current kubectl cluster is where the dashboard is.
To run, execute following PowerShell commands:
curl -o $env:TMP/open-K8s-dashbord-locally.ps1 https://gist.githubusercontent.com/vgribok/a4cd751ed06223d50fd39e99572988f7/raw/84b6539c734eeb8746ab3afb6bc38fceebb4606e/open-K8s-dashbord-locally.ps1
. $env:TMP/open-K8s-dashbord-locally.ps1