This file contains hidden or 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
| - return false unless user.valid_password?(password) | |
| + if not user.valid_password?(password) | |
| + # Second chance - try LDAP authentication | |
| + return false unless Gitlab.config.ldap.enabled | |
| + ldap_auth(login,password) | |
| + return false unless !user.nil? | |
| + end | |
| + #return false unless user.valid_password?(password) |
This file contains hidden or 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
| import csv,sys | |
| def fn_sort_by(key, header_index): | |
| return lambda x,y:cmp(x[header_index[key]], y[header_index[key]]) | |
| if __name__ == "__main__": | |
| csvfilename = sys.argv[1] | |
| sort_fileds = sys.argv[2] | |
| f = open(csvfilename) | |
| header = f.readline().split(',') |
This file contains hidden or 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 | |
| port=$3 | |
| if [ $port'z' == 'z' ] | |
| then | |
| port=3306 | |
| fi | |
| mysql -h${1} -P${port} -e "select * from information_sechema.processlist where info is not null and time>${2} and user like '%dbreader%' and info like '%select%'\G">.sql.${1}.tmp | |
| pids=`mysql -h${1} -P${port} -e "select id from information_sechema.processlist where info is not null and time>${2} and user like '%dbreader%' and info like '%select%'"|awk -F\| '{print $1"\n"}'` |
This file contains hidden or 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 python | |
| # coding: utf-8 | |
| import gflags | |
| import logging | |
| import os | |
| import sys | |
| from pygaga.helpers.logger import log_init | |
| from pygaga.helpers.utils import make_dirs_for_file |
This file contains hidden or 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 node | |
| // interval -- min interval between callback, in ms | |
| // fn_callback -- callback function | |
| // max_queue_len -- drop callback when exceed max queue length | |
| function ratelimit(interval, fn_callback) { | |
| var last = 0, | |
| max_queue_len = 100, | |
| schedule_later = function(context, args, timeout) { | |
| setTimeout(function() { |
This file contains hidden or 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/sh | |
| SRC_PATH=$0 | |
| DST_PATH=$1 | |
| for d in `ls $SRC_PATH`; do | |
| echo "copying $SRC_PATH/$d -> $DST_PATH/$d" | |
| rsync -aplx --link-dest=$SRC_PATH/$d $SRC_PATH/$d $DST_PATH/$d | |
| echo "removing $SRC_PATH/$d" | |
| rm -rf $SRC_PATH/$d | |
| done |
This file contains hidden or 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
| javascript:window.location.href=window.location.href.match(/google/)?'http://www.baidu.com/s?ie=utf-8&wd='+window.location.href.split('&q=')[1].split('&')[0]:'http://www.google.com/search?ie=UTF-8&q='+window.location.href.split('&wd=')[1].split('&')[0]; |
This file contains hidden or 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
| javascript:%5B%5D.forEach.call(document.querySelectorAll('embed,video'),function(e)%7Be.setAttribute('x-webkit-airplay','allow');e.setAttribute('airplay','allow')%7D); |
This file contains hidden or 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/sh | |
| hadoop fs -du $1 | awk '{print $1/1000.0/1000.0/1000.0, $2, $3}' |
This file contains hidden or 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/sh | |
| networksetup -setdnsservers Wi-Fi Empty # 8.8.8.8 | |
| sudo killall -9 mDNSResponder |