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.io.*; | |
import org.jdom2.*; | |
import org.jdom2.filter.Filters; | |
import org.jdom2.input.*; | |
import org.jdom2.output.XMLOutputter; | |
import org.jdom2.xpath.XPathExpression; | |
import org.jdom2.xpath.XPathFactory; | |
import java.io.File; | |
import java.util.List; | |
import java.util.*; |
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.io.*; | |
import org.jdom2.*; | |
import org.jdom2.filter.Filters; | |
import org.jdom2.input.*; | |
import org.jdom2.output.XMLOutputter; | |
import org.jdom2.xpath.XPathExpression; | |
import org.jdom2.xpath.XPathFactory; | |
import javax.print.attribute.standard.DateTimeAtCompleted; |
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 | |
cd /home/$1/backups/ | |
mkdir mysql | |
suffix=$(date +%y%m%d) | |
MYSQL="$(which mysql)" | |
databases="$($MYSQL -u $1 -p$2 -Bse ‘show databases’)" | |
for database in $databases | |
do | |
echo "Processing database $database" | |
mysqldump –opt -u$1 -p$2 ${database} > mysql/${database}.$suffix.sql |
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 | |
# usage | |
# sudo -u postgres bin/pg_ctl $1 -D $DATADIR | |
PG_DIR=$(dirname $(locate pg_ctl | head -n 1)) | |
DATADIR=/Library/PostgreSQL/9.2/data | |
STATUS=$(sudo -u postgres $PG_DIR/pg_ctl status -D $DATADIR) | |
if [ $# -lt 1 ]; then | |
echo "Usage : $0 [start|stop|status]" |
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 is a shell archive. Remove anything before this line, then | |
# unpack it by saving it in a file and typing "sh file". (Files | |
# unpacked will be owned by you and have default permissions.) | |
# | |
# This archive contains: | |
# Makefile ping.1 ping.c ping.shar newping.1 newping.c | |
echo x - Makefile | |
cat > "Makefile" << '//E*O*F Makefile//' | |
# Revised to compile under SunOS 4.1.x (no longer necessary to install |
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 | |
echo "" | |
echo "$(tput setaf 3) ########### This bash script is created by UpUbuntu.com ###########$(tput sgr0)" | |
sleep 2 | |
echo "" | |
echo "" | |
echo "$(tput setaf 3) ########### Kernel 3.7 will be installed in an `uname -i` system ###########$(tput sgr0)" |
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 | |
if [ $# -lt 1 ]; then | |
echo "usage: $0 [eth]" 1>&2 | |
exit 1 | |
fi | |
ETH=$1 | |
IPADDR=$(ip -f inet addr show dev eth0|awk '$1~/inet/{print $2}'|cut -d/ -f1) | |
HOSTNAME="$(echo $IPADDR | tr '.' '-').lunix.co" |
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 class OracleJdbcTest | |
{ | |
String driverClass = "oracle.jdbc.driver.OracleDriver"; | |
Connection con; | |
public void init(FileInputStream fs) throws ClassNotFoundException, SQLException, FileNotFoundException, IOException | |
{ | |
Properties props = new Properties(); | |
props.load(fs); |
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
// original https://gist.github.com/sit/3606537 | |
apply plugin: "java" | |
apply plugin: "eclipse" | |
apply plugin: "idea" | |
group = "com.mycompany.hadoopproject" | |
version = "1.0" | |
repositories { |
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 | |
(( $# < 2 )) && { echo "usage: $0 majorversion minorversion"; exit 1; } | |
vc_osiso="${HOME}/Downloads/CentOS-${1}.${2}-x86_64-minimal.iso" | |
vc_guestiso='/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso' | |
vc_vboxbase="${HOME}/VirtualBox VMs" | |
vc_basebox="vagrant-centos-${1}-${2}" | |
vc_hddbase="${vc_vboxbase}/${vc_basebox}/${vc_basebox}" | |
vc_hddfile="${vc_hddbase}.vdi" |
OlderNewer