Skip to content

Instantly share code, notes, and snippets.

View jaehoo's full-sized avatar
💭
X it's a variable, it represents unlimited potential

Alberto Sanchez jaehoo

💭
X it's a variable, it represents unlimited potential
View GitHub Profile
@jaehoo
jaehoo / jboss7.sh
Created March 13, 2015 02:42
Jboss EAP 6 & Jboss AS 7 shell script to star/stop server as a service
#! /bin/sh
### BEGIN INIT INFO
# Provides: JBOSS
# Required-Start:
# Required-Stop:
# Default-Start: 5
# Default-Stop:
# Description: Start Jboss Aplication Server 6.2
### END INIT INFO
@jaehoo
jaehoo / jdk-installer.sh
Created March 12, 2015 22:46
Java JDK installer v2.0 for Suse
#!/bin/bash
##
# Install Oracle/Sun Java JDK/JRE 6 on openSUSE
##
#JDK_HOME
echo -n "Enter JDK_HOME:"
read path
@jaehoo
jaehoo / jdk-installer-suse.sh
Created March 12, 2015 18:36
Script to install Java JDK 6 in openSuse
##
# Install Oracle/Sun Java JDK/JRE 6 on openSUSE
##
# Update this with JDK_HOME
JDK_HOME=/usr/java/jdk1.6.0_29
# Normally not changed. Used to detect architecture, and set helper variables
MACHINE_TYPE=`uname -m`
if [ ${MACHINE_TYPE} == 'x86_64' ]; then
@jaehoo
jaehoo / Tomcat7.bash
Last active August 29, 2015 14:14
Unix, Startup script for tomcat 7
#!/bin/bash
### BEGIN INIT INFO
# Provides: tomcat7
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO
@jaehoo
jaehoo / TomcatUser.sh
Last active June 2, 2018 10:47
Bash commands to create user for tomcat service in Unix
#Create group and user
groupadd tomcat
useradd -r -m -d ${USR_TOMCAT_HOME_DIR} -s /bin/false tomcat -g tomcat
# In debian distro you can use this alternative
useradd -r -m -d ${USR_TOMCAT_HOME_DIR} -s /sbin/nologin tomcat -g tomcat
#set user password
passwd tomcat
@jaehoo
jaehoo / Oracle Disable table restrictions.sql
Created December 23, 2014 00:35
Oracle, querys to disable restrictions to truncate all tables and after that enable restrictions, you need to copy querys into script ans run it!
-- Get query list to disable restrictions
SELECT 'ALTER TABLE'||' '||owner||'.'||table_name||' DISABLE CONSTRAINT '||constraint_name||' ;' FROM dba_constraints WHERE constraint_type = 'R' and owner='user name' and status = 'ENABLED';
-- Get querys to truncate all tables
SELECT 'TRUNCATE TABLE '||OWNER||'.'||TABLE_NAME||' ;' FROM DBA_TABLES WHERE OWNER='user name';
-- Get query list to enable restrictions
SELECT 'ALTER TABLE'||' '||owner||'.'||table_name||' ENABLE CONSTRAINT '||constraint_name||' ;' FROM dba_constraints WHERE constraint_type = 'R' and owner='user name' and status = 'ENABLED';
@jaehoo
jaehoo / Oracle - Add permisions for all user tables.sql
Created December 17, 2014 18:02
Orcale, commands to add permisions on all tables from selected tablespace, if you want run this on script must uncomment dbms.out
-- Set unlimited tablespace
GRANT UNLIMITED TABLESPACE TO my_tablespace;
-- To access the tablespace
GRANT CREATE SESSION TO my_user WITH ADMIN OPTION;
-- Set premisons for all tables from selected tablespace
declare
l_SQL varchar2(4000);
begin
@jaehoo
jaehoo / Oracle list object.sql
Created December 9, 2014 15:52
Querys to select objects in Oracle
-- you nedd to have one or more privileges to see objects
SELECT ANY DICTIONARY
(SELECT | INSERT | UPDATE | DELETE) ANY TABLE;
-- And you can select any with those commands
-- see DBA objects
SELECT DISTINCT OWNER, OBJECT_NAME
FROM DBA_OBJECTS
@jaehoo
jaehoo / pom.xml
Created August 18, 2014 19:57
Maven libs, slf4j and logback over log4j
<properties>
<slf4j.version>1.7.5</slf4j.version>
<logback.version>1.1.2</logback.version>
</properties>
<repositories>
<!-- ================================= -->
<!-- Logging -->
<!-- ================================= -->
@jaehoo
jaehoo / logback.xml
Last active June 2, 2018 10:54
Logback 1.1.2 Config File
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--
Rolling file pattern
yyyy-MM-ww : Per week
yyyy-MM-dd : Per Day
yyyy-MM-dd_HH : Per Hour
yyyy-MM-dd_HH-mm : Per minunte