Skip to content

Instantly share code, notes, and snippets.

@sunyi00
sunyi00 / RepeatFM
Created January 20, 2012 08:11 — forked from kejun/RepeatFM
FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// ==UserScript==
// @name RepeatFM
// @namespace org.kejun
// @description FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// @include http://douban.fm, http://douban.fm/*
// ==/UserScript==
var isRepeat = localStorage.getItem('is_repeat_fm')|0;
function importCSS(str) {
@sunyi00
sunyi00 / elasticsearch-snapshot-restore.md
Created September 17, 2016 10:18 — forked from lucidlibrary/elasticsearch-snapshot-restore.md
Elasticsearch Snapshot and Restore API

Elasticsearch introduced Snapshot and Restore API in Elasticsearch 1.0. With this module you can take backup/restore of the data easily.

To take snapshots or to restore them, first you need to create a repository. A repository is a just like allocating an address to your snapshots.

A repository can contain as many snapshots as you would like, and you can create any number of repositories.

Each repository is mapped to a location where your snapshot files will be stored. Elasticsearch first started with snapshots to FileSystem location, now you can take snapshots to Remove locations like AWS S3 directly.

Elasticsearch currently supports snapshtos to AWS S3,

-- Disable SIP (csrutil disable)
ref: https://github.com/pypa/virtualenv/issues/2023
-- Run SHELL as x86_64 mode
arch -x86_64 $SHELL
ref: https://sspai.com/post/63935
-- uninstall arm 64 brew (if needed)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
@sunyi00
sunyi00 / README MongoDB Podman
Created December 10, 2021 04:58 — forked from jfear/README MongoDB Podman
Setting up mongod using podman
Copyright (c) 2021 Justin M. Fear
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@sunyi00
sunyi00 / p8ln
Created December 20, 2021 09:03 — forked from drmingdrmer/p8ln
Format python source codes with autopep8 on only changed lines
#!/bin/sh
# Format python source codes with autopep8 on changed lines.
#
# Usage:
# format all uncommitted lines:
# > p8ln
#
# format file:
# > p8ln a.py b.py
@sunyi00
sunyi00 / llama2-mac-gpu.sh
Created July 21, 2023 07:28 — forked from adrienbrault/llama2-mac-gpu.sh
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"