Shell history command count
bash:
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
zsh:
history -1000 | awk '{print $2}' | sort | uniq -c | sort -rn | head
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Mark James Adams http://raysend.com/mark/
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
history -1000 | awk '{print $2}' | sort | uniq -c | sort -rn | head
$ ruby upload.rb cert.yml source destination
username: USERNAME password: PASSWORD
# upload.rb # Command line webdav upload script. Based off of # http://theexciter.com/articles/bingo require 'net_digest_auth' require 'yaml' require 'uri' abort("Usage: #{$0} <credentials.yml> <src> <dst> ") unless ARGV.size==3 auth = YAML.load_file(ARGV[0]) username = auth['username'] password = auth['password'] src = ARGV[1] dst = ARGV[2] if File.exists?(src) url = URI.parse(dst) Net::HTTP.start(url.host) do |http| res = http.put(url.request_uri, 'hello') # try putting something so # the server will return a # www-authenticate header req = Net::HTTP::Put.new("#{url.path}#{File.basename(src)}") req.digest_auth(username, password, res) response = http.request(req, File.open(src).read) puts response.code + " " + response.message end else puts "No such file #{src.inspect}" end
curl -u username:password -d status="<What are you doing?>" http://twitter.com/statuses/update.xml
du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf("%6.1f\t%s\t%25s %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'
set convert-meta off set meta-flag on set output-meta on
set dspmbyte=utf8
:set enc=utf-8 :set fenc=utf-8