Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
holmeszyx / autoinput
Last active February 8, 2017 01:22
A bash to input text on focused window
#!/bin/bash
text=$1
if [[ $# -eq 0 ]]; then
# read from pipe
read -t 1 text
fi
if [[ ${text} == "" ]]; then
@holmeszyx
holmeszyx / rm_build_dir.sh
Last active October 10, 2016 10:07
Delete gralde bulid dir, to release disk space
#!/bin/bash
# echo $#
scandir=$(pwd)
if [[ $# -gt 0 ]]; then
scandir=$1
fi
@holmeszyx
holmeszyx / update_vs_go.sh
Created September 22, 2016 14:18
update tools which depended on vscode go plugin
#!/bin/bash
u="-u"
u=""
go get ${u} -v github.com/nsf/gocode
go get ${u} -v github.com/rogpeppe/godef
go get ${u} -v github.com/golang/lint/golint
go get ${u} -v github.com/lukehoban/go-outline
go get ${u} -v sourcegraph.com/sqs/goreturns
@holmeszyx
holmeszyx / Usage.md
Last active August 15, 2016 03:41
create a menu to extract zip which compress with gbk charset
  • create servermeu folder in local path.

    ~/.local/share/kservices5/ServiceMenus/

  • put desktop to folder created above.

  • put bash file into local bin dir.

@holmeszyx
holmeszyx / cof.md
Last active July 11, 2016 01:36
简单的config接口

后台一个接口。 比如:yue.fm/api/config 请求: GET yue.fm/api/config?key={key} 返回: 文本 TEXT

后台界面,可以配置。 列出已有的key-value对。就是个列表。

可以添加。一对。

@holmeszyx
holmeszyx / .tmux.conf
Last active March 5, 2020 14:10
tmux 从当前目录创建新panel
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
@holmeszyx
holmeszyx / random
Created June 21, 2016 09:06
Create random number with bash.
#!/bin/bash
c=$#
#echo $#
if [[ ${c} -gt 0 ]]; then
echo "$RANDOM * $1" | bc
else
echo $RANDOM
fi
@holmeszyx
holmeszyx / baserc
Last active December 6, 2017 10:30
cow 配置
source /home/holmes/My/bash/http_proxy
@holmeszyx
holmeszyx / mask.go
Created May 13, 2016 08:51
生成一下java的mask或者index常量
package main
import (
"fmt"
"strings"
)
type item struct {
Name string
Comment string
@holmeszyx
holmeszyx / Popobox-debian
Last active April 24, 2016 13:36 — forked from yanwen/Popobox-debian
29元 泡泡云 安装 debian
Debian with Popobox v1.0
原文链接:http://pear.xiaojiublog.net/2013/11/debian-with-popobox-v1-0/
## 部分内容由 felix021 修正、简化 ##
1: 制作Debian系统
mkdir chroot && cd chroot
sudo debootstrap --foreign --arch=armel wheezy debian http://mirrors.ustc.edu.cn/debian/
打包: