Skip to content

Instantly share code, notes, and snippets.

View lessmost's full-sized avatar

lessmost lessmost

  • Alibaba
  • Hangzhou China
View GitHub Profile
@lessmost
lessmost / Vagrantfile
Last active December 18, 2020 09:54
How to create a VirtualBox machine with encrypted storage with Vagrant (2.2.7)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Forked from https://gist.github.com/gabrielelana/9189eab5df963deba30f
# Works with Vagrant 2.2.7 (trigger)
# After the first `vagrant up` stop the VM and execute the following steps
# Take the identifier of the storage you want to encrypt
# > HDD_UUID=`VBoxManage showvminfo <VM_NAME> | grep 'SATA.*UUID' | sed 's/^.*UUID: \(.*\))/\1/'`
# Store your usernname (whitespaces are not allowed) in a variable
@lessmost
lessmost / init.lua
Last active November 30, 2021 07:13
neovim config
-- vim: set ts=2 sw=2 tw=2 et :
-- vim api helper
local helper = {}
helper.map = function(mode, lhs, rhs, opts)
local options = {noremap = true, silent = true}
if opts then
options = vim.tbl_extend("force", options, opts)
end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
acpi
acpid
adobe-source-han-sans-cn-fonts
adobe-source-han-sans-jp-fonts
adobe-source-han-sans-kr-fonts
adobe-source-sans-fonts
adw-gtk-theme
alacarte
apparmor
autoconf
@lessmost
lessmost / venv.fish
Last active March 11, 2024 02:57 — forked from tommyip/venv.fish
Automatically activate/deactivate virtualenv in fish shell
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
# * Handle virtualenvs that are not located in the root of a git directory.
function __auto_source_venv --on-variable PWD --on-event fish_prompt --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return
# Based on https://gist.github.com/bastibe/c0950e463ffdfdfada7adf149ae77c6f
# Changes:
# * Instead of overriding cd, we detect directory change. This allows the script to work
# for other means of cd, such as z.
# * Update syntax to work with new versions of fish.
# * Handle virtualenvs that are not located in the root of a git directory.
function __auto_source_venv --on-variable PWD --on-event fish_prompt --description "Activate/Deactivate virtualenv on directory change"
status --is-command-substitution; and return
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
-- Pull in the wezterm API
local wezterm = require("wezterm")
local mux = wezterm.mux
-- This will hold the configuration.
local config = wezterm.config_builder()
-- This is where you actually apply your config choices
-- For example, changing the color scheme: