Skip to content

Instantly share code, notes, and snippets.

View Digi-D's full-sized avatar

Dima Strakovsky Digi-D

View GitHub Profile
@Digi-D
Digi-D / gist:5e6f0455102ddef1f5b25d7c7aafaf20
Created April 27, 2025 14:32
Expand Ollama Model Context
FROM llama3.1
# sets the context window size
PARAMETER num_ctx 32768
# To create a model: ollama create llama3.1extended_ctx -f llama_extend_context.modelfile
forever start --uid infinite -c "npm start" ./
context.log('method = ', req.method)
//handle preflight request
if (req.method === 'OPTIONS') {
context.log('======= Saw OPTIONS');
context.res = {
status: 200,
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With',
pg_ctl -D /usr/local/var/postgresql@9.6 start
pg_ctl -D /usr/local/var/postgresql@9.6 stop
#TROUBLESHOOTING
lsof -i :5432
#THROUGH BREW
brew services list
brew services start postgresql@version_number
@Digi-D
Digi-D / make bucket public
Last active November 10, 2017 18:13
S3 Stuff to do
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": [
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl vm.vfs_cache_pressure=50
<div class="container cool-style">
Let's give our monster a name:
<input id="monster-name">
<button onclick="testMe()">
submit
</button>
</div>
<script>
sudo certbot certonly -a webroot --webroot-path=/var/www/demo -d yourdomain.here -d www.yourdomain.here
@Digi-D
Digi-D / Node SSL Setup
Last active July 22, 2017 04:08
Nginx Configwe live in /etc/nginx/sites-available
# Use this before you obtain SSL since certbot hates port forwarding
# server{
# listen 80;
#
# server_name my.website.com;
# root /home/deploy/site_root_dir;
# index index.html;
#
# }
#add remote - yes I always forget this
git remote add <remote_name> <repo_url>
EX:git remote add origin https://github.com/my/repo.git
#Push to specific branch
git push <remote_name> <local_branch>:<remote_branch>
EX: git push origin master:release_april_2015
# Delete old branch
git push origin :old_branch