Skip to content

Instantly share code, notes, and snippets.

@emctoo
emctoo / starship.toml
Created May 27, 2022 07:09
~/.config/starship.toml
# ~/.config/starship.toml
# Don't print a new line at the start of the prompt
add_newline = false
[cmd_duration]
show_milliseconds = true
format = "took [$duration](bold yellow) "
[character]
@emctoo
emctoo / snat-dnat.md
Last active April 11, 2022 08:22
nat.md

ip forward

sudo modprobe ip_tables
sudo modprobe ip_conntrack
sudo modprobe iptables_nat

sysctl -w net.ipv4.ip_forward = 1
@emctoo
emctoo / .babelrc
Last active February 1, 2019 02:24
webpack for phoenix, integrated with vue, needs some cleanup
{
"presets": [
[
"@babel/preset-env",
{
"targets":
{
"browsers": [
"last 2 Chrome versions"
]
@emctoo
emctoo / cycle.go
Created December 20, 2016 14:41
feh momentum
package main
import (
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/exec"
"syscall"
@emctoo
emctoo / convert_mysql_to_sqlite3.sh
Created October 19, 2016 05:16 — forked from grfiv/convert_mysql_to_sqlite3.sh
convert a mysql database to sqlite3
#!/bin/bash
#
# convert a mysql database to sqlite3
#
#see https://stackoverflow.com/questions/5164033/
# export-a-mysql-database-to-sqlite-database
mysql_host=localhost
mysql_user=george
#mysql_passwd=****************
@emctoo
emctoo / vim.md
Last active January 16, 2016 09:40
vim
@emctoo
emctoo / compef.md
Last active January 16, 2016 05:59
complete 13 command not found compdef

zsh 登录时 complete 13 command not found compdef 问题

问题描述

只有登录时候出现, 登录后后开启terminal没有出现, 此时which compdef也工作正常

解决方案

安装nvm时, 需要在~/.zprofile中添加 source ource /usr/share/nvm/init-nvm.sh, 就是这一行出的问题, 注释掉就可以了.

原因

@emctoo
emctoo / freebsd.timezone.md
Last active January 7, 2016 08:23
freebsd timezone