Contents
- 尽量简单明了。
| #!/bin/bash | |
| services=$(networksetup -listnetworkserviceorder | grep 'Hardware Port') | |
| while read line; do | |
| sname=$(echo $line | awk -F "(, )|(: )|[)]" '{print $2}') | |
| sdev=$(echo $line | awk -F "(, )|(: )|[)]" '{print $4}') | |
| #echo "Current service: $sname, $sdev, $currentservice" | |
| if [ -n "$sdev" ]; then | |
| ifout="$(ifconfig $sdev 2>/dev/null)" |
| # coding: utf-8 | |
| from django.contrib import admin | |
| from django.contrib.auth.models import Group, User | |
| from django.contrib.auth.admin import GroupAdmin, UserAdmin | |
| from django.utils.translation import ugettext_lazy as _ | |
| class CustomUserAdmin(UserAdmin): | |
| fieldsets = ( |
| # 实现ssh自动登录完成任务的expect脚本 | |
| # [root@localhost shell]# cat login.exp | |
| #!/usr/bin/expect -f | |
| set ipaddress [lindex $argv 0] | |
| set passwd [lindex $argv 1] | |
| set timeout 30 | |
| spawn ssh root@$ipaddress | |
| expect { | |
| "yes/no" { send "yes\r";exp_continue } |
| #--Key-Bindings----------------------------------------------------------------- | |
| # change the prefix from 'C-b' to 'C-a' | |
| # (remap capslock to CTRL for easy access) | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # start with window 1 (instead of 0) | |
| set -g base-index 1 |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # Copyright 2009-2015 MongoDB, Inc. | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # -*- coding: utf-8 -*- | |
| """ | |
| hash_ring | |
| ~~~~~~~~~~~~~~ | |
| Implements consistent hashing that can be used when | |
| the number of server nodes can increase or decrease (like in memcached). | |
| Consistent hashing is a scheme that provides a hash table functionality | |
| in a way that the adding or removing of one slot | |
| does not significantly change the mapping of keys to slots. |
| Name | Version | Enabled | ID |
|---|---|---|---|
| Attach from Clipboard | 1.1.0 | true | clipboard@ganss.org |
| CustomizeMyBird | 2.7.9.1 | true | CustomizeMyBird@Aris_CTRdev |
| Disable DragAndDrop (Thunderbird) | 3.2.0 | true | disable_dnd_tb@pqrs.org |
| Dorando keyconfig | 2018.1 | true | keyconfig@mozilla.dorando.at |
| Header Tools Lite | 0.6.2 | true | headerToolsLite@kaosmos.nnp |
| Manually sort folders | 1.2.1 | true | tbsortfolders@xulforum.org |
| " Minimal vimrc for server | |
| " Author: reorx | |
| " Usage: | |
| " curl -sL https://gist.github.com/reorx/94e18825bc4002268f66/raw -o ~/.vimrc | |
| " or | |
| " curl -sL https://gist.github.com/reorx/94e18825bc4002268f66/raw | sudo tee --append /etc/vimrc | |
| set nocompatible " choose no compatibility with legacy vi | |
| syntax enable | |
| set encoding=utf-8 |
| { | |
| "description": "command + space commitment", | |
| "manipulators": [ | |
| { | |
| "type": "basic", | |
| "from": { | |
| "key_code": "space", | |
| "modifiers": { | |
| "mandatory": [ | |
| "left_command" |