This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function search-branches() { | |
for sha1 in `git log --oneline --all --grep "$1" | cut -d" " -f1` | |
do | |
git branch -r --contains $sha1 | |
done | |
} | |
function search-tags() { | |
for sha1 in `git log --oneline --all --grep "$1" | cut -d" " -f1` | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Last update on Nov 05, 2014. | |
# | |
# Searches disassembled code for specific instructions. | |
# | |
# Opcodes obtained from: https://github.com/Shirk/vim-gas/blob/master/syntax/gas.vim | |
# | |
# List of opcodes has been obtained using the following commands and making a few modifications: | |
# echo '#!/bin/bash' > Opcode_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
placeholder |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thu Feb 9 10:35:08 CST 2017 | |
******************************************************************** | |
execve("/opt/vyatta/sbin/my_commit", ["/opt/vyatta/sbin/my_commit"], [/* 55 vars */]) = 0 | |
brk(0) = 0x2490000 | |
fcntl(0, F_GETFD) = 0 | |
fcntl(1, F_GETFD) = 0 | |
fcntl(2, F_GETFD) = 0 | |
access("/etc/suid-debug", F_OK) = -1 ENOENT (No such file or directory) | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f51b788e000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Assume compute node has singe IP | |
# Plese confirm your /etc/hosts | |
LOCALIP=192.168.1.12 | |
HOSTNAME=compute1 | |
# Test installatiom model works | |
function test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_admin_roles(): | |
"""Return a list of roles which are granted admin rights according | |
to policy settings. | |
""" | |
# NOTE(salvatore-orlando): This function provides a solution for | |
# populating implicit contexts with the appropriate roles so that | |
# they correctly pass policy checks, and will become superseded | |
# once all explicit policy checks are removed from db logic and | |
# plugin modules. For backward compatibility it returns the literal | |
# admin if ADMIN_CTX_POLICY is not defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
attr = {'name':'', 'gender':'', 'age':''} | |
def add_attr(clas): | |
clas.attr = attr | |
return clas | |
@add_attr | |
class Person(object): | |
"""docstring for Person""" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import time | |
import sys | |
def print_detail(func): | |
def _print_detail(*args): | |
print func.__name__ | |
print func.__doc__ | |
print sys.getrefcount(func) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import time | |
import sys | |
def print_detail(func): | |
print func.__name__ | |
print func.__doc__ | |
print sys.getrefcount(func) | |
start = time.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import time | |
import sys | |
def print_detail(func): | |
print func.__name__ | |
print func.__doc__ | |
print sys.getrefcount(func) | |
start = time.time() |