- http://serverfault.com/questions/416787/nginx-403-forbidden-error-hosting-in-user-home-directory
- rails deploy with rvm, capistrano, uniron, nginx
๐
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
| <plugin> | |
| <groupId>org.apache.cxf</groupId> | |
| <artifactId>cxf-codegen-plugin</artifactId> | |
| <version>${cxf.version}</version> | |
| <executions> | |
| <execution> | |
| <id>generate-sources</id> | |
| <phase>generate-sources</phase> | |
| <configuration> | |
| <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot> |
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 java.util.*; | |
| import java.util.function.*; | |
| import java.util.stream.*; | |
| import static java.util.stream.Collectors.*; | |
| import static java.util.Comparator.*; | |
| /** | |
| * http://stackoverflow.com/questions/22845574/how-to-dynamically-do-filtering-in-java-8 | |
| * |
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
| def differ(loan, rate, t, accuracy=2): | |
| list_pay_per_month = [] | |
| body_of_loan = loan | |
| month_count = t * 12 | |
| body_per_month = loan / month_count | |
| sum = 0 | |
| for _ in range(month_count): | |
| interest = body_of_loan * rate / 12 | |
| pay_per_month = interest + body_per_month |
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
| def _convert_java_millis(java_time_millis): | |
| """Provided a java timestamp convert it into python date time object""" | |
| ds = datetime.datetime.fromtimestamp( | |
| int(str(java_time_millis)[:10])) if java_time_millis else None | |
| ds = ds.replace(hour=ds.hour,minute=ds.minute,second=ds.second,microsecond=int(str(java_time_millis)[10:]) * 1000) | |
| return ds | |
| def _convert_datetime_java_millis(st): | |
| """Provided a python datetime object convert it into java millis""" |
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
| upstream fuel { | |
| # Defines a group of servers. Servers can listen on different ports. | |
| server IP:PORT fail_timeout=0; | |
| } | |
| upstream frontend { | |
| server IP:PORT fail_timeout=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
| //Gist note this is snippet from root build.gradle in project with subprojects | |
| checkstyle { | |
| // use one common config file for all subprojects | |
| configFile = project(':').file('config/checkstyle/checkstyle.xml') | |
| configProperties = [ "suppressionFile" : project(':').file('config/checkstyle/suppressions.xml')] | |
| } |
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
| """ | |
| Usage: python script.py search_string replace_string dir | |
| Eg. python batchreplace.py galleries productions /Sites/cjc/application/modules/productions/ | |
| And it will search recursively in dir | |
| and replace search_string in contents | |
| and in filenames. | |
| Case-sensitive | |
| """ | |
| from sys import argv |
Suppose you want to inject a credential into a Pipeline script. The cloudbees note does not include Pipeline script examples. https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs
The Jenkins Pipeline Docs' description of the git pushmethod doesn't have an example using injected credentials.
(https://jenkins.io/doc/pipeline/examples/#push-git-repo)
The Snippet generator is helpful, but not not if you try to follow the instructions at: https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin
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
| # This demo is a transliteration of the below referenced demo to use the async/await syntax | |
| # | |
| #https://www.reddit.com/r/Python/comments/33ecpl/neat_discovery_how_to_combine_asyncio_and_tkinter/ | |
| # | |
| # For testing purposes you may use the following command to create a test daemon: | |
| # tail -f /var/log/messages | nc -l 5900 | |
| # Enter localhost:5900 in the entry box to connect to it. | |
| from tkinter import * |
OlderNewer