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
find . -name '*.txt' -exec perl -i.org -pe 's/\r\n/\n/' {} \; |
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
# Copyright 2008-2009 WebDriver committers | |
# Copyright 2008-2009 Google 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 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
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
find . -maxdepth 1 -mtime +15 -print -type d| xargs rm -rf |
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 | |
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) | |
if [ -z "$GIT_DIR" ]; then | |
echo >&2 "fatal: hooks/functions: GIT_DIR not set" | |
exit 1 | |
fi | |
read oldrev newrev refname |
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
find . -name 'Legends*.zip' -exec unzip -P 'www.zasv.com-JVC' {} \; |
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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import re | |
import urllib2 | |
URL = "http://www.douban.com/people/jollychang/miniblogs?start=%d&type=saying" |
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
svn = 'http://svn/trunk' | |
username = 'test' | |
password = 'test' | |
try: | |
from local_config import * | |
except ImportError: | |
pass |
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
In [199]: xml | |
Out[199]: '<?xml version="1.0" encoding="UTF-8"?><project>\n <actions/>\n <description>9999</description>\n <keepDependencies>false</keepDependencies>\n <properties/>\n <scm class="hudson.scm.NullSCM"/>\n <canRoam>true</canRoam>\n <disabled>false</disabled>\n <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>\n <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>\n <triggers class="vector"/>\n <concurrentBuild>false</concurrentBuild>\n <builders/>\n <publishers/>\n <buildWrappers/>\n</project>' | |
In [200]: print xml | |
<?xml version="1.0" encoding="UTF-8"?><project> | |
<actions/> | |
<description>9999</description> | |
<keepDependencies>false</keepDependencies> | |
<properties/> | |
<scm class="hudson.scm.NullSCM"/> |
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 -*- | |
from bs4 import BeautifulSoup | |
def replace_svn(config, new_scm_url): | |
soup = BeautifulSoup(config, 'xml') | |
soup.remote.string.replaceWith(new_scm_url) | |
xml = str(soup) | |
return xml |
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
find -mindepth 1 -maxdepth 1 -type d | while read d | |
do | |
cp -rf local_gunicorn_config.py $d | |
done |