Skip to content

Instantly share code, notes, and snippets.

View mmalmeida's full-sized avatar

Miguel Almeida mmalmeida

  • ITClinical
  • Lisbon
View GitHub Profile
@mmalmeida
mmalmeida / gist:5934939
Last active December 19, 2015 09:39
fail2ban - tomcat
jail:
[tomcat-manager]
enabled = true
port = 8080,8443
bantime = 3601
filter = tomcat-manager
maxretry = 4
logpath = /var/log/tomcat7/localhost_access_log.*.txt
@mmalmeida
mmalmeida / gist:6597566
Last active December 23, 2015 06:59
iptables
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -s 1.2.3.4/32 -p tcp -m tcp --dport 8000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8000 -j DROP
# Generated by iptables-save v1.4.4 on Tue Sep 17 18:24:47 2013
*filter
:INPUT ACCEPT [1087:102455]
@mmalmeida
mmalmeida / table_scrollable.html
Last active December 23, 2015 12:39
Updated table scrollable example. Both examples have an "issues" section to summarize findings
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>Metronic | Data Tables - Editable Tables</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="" name="description" />
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id="xxx" class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="setAttribute">
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
<Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$</Arg>
</Call>
<!-- Add an EnvEntry only valid for this webapp -->
logme(){
while read -r line; do
logline="$(getdate): $line"
echo $logline >> "$current_log"
done
}
@mmalmeida
mmalmeida / gist:7597733
Created November 22, 2013 10:15
Archiva stacktrace error
2013-11-22 10:14:09,589 [qtp2136389305-27] ERROR org.apache.archiva.redback.rest.services.DefaultUserService [] - Unable to find RBAC Object 'Repository Manage
r - public' of type org.apache.archiva.redback.rbac.jdo.JdoRole using fetch-group 'null'
org.apache.archiva.redback.rbac.RbacManagerException: Unable to find RBAC Object 'Repository Manager - public' of type org.apache.archiva.redback.rbac.jdo.JdoR
ole using fetch-group 'null'
at org.apache.archiva.web.security.ArchivaRbacManager.getRole(ArchivaRbacManager.java:220) ~[archiva-web-common-1.4-M4.jar:1.4-M4]
at org.apache.archiva.redback.rbac.AbstractRBACManager.getChildRoles(AbstractRBACManager.java:723) ~[redback-rbac-model-2.1.jar:2.1]
at org.apache.archiva.redback.rbac.AbstractRBACManager.gatherUniquePermissions(AbstractRBACManager.java:475) ~[redback-rbac-model-2.1.jar:2.1]
at org.apache.archiva.redback.rbac.AbstractRBACManager.gatherUniquePermissions(AbstractRBACManager.java:480) ~[redback-rbac-model-2.1.jar:2.1]
<managedRepository>
<location>/srv/maven/public</location>
<releases>true</releases>
<blockRedeployments>false</blockRedeployments>
<snapshots>true</snapshots>
<scanned>true</scanned>
<deleteReleasedSnapshots>false</deleteReleasedSnapshots>
<skipPackedIndexCreation>false</skipPackedIndexCreation>
<stageRepoNeeded>false</stageRepoNeeded>
<id>itc-public</id>
2013-11-22 10:30:08,254 [pool-6-thread-1] ERROR org.apache.archiva.repository.scanner.functors.ConsumerProcessFileClosure [] - Consumer [create-archiva-metadat
a] had an error when processing file [/srv/maven/snapshots/nexus-maven-repository-index.zip]: Not a valid artifact path in a Maven 2 repository, not enough dir
ectories: nexus-maven-repository-index.zip
java.lang.IllegalArgumentException: Not a valid artifact path in a Maven 2 repository, not enough directories: nexus-maven-repository-index.zip
at org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator.getArtifactForPath(Maven2RepositoryPathTranslator.java:168) ~[m
aven2-repository-1.4-M4.jar:?]
at org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.readArtifactMetadataFromPath(Maven2RepositoryStorage.java:613) ~[maven
2-repository-1.4-M4.jar:?]
at org.apache.archiva.consumers.metadata.ArchivaMetadataCreationConsumer.processFile(ArchivaMetadataCreationConsumer.java:156) ~[ar
@mmalmeida
mmalmeida / gist:7602357
Created November 22, 2013 16:09
Segfault with email with receipt request
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff8affd700 (LWP 19329)]
0x00007fffe0dc5a72 in efhd_format_attachment (emf=0xfdb030, stream=0x214f070, part=0x10a1150, mime_type=0x7fff8c01d0b0 "application/msword", handle=0x0,
cancellable=0x233c520) at em-format-html-display.c:461
461 em-format-html-display.c: No such file or directory.
Thread 90 (Thread 0x7fff8affd700 (LWP 19329)):
#0 0x00007fffe0dc5a72 in efhd_format_attachment (emf=0xfdb030, stream=0x214f070, part=0x10a1150, mime_type=0x7fff8c01d0b0 "application/msword", handle=0x0,
cancellable=0x233c520) at em-format-html-display.c:461
#1 0x00007fffe093390a in em_format_part_as (emf=0xfdb030, stream=0x214f070, part=0x10a1150, mime_type=0x7fff8c01d0b0 "application/msword",