Skip to content

Instantly share code, notes, and snippets.

Verify Github on Galaxy. gid:yKFDHY9ddNBwSr3AWRtCV
@rabbitz
rabbitz / curl.md
Last active June 9, 2022 03:48
curl查看请求时间

curl命令查看请求响应时间

对于一些禁止ping 的网址可以使用curl进行测试

curl -o /dev/null -s -w %{http_code}---%{content_type}---%{time_namelookup}---%{time_namelookup}---%{time_connect}---%{time_starttransfer}---%{time_total}---%{speed_download}"\n" "http://www.baidu.com/"

-o /dev/null:把curl 返回的html、js 写到垃圾回收站[ /dev/null] -s:去掉所有状态 -w:按照后面的格式写出rt

@rabbitz
rabbitz / macOS.sh
Created November 4, 2021 03:14 — forked from repodevs/macOS.sh
gpg: signing failed: Inappropriate ioctl for device macOS
❱ git config user.signingKey 38AF394C
❱ git config commit.gpgSign true
echo "test" | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
test
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
require 'nokogiri'
require 'open-uri'
# Get a Nokogiri::HTML:Document for the page we're interested in...
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))
# Do funky things with it using Nokogiri::XML::Node methods...
####
@rabbitz
rabbitz / 0_reuse_code.js
Created December 29, 2015 05:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require "rails"
module MyEngine
class Engine < Rails::Engine
# We can add all of the public assets from our engine and make them
# available to use. This allows us to use javascripts, images, stylesheets
# etc.
initializer "static assets" do |app|
app.middleware.insert_before(::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public")
@rabbitz
rabbitz / airline.cof
Created May 25, 2014 07:18
vim airline config
*airline.txt* Lean and mean status/tabline that's light as air
*airline*
_ _ _ _ ~
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
\ V /| | | | | | |_____| (_| | | | | | | | | | __/ ~
\_/ |_|_| |_| |_| \__,_|_|_| |_|_|_| |_|\___| ~
~
==============================================================================
CONTENTS *airline-contents*
@rabbitz
rabbitz / ctags.setup
Created May 25, 2014 05:53 — forked from nazgob/ctags.setup
解决mac下 ctags -R 选项出错问题
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@rabbitz
rabbitz / Ruby 里的 %Q, %q, %W, %w, %x, %r, %s, %i (译)
Created April 11, 2014 02:06
Ruby 里的 %Q, %q, %W, %w, %x, %r, %s, %i (译)
%Q
用于替代双引号的字符串. 当你需要在字符串里放入很多引号时候, 可以直接用下面方法而不需要在引号前逐个添加反斜杠 (\")
>> %Q(Joe said: "Frank said: "#{what_frank_said}"")
=> "Joe said: "Frank said: "Hello!"""
(...)也可用其他非数字字母的符号或成对的符号代替, 诸如[...], !...!, +...+,{...}, <...>等.
以下写法全部与上面等效:
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select