Skip to content

Instantly share code, notes, and snippets.

View sosoyososo's full-sized avatar

Karsa.Wang sosoyososo

View GitHub Profile
@sosoyososo
sosoyososo / gist:67ae8c2c57ff2278ae7dd340196fe928
Created July 23, 2019 04:34
show docker container id with ip
if [ $# == 1 ]; then
echo "$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $1)"
else
for a in $(docker ps | awk '{print $1}');
do
if [ $a != 'CONTAINER' ]; then
echo $a "$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $a)"
fi
done;
fi
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted
#!/bin/bash
#备份源列表文件
cp /etc/apt/source.list /etc/apt/source.list.bak
#更新源到阿里云,使用新源
curl -L https://gist.githubusercontent.com/sosoyososo/178a01129851c869ae72afc46e3ba8fe/raw/faffc82f3cf979f4ace79f458443c36fb3d6b53a/apt-source-aliyun.txt > /etc/apt/source.list
apt update
#安装必备工具
deb http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ wily main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ wily-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ wily-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ wily-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ wily-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
@sosoyososo
sosoyososo / gist:253745a248e6b5c59dabd9849ca04ecd
Last active September 25, 2016 08:09
search for iOS Dever
import Foundation
class V2EXSubjectContent {
var subJect : String? = "酷工作"
}
class Job : V2EXSubjectContent {
let jobTitle = "iOS开发工程师"
let validDuration = "直到找到合适的小伙伴"
let companyAddress = "杭州余杭区良睦路梦想小镇1288号"
/*
运行环境:
Xcode 7.3.1 Swift 2.2
*/
import Foundation
import Cocoa
import ImageIO
@sosoyososo
sosoyososo / swift
Created June 14, 2016 03:04
swift implement of url encoding
import Foundation
extension String {
func urlEncodedString() -> String? {
let urlCharacterSet = NSMutableCharacterSet()
urlCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLFragmentAllowedCharacterSet())
urlCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLHostAllowedCharacterSet())
urlCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLPasswordAllowedCharacterSet())
urlCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLPathAllowedCharacterSet())
urlCharacterSet.formUnionWithCharacterSet(NSCharacterSet.URLQueryAllowedCharacterSet())
@sosoyososo
sosoyososo / gist:96cb4e0ab2482f3ca08b30715ba91933
Created June 3, 2016 10:22
中国区域结构平铺表.json
{
"110000": [
"北京",
"1"
],
"110100": [
"北京市",
"110000"
],
"110101": [
@sosoyososo
sosoyososo / gist:9b9e0fce65097550b5b9822a33d4026c
Created June 3, 2016 10:21
中国区域结构树形表(从平铺表转来的).json
[
{
"parent": "1",
"value": "宁夏回族自治区",
"key": "640000",
"children": [
{
"parent": "640000",
"value": "石嘴山市",
"key": "640200",