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 bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2010-08-16 | |
set -um | |
# check input | |
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; } |
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 | |
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information | |
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method) | |
DEST="$1" | |
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'` | |
#IP Addresses or hostnames are fine here | |
CAS_HOSTNAME=galaxy:9143 |
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
CREATE OR REPLACE FUNCTION fvGetHash512(pv_Arg IN VARCHAR2) | |
RETURN VARCHAR2 | |
IS LANGUAGE java name 'Hash512.getHash512(java.lang.String) return java.lang.String'; | |
/ | |
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Hash512" AS | |
import java.lang.*; | |
import java.security.MessageDigest; | |
public class Hash512 { | |
public static String getHash512(String arg) { |
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 | |
true=0 | |
false=1 | |
## | |
# check if the caller is the same as the owner of the current script | |
# otherwise the following problem is possible: | |
# root calls you script and creates a file with root ownership | |
# then you need root to do anythink with the 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
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<append>true</append> | |
<encoder> | |
<pattern>%date %message %n%rEx{full}</pattern> | |
</encoder> | |
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | |
<!--log files are created in logs with name different for each day--> | |
<fileNamePattern>${application.home}/logs/app-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | |
<!--log files are created in separate folder for each day--> | |
<!--<fileNamePattern>${application.home}/logs/%d{yyyy/MM/dd}/tumrestapi-%d{yyyy-MM-dd}.%i.log</fileNamePattern>--> |
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.security.SecureRandom; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; | |
import java.math.BigInteger; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
/* | |
* PBKDF2 salted password hashing. | |
* Author: havoc AT defuse.ca |
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 | |
# PRE-COMMIT HOOK | |
# | |
# The pre-commit hook is invoked before a Subversion txn is | |
# committed. Subversion runs this hook by invoking a program | |
# (script, executable, binary, etc.) named 'pre-commit' (for which | |
# this file is a template), with the following ordered arguments: | |
# | |
# [1] REPOS-PATH (the path to this repository) |
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
organization := "com.gk" | |
name := "sandbox" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
libraryDependencies ++= Seq( | |
"junit" % "junit" % "4.9" % "test" withSources(), |
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 sendEmail(emailTo: String, emailFrom: String, subject: String, body: String) = { | |
import com.typesafe.plugin._ | |
val mail = use[MailerPlugin].email | |
mail.setRecipient(emailTo) | |
mail.setFrom(emailFrom) | |
mail.setSubject(subject) | |
mail.send(body) | |
} |
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 scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
import scala.util._ | |
val timeout = 1.seconds | |
//> timeout : scala.concurrent.duration.FiniteDuration = 1 second |
OlderNewer