Skip to content

Instantly share code, notes, and snippets.

View xiaoyvr's full-sized avatar

Yu Xiaoqiang xiaoyvr

  • ThoughtWorks
  • Dallas
View GitHub Profile
@xiaoyvr
xiaoyvr / docker-cleanup-resources.md
Created November 23, 2017 14:03 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Hyper-V

Fix the IP address

issue: minishift/minishift#1391

create a virtual switch with name miniNAT, then enable internet sharing for miniNAT in wireless adapter settings.

$env:HYPERV_VIRTUAL_SWITCH="miniNAT" # or something else
$env:MINISHIFT_ENABLE_EXPERIMENTAL="y"
const _ = require('lodash')
const Ajv = require('ajv')
const pathToRegexp = require('path-to-regexp')
const {expect} = require('chai')
const SwaggerParser = require('swagger-parser')
const request = require('supertest')
module.exports = {
create: async(specFile) => {
const parser = new SwaggerParser()
using System;
using System.Data;
using Newtonsoft.Json;
using NHibernate;
using NHibernate.SqlTypes;
using NHibernate.UserTypes;
namespace SomeNamespace
{
[Serializable]
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace MyNamespace
($ctx = $executioncontext.gettype().getfield("_context","nonpublic,instance").getvalue( $executioncontext)).gettype().getfield("_authorizationManager","nonpublic,instance").setvalue($ctx, (new-object System.Management.Automation.AuthorizationManager "Microsoft.PowerShell"))
curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
echo "01 ±±" | iconv -f UTF-8-Mac -t latin1 | iconv -f gb2312
# goto the folder
zip -X0 xxx.epub mimetype
zip -rDX9 xxx.epub * -x "*.DS_Store" -x mimetype