Skip to content

Instantly share code, notes, and snippets.

View liujiantong's full-sized avatar
🎯
Focusing

龙州客 liujiantong

🎯
Focusing
View GitHub Profile
@liujiantong
liujiantong / example.py
Created March 25, 2023 16:05 — forked from happyme531/example.py
llama interactive example
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the GNU General Public License version 3.
from typing import Tuple
import os
import sys
import torch
import fire
import time
import json
@liujiantong
liujiantong / reshard.py
Created March 25, 2023 14:41 — forked from benob/reshard.py
Script to decompose/recompose LLAMA LLM models with different number of shards.
# script to decompose/recompose llama model in different number of shards
# note that it loads the full model * 2 in cpu memory
import os
import json
import sys
import torch
import glob
if len(sys.argv) != 4:
@liujiantong
liujiantong / gist-rm-ads-clash4win.txt
Last active March 6, 2023 10:46
Remove ads for "Clash for Windows"
# Remove ads for `https://github.com/Fndroid/clash_for_windows_pkg`
# Compatible versions: 0.19.0, 0.19.22, 0.19.21, 0.20.0 ~ 0.20.17
# sudo npm install -g asar --unsafe-perm=true --allow-root
# mkdir ~/clash4win
# asar extract app.asar .
# Replace some keywords in `renderer.js` file.
conda install -c conda-forge ta-lib
@liujiantong
liujiantong / supervisord.service
Last active February 21, 2021 04:47 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=$(supervisord_dir)/supervisord -c /etc/supervisord.conf
ExecReload=$(supervisord_dir)/supervisorctl reload
ExecStop=$(supervisord_dir)/supervisorctl shutdown
@liujiantong
liujiantong / start-celery-for-dev.py
Created December 1, 2017 09:21 — forked from chenjianjx/start-celery-for-dev.py
A python script which starts celery worker and auto reload it when any code change happens.
'''
A python script which starts celery worker and auto reload it when any code change happens.
I did this because Celery worker's "--autoreload" option seems not working for a lot of people.
'''
import time
from watchdog.observers import Observer ##pip install watchdog
from watchdog.events import PatternMatchingEventHandler
import psutil ##pip install psutil
import os
@liujiantong
liujiantong / impala_odbc
Last active June 6, 2017 02:27
impala odbc with tableau
# impala odbc with tableau
[impala odbc with tableau](https://www.cloudera.com/documentation/enterprise/latest/topics/impala_odbc.html)
To illustrate the outline of the setup process, here is a transcript of a session to set up all required drivers and a business intelligence application that uses the ODBC driver, under Mac OS X. Each .dmg file runs a GUI-based installer, first for the underlying IODBC driver needed for non-Windows systems, then for the Cloudera ODBC Connector, and finally for the BI tool itself.
```
$ ls -1
Cloudera-ODBC-Driver-for-Impala-Install-Guide.pdf
BI_Tool_Installer.dmg
@liujiantong
liujiantong / intall_tabcmd_on_linux.txt
Last active June 2, 2017 04:07
Install Tabcmd on Linux
### 安装Tabcmd on Linux
* 在 Windows机器上找到 `C:\Program Files\Tableau\Tableau Server\{version}\extras\TabcmdInstaller-x64.exe`
* 安装 `TabcmdInstaller-x64.exe`
* 在Linux 机器上, mkdir -p ~/tabcmd/lib ~/tabcmd/logs ~/tabcmd/reports
* 复制 `C:\Program Files\Tableau\Tableau Server\{version}\lib\*` 到 Linux机器的 ~/tabcmd/lib 目录
* In the tabcmd directory, 创建脚本 tabcmd.sh. 如下:
```
#!/usr/bin/env bash
@liujiantong
liujiantong / tabcmd-on-linux.txt
Last active May 3, 2017 08:47
安装Tabcmd on Linux
## 安装Tableau 开发库
### 安装 [Tableau tools](https://github.com/bryantbhowell/tableau_tools)
* pip install tableau_tools
### 安装Tabcmd on Linux
* 在 Windows机器上找到 `C:\Program Files\Tableau\Tableau Server\{version}\extras\TabcmdInstaller-x64.exe`
* 安装 `TabcmdInstaller-x64.exe`
* 在Linux 机器上, mkdir -p ~/tabcmd/lib ~/tabcmd/logs ~/tabcmd/reports
* 复制 `C:\Program Files\Tableau\Tableau Server\{version}\lib\*` 到 Linux机器的 ~/tabcmd/lib 目录
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.