Skip to content

Instantly share code, notes, and snippets.

View Hansimov's full-sized avatar

Hansimov

View GitHub Profile
@Hansimov
Hansimov / fish-config.md
Last active July 8, 2023 11:47
Fish Shell Configs

~/.config/fish/config.fish:

set fish_prompt_pwd_dir_length 0
set -U fish_greeting "🐟 Hello, $USER 🐟"
function fish_prompt --description "Write out the prompt"
    set -l color_cwd
    set -l suffix
    switch "$USER"
 case root toor
@Hansimov
Hansimov / cf-warp-setup.md
Last active June 14, 2023 16:29
Setup cloudflare WARP in Linux
@Hansimov
Hansimov / v2ray-setup.md
Last active April 25, 2024 14:31
Setup v2ray server (linux) and client (windows)
@Hansimov
Hansimov / ArgParser.py
Last active June 26, 2023 11:15
A template for customized Argument Parser in Python
import argparse
import sys
class ArgParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super(ArgParser, self).__init__(*args, **kwargs)
self.add_argument(
"-s", "--sync", action="store_true", help="Sync origin and upstream"
)
self.add_argument("-i", "--paper-id", type=str, help="arXiv paper ID")
@Hansimov
Hansimov / remote-ssh.md
Created May 16, 2023 11:14
Remote-SSH server issues

If cannot ssh to remote server with password, it is possibly because that the remote server does not enable PasswordAuthentication.

So we need to use the method of public keys to login.

Run in Local Machine:

ssh-keygen

This will generate a key pair for ssh.

@Hansimov
Hansimov / npm-node-upgrade.md
Last active February 26, 2024 11:31
Upgrade versions of npm and node.js to latest

Update Node.js via nvm

Install nvm

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Run bash to restart terminal to make the execution path recognizable.

@Hansimov
Hansimov / break_bing_chat_input_limit.user.js
Last active October 22, 2023 08:23
Break the input character limits of Bing Chat
// ==UserScript==
// @name Break Bing Chat Input Limit
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Break the input character limits of Bing Chat
// @match https://www.bing.com/search*
// @grant none
// ==/UserScript==
(function() {
@Hansimov
Hansimov / proxifier.md
Created May 6, 2023 07:05
Use proxifier to manage different proxies for different applications

(1) Disable all local proxy settings in PC:

  • Automatic proxy setup: Off
  • Manual proxy setup > Use a proxy server: Off

(2) Add proxy server in Proxifier:

  • Profile > Proxy Servers > Add:

    Address Port Type

|127.0.0.1|11111|HTTPS|

@Hansimov
Hansimov / frp-proxy.md
Last active July 11, 2023 06:04
Use FRP proxy to forward network traffic

Background

  • Machine PRIVATE has limited access to public network.
  • Machine PUBLIC has full access to publick network.

Target

  • Enable PRIVATE to visit public network with same access with PUBLIC.

Solution

Download related version of FRP, both in PRIVATE and PUBLIC:

@Hansimov
Hansimov / run-stable-diffusion-in-ubuntu.md
Last active April 11, 2023 17:23
Run Stable Diffusion webui in Ubuntu server

Run:

# > ~/repos/
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
bash webui.sh --listen --share --port 23456 --no-gradio-queue --xformers --device-id=2

Download commonly used models:

  • ChilloutMix