Skip to content

Instantly share code, notes, and snippets.

@mba811
mba811 / toutiao_typora.css
Created June 12, 2021 05:34 — forked from theshiau/toutiao_typora.css
Bytedance Toutiao Theme for Typora
/*Editor*/
#write {
max-width: 700px;
margin: 0 auto;
padding: 30px;
padding-bottom: 100px;
}
/*Preview*/
body {
font-family: -apple-system, helvetica, sans-serif;
if [[ ! -o interactive ]]; then
return
fi
compctl -K _rbenv rbenv
_rbenv() {
local word words completions
read -cA words
word="${words[2]}"
#Variable declaration
$vCenterIPorFQDN="192.168.243.40"
$vCenterPort="443"
$vCenterUsername="Administrator@vsphere.local"
$vCenterPassword="vmware"
$DatacenterFolder="DCFolder"
$DatacenterName="Datacenter"
$MgmtClusterName="MgmtCluster"
$OpenStackClusterNames=@("OpenStackCluster") #Cluster(s) managed by OpenStack
$MgmtHosts= @("192.168.243.144") #IP or FQDN of hosts participating in Management Cluster
@mba811
mba811 / turbo-qiniu.sh
Created November 26, 2015 12:29 — forked from trawor/turbo-qiniu.sh
本脚本解决部分地区七牛上传速度慢的问题
#!/bin/bash
#
# 通过对比 ping 响应时间,找到本机最快的上传ip
# Travis@fir.im
#
function refresh_host()
{
IP="$1"
UPLOAD_HOST="upload.qiniu.com"
@mba811
mba811 / gist:71764ca4024bcfe73648
Last active November 24, 2015 13:08 — forked from ody/gist:5718115
puppetlabs-openstack
---
# Data needed for Class['openstack::compute']
# The IP and interface that external sources will use to communicate with the instance and hypervisors.
openstack::compute::public_interface: 'eth0'
openstack::compute::internal_address: "%{ipaddress_eth0}"
openstack::compute::iscsi_ip_address: "%{ipaddress_eth0}"
# The interface that will handle instance to intance communication and instance outbound traffic.
openstack::compute::private_interface: 'eth1'
@mba811
mba811 / .gitignore
Created July 8, 2015 17:21
git .gitignore
# Folder view configuration files
###################
.DS_Store
.DS_Store?
Desktop.ini
# Thumbnail cache files
###################
._*
Thumbs.db
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@mba811
mba811 / youtube-dl
Created April 29, 2015 10:15
Notes on Youtube.dl tool
1. Install
sudo apt-get install youtube-dl
sudo apt-get install libavcodec-extra-53
2. Download video
-Single video
youtube-dl -f 18 <URL>
-Batch
youtube-dl -a filename.txt
3. Check all supported video formats for a youtube video
youtube-dl -F <URL>
@mba811
mba811 / ruby-youtube-downloader.rb
Created April 29, 2015 10:13
ruby-youtube-downloader
#!/usr/bin/env ruby
require 'cgi'
def video_token(video_id)
token = CGI.parse(%x!curl http://www.youtube.com/get_video_info?video_id=#{video_id}!)['token'][0]
end
def video_id(url)
CGI.parse(url.split('?')[1])['v']
@mba811
mba811 / post-receive.sh
Created April 17, 2015 07:03
git autodeploy script when it matches the string "[deploy]"--用http方式clone的,所以在git pull之前要先git update-server-info。 所以这段脚本直接放到post-update钩子里就好了。。。
#!/bin/sh
#
# git autodeploy script when it matches the string "[deploy]"
#
# @author icyleaf <icyleaf.cn@gmail.com>
# @link http://icyleaf.com
# @version 0.1
#
# Usage:
# 1. put this into the post-receive hook file itself below