Skip to content

Instantly share code, notes, and snippets.

View juliojsb's full-sized avatar
:octocat:
Focusing

Jota juliojsb

:octocat:
Focusing
View GitHub Profile
@juliojsb
juliojsb / iptables-multicast.sh
Last active February 2, 2024 14:33
Allow multicast communications in iptables
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 / sysctl.conf
Created March 23, 2016 21:24
Disable IPv6 in Debian and derivative distros (like Ubuntu)
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 / security-dashboard-grafana.json
Created November 28, 2018 16:43
A simple security dashboard for Grafana
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@juliojsb
juliojsb / mysql-collectd-grafana.json
Created January 24, 2019 20:40
MySQL/MariaDB dashboard for Grafana (Collectd)
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@juliojsb
juliojsb / Jboss configuration file
Created March 23, 2016 22:19
Enable remote debugging in Jboss
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 / ejemplos_gzip_tar
Last active March 24, 2019 19:13
Ejemplos prácticos GZIP/TAR
#Comprimir un fichero access_log
gzip access_log
#Comprimir varios ficheros: access_log, error_log y ssl_access
gzip access_log error_log ssl_access
#Comprimir al máximo un fichero access_log (gzip admite 9 niveles de compresión)
@juliojsb
juliojsb / jvm-flags-debug
Created June 8, 2016 18:29
JVM Flags for debugging
# 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 April 10, 2016 17:44
Some examples and tips to convert formats and record audio/video using avconv tool
# ---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 April 9, 2016 11:16
How to create a desktop launcher in Gnome Shell
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 April 9, 2016 10:21
Some tips to optimize Firefox/Iceweasel web navigators
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