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
package atoms.fat.media | |
import grails.converters.JSON | |
import org.joda.time.DateTime | |
class Media implements Serializable { | |
String url | |
String name | |
DateTime dateCreated |
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 cardinalToRoman( int num){ | |
def TreeMap map = [1:"I", 5: "V", 10 : "X", 100 :"C"] | |
def getLatestKey = {int nu -> | |
def val = null | |
for (Map.Entry entry : map.descendingMap().entrySet()) { | |
def residuo = nu % entry.key; |
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 command = """cat /var/lib/jenkins/.ssh/id_rsa.pub"""// Create the String | |
def proc = command.execute() // Call *execute* on the string | |
proc.waitFor() // Wait for the command to finish | |
// Obtain status and output | |
println "return code: ${ proc.exitValue()}" | |
println "stderr: ${proc.err.text}" | |
println "stdout: ${proc.in.text}" // *out* from the external program is *in* for groovy |
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 | |
fecha=$(date +%Y%m%d_%H%M) | |
echo "ready to dump database" | |
mysqldump -u root database --ignore-table=logs > /tmp/dump-$fecha.sql | |
echo "comprimiendo" | |
pbzip2 /tmp/dump-$fecha.sql |
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 | |
NUMBER_DESkTOP="$(xdotool get_num_desktops)" | |
CURRENT="0" | |
echo "Press [CTRL+C] to stop.." | |
while : | |
do | |
xdotool set_desktop $CURRENT | |
#echo $CURRENT | |
CURRENT="$(expr $CURRENT + '1')" | |
if [ "$CURRENT" -gt $NUMBER_DESkTOP ]; then |
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
dir=/tmp/level1/level2/level3/level4/level5/level6; while [ "$dir" != "/" ]; do ls -ald $dir; dir=`dirname $dir`; done |
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
<?xml version='1.0' encoding='utf-8'?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You 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 |
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
############################ | |
# Load Balancer | |
############################ | |
<VirtualHost *:80> | |
ServerName atomsfat.net | |
<Location "/manage-balancer"> | |
SetHandler balancer-manager | |
AuthType Basic | |
AuthName "System challenge" |
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
#ignore changes: | |
git reset --hard | |
#delete remote branch | |
git push origin :newfeature | |
#delete local branch | |
git branch -d the_local_branch |
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
#switch config: | |
grails -Dgrails.env=development switch-config clickonmx | |
#make war: | |
grails -Dgrails.env=development war target/cooldeals-lat-0.3.2.war | |
#running test: | |
grails test-app class-name -integration | |
#no interactive console | |
grails run-app --non-interactive |