Skip to content

Instantly share code, notes, and snippets.

View RELATO's full-sized avatar
🎯
Focusing

Haroldo S. Lontra Jr. RELATO

🎯
Focusing
View GitHub Profile
@RELATO
RELATO / pom.xml
Last active August 29, 2015 14:18
pom.xml de referência para projetos spring 4.x com tomcat
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<groupId>basic-web-app</groupId>
<artifactId>basic-web-app</artifactId>
<version>1.0-SNAPSHOT</version>
# install tinydns (djbdns) & daemontools on ubuntu 14.04
apt-get -y install daemontools
apt-get -y install daemontools-run
apt-get -y install ucspi-tcp
apt-get -y install djbdns
mkdir -p /etc/service
# NOTE: installing daemontools-run takes care of this, else
Ubuntu-server 14.04 LTS config
Anonymous access configuration (basic)
https://www.howtoforge.com/samba-server-ubuntu-14.04-lts
File: /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
# criar o arquivo javatomcat.sh com as linhas abaixo na pasta
#
# /etc/profile.d
#
# Testado em Ubuntu 12.04 e 14.04 LTS
alias tstartup="/opt/tomcat/bin/startup.sh"
alias tshutdown="/opt/tomcat/bin/shutdown.sh"
alias tl="tail -f /opt/tomcat/logs/catalina.out"
alias torestart="/opt/tomcat/bin/shutdown.sh;killall -9 java;killall -9 java;rm -rf /opt/tomcat/work/Catalina/;/opt/tomcat/bin/startup.sh;tl"
# adicionar as linhas abaixo apos os comentarios iniciais do arquivo
#
# /opt/tomcat/bin/catalina.sh
#
# Utilizando o jrockit, temos que excluir os parametros PermSize e MaxPermSize
#PARAMETROS OPCIONAIS RELATO
CATALINA_OPTS="-server -Dfile.encoding=ISO-8859-1 $CATALINA_OPTS"
export CATALINA_OPTS
#JAVA_OPTS="-server -Djava.awt.headless=true -Duser.language=pt -Duser.region=BR -Xms512m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m"
Top section is for regular Ubuntu installs. Bottom section is for EC2 installs.
Ubuntu Login as Root (regular Ubuntu VM or PC – not using AWS EC2)
Login with main user
Now gain root access to bash, by emulating it with sudo
# sudo -i
{"cards":[{"lastEditDate":"2020-03-06T02:06:53.269Z","id":"8rik7fjg2fp","archived":false,"title":"Untitled Card","text":"\n## New card\n### Shortcuts\n- ESC to **Discard Changes**\n- Ctrl+Enter to **Save Changes**\n- Double click on card to **Edit**\n- A to **Add**\n","board":"INBOX","color":"#a7c0cd","isEditing":true,"editingColor":"#a7c0cd","editingTitle":"README","editingText":"# \n\n> MDyna is a markdown notes application that syncs with Github gists, and much more\n---\n\n## 🏠 Homepage\n\nVisit our Landing Page [here](https://mdyna.dev)\n\n## Main Features\n\n* Git Flavoured Markdown \\(GFM\\) support\n* macOs \\+ Windows \\+ Linux\n* Code syntax highlighting for several languages\n* Dark Mode\n* Tag notes with labels\n* Organize cards through boards\n* Cloud syncing through custom directory\n* Github gist sync\n* Export boards as markdown files\n* Import .md files from directory\n\n\n## Author\n\n👤 **David Morais**\nhhj\n* Twitter: [@Psybork](https://twitter.com/Psybork)\n* Github: [@mdyna](https://gith
# https://wiki.zimbra.com/wiki/ZCS_to_ZCS_rsync_Migration
rsync --delete -axvzKHS [source-location] [newserver-IP-address]:[destination-location]
@RELATO
RELATO / AtualizaSeq.java
Created October 23, 2015 11:32
Java program to update _seq hibernate sequence table style
package br.com.relato.util;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Iterator;
@RELATO
RELATO / index.jsp
Created October 25, 2015 12:05
index.jsp to redirect to another site
<%@ page import="java.io.*,java.util.*" %>
<html>
<head>
<title>Page Redirection</title>
</head>
<body>
<center>
<h1>Page Redirection</h1>
</center>
<%