Skip to content

Instantly share code, notes, and snippets.

View jinto's full-sized avatar

박제권 (Jay Park) jinto

  • Seoul
View GitHub Profile
from transformers import pipeline
generator = pipeline('text-generation', model = 'beomi/llama-2-ko-7b')
print("===========")
a = generator(
"""### System:
You are Free Willy, an AI that follows instructions extremely well.
Help as much as you can.
Remember, be safe, and don't do anything illegal.
@jinto
jinto / nginx.conf
Last active July 8, 2023 16:07
Working config for auth_request with proxy_cache. (nginx 1.18.0)
# Working config for auth_request with proxy_cache. (nginx 1.18.0)
# https://gist.github.com/jinto/f120e497db8d39d866db49ff2454b7b3
# ...
proxy_cache_path /tmp/cache_xx levels=1:2 keys_zone=auth_cache:10m max_size=128m inactive=10m use_temp_path=off;
server {
location / {
auth_request /_ml_proxy/auth;
# ...
proxy_pass http://backend_ip:7860/;
@jinto
jinto / LambdaJDBC.java
Created September 19, 2018 16:32
Java8 lambda and JDBC for compact code.
/**
* With java8 lambda you can use JDBC like
*
* return select("SELECT fields from table_name where id=?", (params)-> {
* params.add("user_id");
* });
*
*/
import java.util.List;
import java.util.ArrayList;
@jinto
jinto / 1_first.py
Created March 23, 2016 02:46
Refinement from decorator to plain old fashioned functions Raw
# problem is code duplication.
from django.db import connections
class Dao:
@classmethod
def get_list(cls):
try:
conn = connections["db_name"]
cursor = conn.cursor()
# /etc/nginx/sites-enabled/site-domain
upstream backend {
server 127.0.0.1:7777 weight=100 max_fails=5 fail_timeout=5;
server 127.0.0.1:7778 weight=100 max_fails=5 fail_timeout=5;
}
server {
listen 80;
server_name www.xxx.com;
return 301 http://xxx.com$request_uri;
@jinto
jinto / httpd.conf
Last active August 29, 2015 14:17 — forked from jmorton/Dockerfile
#요기 /etc/httpd/conf/httpd.conf
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi-py34.cpython-34m.so
WSGIPythonPath /opt/projectname:/opt/venv/lib/python3.4/site-packages
<VirtualHost *:80>
ServerName www.yourserver.com
DocumentRoot /opt/projectname
@jinto
jinto / recv.rb
Last active November 17, 2019 08:11
rabbitmq ruby ( for blogging http://tech.jinto.pe.kr/2014/10/16/RabbitMQ.html)
# encoding: utf-8
require "bunny"
def hi(name)
conn = Bunny.new(:automatically_recover => false)
conn.start
ch = conn.create_channel(nil, 8)
q = ch.queue(name)#, :exclusive => true)
@jinto
jinto / etc_iptable.up.rules
Created August 9, 2014 14:28
우분투 12.04 생성하고, rails + postgresql + postgis 설정. 어쨌든 최신버전.
*filter
# 이렇게 다 열려있는 iptable이 무슨 소용이 있으리오만.
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
@jinto
jinto / 0_reuse_code.js
Created November 21, 2013 12:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# 현재 가장 잘 동작하는 버전인듯
# postgres는 설치했다고 가정하자.
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
# 환경변수에 LC_COLLATE=C 이거 있는지 확인