Skip to content

Instantly share code, notes, and snippets.

View senthilnayagam's full-sized avatar

Senthil Nayagam senthilnayagam

  • Muonium
  • Chennai, India
View GitHub Profile
@ivanfioravanti
ivanfioravanti / gist:bcacc48ef68b02e9b7a4034161824287
Created January 25, 2024 00:01
Fine tuning dataset generation wiht Ollama python library
import json
import os
import ollama
def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''):
response = ollama.generate(
model=model,
prompt=context + prompt)
return response['response'].strip()
@ines
ines / Install
Last active September 21, 2023 17:14
Streamlit + spaCy
pip install streamlit
pip install spacy
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_md
python -m spacy download de_core_news_sm
@hcmiya
hcmiya / 001-proxy.md
Last active May 21, 2024 08:00
Quick example of federating with darknet instances from clearnet

Quick example of federating with Tor instances from clearnet

figure1

Install and configure Tor / Privoxy

# apt install privoxy tor
@hcmiya
hcmiya / install-tor-instance.md
Last active August 16, 2019 04:05
Example of building Tor instance
  • Install to Debian Buster
  • All of services needed to run Mastodon instance (tor, postgresql, redis, nginx) will be installed to the same server.

Install packages

# apt install postgresql redis nodejs npm ruby tor ffmpeg imagemagick git \
  nginx wget bundler protobuf-compiler iptables-persistent ncurses-term vim \
  gcc g++ make patch ruby-dev libprotobuf-dev libidn11-dev libpq-dev libicu-dev libxml2-dev libxslt1-dev 
@Ashioto
Ashioto / ActorCritic.py
Created April 18, 2017 07:51
Solution to Continuous Mountain Car
import tensorflow as tf
import numpy as np
import os
import gym
import time
import sklearn
import itertools
import sklearn.pipeline
import sklearn.preprocessing
from sklearn.kernel_approximation import RBFSampler
@martijngastkemper
martijngastkemper / csvkit-example.bash
Last active May 26, 2022 07:54
CSVkit example to convert CSV to SQLLite and query the data
# This example requires CSVkit (https://github.com/wireservice/csvkit). A Python toolset with a lot of very cool CSV tools.
# IMPORTANT NOTE: make sure to use a proper csv file. I had a lot of trouble with a csv file created by a service with Dutch
# as locale. Changing it to US solved the problem. Some locales use comma's to seperate point numbers. A semicolon is then
# used.
# Create table example and Load file-a.csv into it
csvsql --db sqlite:///example.db --table example --insert file-a.csv
# Add an extra file to table example
@t04glovern
t04glovern / snakes-and-ladders.py
Last active September 22, 2020 08:29
Python implementation of Snakes and Ladders
import random
# Snakes and Ladders dictionary
SaLdic = {6: 17,
14: 3,
20: 15,
24: 26,
30: 44,
39: 33,
49: 62,
@Stanback
Stanback / Dockerfile
Created March 28, 2015 01:21
PhantomJS 2.0 Dockerfile
#
# Example Dockerfile that builds PhantomJS 2.0
#
# Build with:
# docker build --rm --tag=phantom2.0:latest .
#
# Run with:
# docker run --name=phantom2.0 phantom2.0
#
# Copy the executable to your host machine for distribution:
@carols10cents
carols10cents / ruby-to-rust-cheat-sheet.md
Last active November 24, 2020 23:12
Ruby to Rust Cheat Sheet

Ruby to Rust Cheat Sheet

The goal of this is to have an easily-scannable reference for the most common syntax idioms in Ruby and Rust so that programmers most comfortable with Ruby can quickly get through the syntax differences and feel like they could read and write basic Rust programs.

What do you think? Does this meet its goal? If not, why not?

Variables

Ruby:

@fperez
fperez / ProgrammaticNotebook.ipynb
Last active May 2, 2024 19:14
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.