Skip to content

Instantly share code, notes, and snippets.

View dantodor's full-sized avatar

Dan Todor dantodor

  • Busymachines
  • Romania
View GitHub Profile
@dantodor
dantodor / cloud-init.yaml
Created March 9, 2025 01:44 — forked from NatElkins/cloud-init.yaml
cloud-init script for VPS
#cloud-config
# Enable automatic package updates and upgrades during cloud-init execution
package_update: true
package_upgrade: true
packages:
# Security and Hardening
- ufw
- fail2ban
@dantodor
dantodor / README.md
Created December 3, 2024 10:47 — forked from disler/README.md
Prompt Chaining with QwQ, Qwen, o1-mini, Ollama, and LLM

Prompt Chaining with QwQ, Qwen, o1-mini, Ollama, and LLM

Here we explore prompt chaining with local reasoning models in combination with base models. With shockingly powerful local models like QwQ and Qwen, we can build some powerful prompt chains that let us tap into their capabilities in a immediately useful, local, private, AND free way.

Explore the idea of building prompt chains where the first is a powerful reasoning model that generates a response, and then use a base model to extract the response.

Play with the prompts and models to see what works best for your use cases. Use the o1 series to see how qwq compares.

Setup

  • Bun (to run bun run chain.ts ...)
{
 "StartAt": "ValidatePayment",
 "States": {
 "ValidatePayment": {
 "Type": "Task",
 "Resource": VALIDATE-PAYMENT-ARN",
 "Next": "CheckPayment"
 },
 "CheckPayment": {
 "Type": "Choice",
@dantodor
dantodor / AkkaStreamSparkIntegration.scala
Created June 10, 2020 14:52 — forked from lloydmeta/AkkaStreamSparkIntegration.scala
Example for how to connect Akka Stream and Spark Streaming by turning creating a Flow element that feeds into an InputDstream
import akka.actor._
import akka.stream.scaladsl.Flow
import org.apache.spark.streaming.dstream.ReceiverInputDStream
import org.apache.spark.streaming.receiver.ActorHelper
import akka.actor.{ ExtensionKey, Extension, ExtendedActorSystem }
import scala.reflect.ClassTag
object AkkaStreamSparkIntegration {
@dantodor
dantodor / smallberta_pretraining.ipynb
Created February 29, 2020 16:36 — forked from aditya-malte/smallberta_pretraining.ipynb
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dantodor
dantodor / application.confg
Created May 23, 2019 14:37
Example: Minimal HTTP server for static content using Scala and Akka - HTTP
akka.http.server {
parsing {
max-content-length = 110M
}
}
akka {
loglevel = DEBUG
}
@dantodor
dantodor / README.markdown
Created April 27, 2017 16:22 — forked from alpacaaa/README.markdown
Use mysql for authentication in ubuntu 12.04

Authenticating users against mysql

I couldn't find any relevant information for getting this to work on ubuntu precise, so I'm writing my founds here.
It's actually pretty simple, this approach doesn't involve PAM but just NSS. The implications are clearly explained in the FAQ of the nss-mysql module:

NSS stands for NameService Switch. NSS allows you to implement access to various data using any number of modules. This means that when the operating system wants to look up the user "cinergi", it doesn't have to know how - it calls upon the NSS system to perform the task. In turn, we can now configure NSS to look for users in traditional places like /etc/passwd, NIS, LDAP, and now (using this module), MySQL. The NSS

@dantodor
dantodor / nginxproxy.md
Created September 3, 2016 13:39 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@dantodor
dantodor / ComplexTcpClient.scala
Created September 3, 2016 13:37 — forked from kiritsuku/ComplexTcpClient.scala
Complex TCP server and client
import scala.io.StdIn
import scala.util._
import akka.actor._
import akka.stream._
import akka.stream.scaladsl._
import akka.stream.stage._
import akka.util._
object ComplexTcpClient extends App {
@dantodor
dantodor / monadt.scala
Created April 19, 2016 07:17 — forked from juanjovazquez/monadt.scala
Translation of Raul Raja's article `FP for the average Joe - II - ScalaZ Monad Transformers` for using cats library instead of scalaz. @see http://bit.ly/1SkmOTe
/**
Translation of Raul Raja's article
`FP for the average Joe - II - ScalaZ Monad Transformers`
for using cats library instead of scalaz.
@see http://bit.ly/1SkmOTe
*/
package joe