Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# encoding: utf-8
# traefik provider 配置:
# providers:
# http:
# endpoint: "http://<host>:<port>/api/config"
# pollInterval: "10s"
# pollTimeout: "5s"
import subprocess
@wusuopu
wusuopu / xls2xlsx.js
Created February 4, 2023 07:06
convert xls to xlsx by nodejs
// https://www.npmjs.com/package/xlsx#installation
const xlsx = require('xlsx')
const fs = require('fs')
const Path = require('path')
const printHelp = () => {
console.log('Usage: convert.js <input.xls> [<output>]')
}
const parseOutput = (input, output) => {
@wusuopu
wusuopu / ecr-clean.py
Created November 24, 2022 13:03
clean some aws ecr docker image
#!/usr/bin/env python
# encoding: utf-8
import subprocess
import json
import logging
import os
import sys
logger = logging.getLogger('docker')
@wusuopu
wusuopu / rancher-service-upgrade.py
Last active December 18, 2023 08:39
call rancher 1.6 api to upgrade service.
#!/usr/bin/env python2
# encoding: utf-8
import urlparse
import argparse
import base64
import json
import time
import os
import sys
@wusuopu
wusuopu / dm-dump
Created May 10, 2019 07:36
docker machine manage
#!/usr/bin/env ruby
#-*- coding:utf-8 -*-
require 'json'
require 'fileutils'
def dump_config config, dest
driver = config['Driver']
ssh_dir = "#{dest}/.sshkey"
if !File.exists?(ssh_dir)
@wusuopu
wusuopu / myssh.rb
Created May 10, 2019 07:27
ssh connection manage
#!/usr/bin/env ruby
#-*- coding:utf-8 -*-
# ssh connection manage
require 'json'
require 'optparse'
def main action, options
cfg = "#{ENV['HOME']}/.ssh/.config.json"
@wusuopu
wusuopu / pre-commint.rb
Last active August 29, 2015 14:04
在Git commit之前检查所提交的文件是否有可执行权限。
#!/usr/bin/env ruby
#-*- coding:utf-8 -*-
# gem install rugged
require "rugged"
repo = Rugged::Repository.discover Dir.pwd
file_list = []
ext_list = [".png", ".jpg"]
@wusuopu
wusuopu / install-sys.sh
Last active August 29, 2015 14:04
install-sys.sh
#!/bin/bash
# 数据库
echo "install database......"
sudo apt-get install mysql-workbench mysql-common mysql-client mysql-server mongodb redis-server sqliteman
# 输入法
echo "install inputmethod...."
sudo apt-get install fcitx-mozc fcitx-table-wbpy fcitx-table-wubi fcitx-ui-classic
"=============================================================================
"
" FileName: demo.vim
"
" Author: LongChangjin
" Email: admin@longchangjin.cn
"
"=============================================================================
if !has('ruby')
@wusuopu
wusuopu / mkgitignore
Last active March 19, 2017 03:11
生成.gitignore文件
#!/bin/bash
if [[ $@ != "" ]]; then
if [[ $2 != "" ]]; then
curl http://www.gitignore.io/api/$1 -o $2
else
curl http://www.gitignore.io/api/$1
fi
else
echo 创建gitignore文件