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
public void awaitCompletion(final Task task) | |
{ | |
Predicate<Task> jobComplete = TaskPredicates.done(); // evals the task.getState() | |
System.out.println("Hola!" + task.getState() + " " + task.getTaskId()); | |
RetryablePredicate<Task> r = | |
new RetryablePredicate<Task>(jobComplete, 3600000l); | |
r.apply(task); | |
} |
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
/** | |
* Abiquo community edition | |
* cloud management application for hybrid clouds | |
* Copyright (C) 2008-2010 - Abiquo Holdings S.L. | |
* | |
* This application is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU LESSER GENERAL PUBLIC | |
* LICENSE as published by the Free Software Foundation under | |
* version 3 of the License | |
* |
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
Remember: does not take into account void methods (no @Produces) both out and in are the same return value. | |
(@GET(\n\s+@.*)*)\n(\s+public\s)(\w*Dto) | |
\1 @Produces(\4.MEDIA_TYPE) \3 \4 | |
(@POST(\n\s+@.*)*)\n(\s+public\s)(\w*Dto) | |
\1 @Consumes(\4.MEDIA_TYPE) @Produces(\4.MEDIA_TYPE) \3 \4 | |
(@PUT(\n\s+@.*)*)\n(\s+public\s)(\w*Dto) | |
\1 @Consumes(\4.MEDIA_TYPE) @Produces(\4.MEDIA_TYPE) \3 \4 |
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
-- Mysql processlist | |
watch -n 0.1 'mysql -uroot -proot kinton -e "select * from information_schema.PROCESSLIST"' | |
-- Mysql contention | |
watch -n 0.1 "mysql -uroot -proot kinton -e \"select * from information_schema.PROCESSLIST where state = 'User lock'\"" | |
-- gdb Mysql (full credits to http://poormansprofiler.org) | |
#!/bin/bash | |
nsamples=1 | |
sleeptime=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
package com.abiquo.scheduler; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.persistence.Basic; | |
import javax.persistence.CascadeType; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; |
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
function m { | |
for PARAM in "$@" | |
do | |
PARAMS="${PARAMS} ${PARAM}" | |
done | |
mysql -u[user] -p[password] -e "${PARAMS}" kinton |
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
new host | |
set name = "b" | |
set hardware-address = f0:4d:a2:fd:2d:74 | |
set ip-address = 20:02:ca:fe:00:00:00:00:00:00:00:00:00:00:00:07,20:02:ca:fe:00:00:00:00:00:00:00:00:00:00:00:08 | |
set hardware-type = 1 | |
set statements = "option dhcp6.vendor-opts 6f:70:74:69:6f:6e;" | |
create |