Skip to content

Instantly share code, notes, and snippets.

View LittleKey's full-sized avatar
💫
Lk@✨

LittleKey LittleKey

💫
Lk@✨
View GitHub Profile
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
@LittleKey
LittleKey / loop.go
Last active January 29, 2019 12:31
execute shell command n times
package main
import (
"flag"
"fmt"
"io"
"os/exec"
"strings"
"time"
)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <signal.h>
#define UNUSED(x) (void)(x)
static volatile int KeepRunning = 1;
@LittleKey
LittleKey / Replace macOS Terminal Emulator with GPU accelerated Alacritty.md [Replace macOS Terminal Emulator with GPU accelerated Alacritty] #macOS #terminal #shell #alacritty

https://arslan.io/2018/02/05/gpu-accelerated-terminal-alacritty/

  • Install rust: curl https://sh.rustup.rs -sSf | sh
  • Make rust available: echo 'source "$HOME/.cargo/env"' >> ~/.bashrc
  • Set rust compiler: rustup override set stable
  • Update rust: rustup update stable
  • Get Alacritty: git clone https://github.com/jwilm/alacritty.git
  • Build Alacritty: cd alacritty && make app
  • Add Alacritty to your Applications directory: cp -r target/release/osx/Alacritty.app /Applications/
  • Create Alacritty config: mkdir -p ~/.config/alacritty &amp;&amp; cp alacritty_macos.yml ~/.config/alacritty/alacritty.yml
package main
import (
"fmt"
"math/rand"
"time"
)
// Message ...
type Message struct {
@LittleKey
LittleKey / remote_control_app.py
Last active May 21, 2020 10:30
通过微信发送命令到远程服务器. 基于werkzeug + gunicorn(gevent) 实现, 造了很多轮子
# coding: utf8
from gevent.monkey import patch_all; patch_all() # noqa
import re
import os
import sys
import time
import json
import struct
import string
@LittleKey
LittleKey / qq_bot_hook.py
Last active June 21, 2018 17:25
qqbot的插件
# -*- coding: utf-8 -*-
import re
import os
import sys
import inspect
import logging
import datetime
import threading
from contextlib import contextmanager
@LittleKey
LittleKey / test_rst.rst
Last active March 29, 2017 07:58
test rst
https://raw.githubusercontent.com/LittleKey/gallery/master/MyPic.png
@LittleKey
LittleKey / split.cmd
Created August 30, 2016 17:32
simple split mpeg4 media file ffmpeg script on windows
cd /d "%~dp0"
ffmpeg.exe -i "%~1" -acodec copy -vcodec copy -to 01:00:00.00 -f mp4 "%~dpn1"-first.mp4
ffmpeg.exe -ss 01:00:00.00 -i "%~1" -acodec copy -vcodec copy -f mp4 "%~dpn1"-second.mp4
PAUSE
#!/usr/bin/env python
#encoding: utf-8
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
from socket import gethostbyname, gethostname
if __name__ == '__main__':
authorizer = DummyAuthorizer()