Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Jota juliojsb

🎯
Focusing
View GitHub Profile
@juliojsb
juliojsb / mysql-collectd-grafana.json
Created Jan 24, 2019
MySQL/MariaDB dashboard for Grafana (Collectd)
View mysql-collectd-grafana.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@juliojsb
juliojsb / security-dashboard-grafana.json
Created Nov 28, 2018
A simple security dashboard for Grafana
View security-dashboard-grafana.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@juliojsb
juliojsb / jvm-flags-debug
Created Jun 8, 2016
JVM Flags for debugging
View jvm-flags-debug
# Activate Automatic Heap Dump on OutOfMemory
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/location/`date +%Y%m%d`.hprof
# Activate basic GC logging
-XX:+PrintGC
# Activate detailed GC logging
-XX:+PrintGCDetails
# Add Timestamps (can be used with basic or detailed GC logging)
@juliojsb
juliojsb / avconv-usage-tips
Last active Apr 10, 2016
Some examples and tips to convert formats and record audio/video using avconv tool
View avconv-usage-tips
# ---Format conversions
# Extract audio from video file
avconv -i video.mp4 -vn -f mp3 audio.mp3
# Extract just video without audio
avconv -i video.mp4 -vcodec libx264 -an -f mp4 just_video.mp4
# Convert MP3 to WAV
avconv -i audio.mp3 audio.wav
@juliojsb
juliojsb / create-gnome-shell-desktop-launcher
Created Apr 9, 2016
How to create a desktop launcher in Gnome Shell
View create-gnome-shell-desktop-launcher
1) In /usr/share/icons create folder SublimeText and move the corresponding icon there (can be a .png)
2) In /usr/share/applications/sublimetext.desktop create a file called sublimetext.desktop and put in it:
[Desktop Entry]
Name=Sublime Text
Comment=A Sublime way of editing text
Exec=/opt/sublimetext/sublime_text_3/sublime_text
Icon=/usr/share/icons/SublimeText/sublimetext-icon.png
Encoding=UTF-8
@juliojsb
juliojsb / optimize-firefox-iceweasel
Last active Apr 9, 2016
Some tips to optimize Firefox/Iceweasel web navigators
View optimize-firefox-iceweasel
These tips worked for me, but use always with caution!
In about:config modify the following.
# Pipelining and network optimizations
network.http.pipelining.maxrequests 8
network.http.pipelining true
browser.display.show_image_placeholders false
network.http.max-persistent-connections-per-server 8
browser.cache.use_new_backend 1
@juliojsb
juliojsb / Jboss configuration file
Created Mar 23, 2016
Enable remote debugging in Jboss
View Jboss configuration file
For Jboss 4,5,6 AS and 6.x EAP standalone mode, append to your JAVA_OPTS the following option:
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
For Jboss 7.x AS/EAP 6.x in domain mode, in host.xml add the corresponding jvm option in the server group you need to debug:
<server name="server-one" group="main-server-group">
<!-- Remote JPDA debugging for a specific server
<jvm name="default">
<jvm-options>
@juliojsb
juliojsb / sysctl.conf
Created Mar 23, 2016
Disable IPv6 in Debian and derivative distros (like Ubuntu)
View sysctl.conf
Put in /etc/sysctl.conf the following:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
After that, reload config with:
sysctl -p
@juliojsb
juliojsb / iptables-multicast.sh
Last active Jan 18, 2022
Allow multicast communications in iptables
View iptables-multicast.sh
Run the following:
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
iptables -A FORWARD -m pkttype --pkt-type multicast -j ACCEPT
iptables -A OUTPUT -m pkttype --pkt-type multicast -j ACCEPT
Or:
iptables -A INPUT -s 224.0.0.0/4 -j ACCEPT
iptables -A FORWARD -s 224.0.0.0/4 -d 224.0.0.0/4 -j ACCEPT
@juliojsb
juliojsb / httpd.conf
Created Mar 19, 2016
Hardening Apache security with TLS and secure ciphers order
View httpd.conf
Put this at Apache main configuration level (httpd.conf or apache2.conf) or even at VirtualHost level.
To enable only TLS (in all its versions):
SSLProtocol all -SSLv2 -SSLv3
SSLCompression off
SSLHonorCipherOrder on
SSLCipherSuite "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA"
If you want to enable only TLS v1.2: