Skip to content

Instantly share code, notes, and snippets.

Isaac isalgueiro

Block or report user

Report or block isalgueiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
isalgueiro /
Created May 15, 2018
This script update all Java related alternatives to point a manually installed JDK.
# Run update-alternatives for a manual installed JDK
java_bins=(appletviewer extcheck idlj jarsigner java javac javadoc javafxpackager javah javap javapackager java-rmi.cgi javaws jcmd jconsole jcontrol jdb jdeps jhat jinfo jjs jmap jps jrunscript jsadebugd jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid schemagen servertool tnameserv wsgen wsimport xjc jar jmc jmc.ini jstack rmiregistry serialver unpack200)
for java_bin in ${java_bins[@]}; do
echo "Setting $java_bin..."
update-alternatives --install /usr/bin/$java_bin $java_bin $JAVA_HOME/bin/$java_bin 1
isalgueiro / updateAWSecurityGroup.bash
Last active Aug 27, 2019 — forked from antonmry/updateAWSecurityGroup.bash
Simple bash script to update a Security Group matched by description and port in AWS with your Public IP
View updateAWSecurityGroup.bash
#! /bin/bash
publicIP=`dig +short`
ruleDescription="This is the string we're using to find our rule"
## Consult previous one
awsOutput=`aws ec2 describe-security-groups --group-ids $securityGroupIds`
ipRangeIndex=`echo $awsOutput | gron | grep $ruleDescription | sed "s/.\+IpRanges\[\([0-9]\+\)\].\+/\1/"`
isalgueiro /
Last active Apr 8, 2018 — forked from nihathrael/
How to upgrade kubuntu 16.04 -> KDE neon

This worked for me and might not work for you. It's a seriuos change to your system, you need to be familiar with apt and with fixing missing or invalid dependencies.

Try it at your own risk!

Uninstall any KDE or Plasma related package

apt purge kubuntu-desktop plasma-desktop kde-baseapps kde-runtime kubuntu-driver-manager
apt autoremove
isalgueiro / golang and angular development
Created Feb 7, 2018
setup a development environment with hot reloading code changes
View golang and angular development

This is useful for environments where the angular app is served directly from golang. For example, using and having angular build in frontend/dist directory

	router := httprouter.New()
// All your router config here [...]
	router.NotFound = http.FileServer(http.Dir("./frontend/dist"))
	router.RedirectFixedPath = false
	router.RedirectTrailingSlash = false
  http.ListenAndServe(":8080", router)
isalgueiro / logstash_geoip.conf
Last active Nov 30, 2017
Adding geoip info in logstash is not an straightforward configuration. You need to adapt `location` field to visualize it properly in Kibana (i.e. use it in a map view).
View logstash_geoip.conf
if [remote_host] =~ /.+/ {
geoip {
source => "remote_host"
if "_geoip_lookup_failure" not in [tags] {
mutate {
remove_field => ["[geoip][location]"] # para que non mande un array
mutate {
convert => {"[geoip][latitude]" => "float"}
isalgueiro / parallel_http.R
Created Nov 29, 2017
HOW-TO get parallel HTTP connections in R
View parallel_http.R
f <- function(x) {
#h <- httr::handle('')
#httr::GET('', handle = h)
isalgueiro / jira-get_worklog.php
Created Nov 7, 2017
How to get list of worklogs through JIRA REST API
View jira-get_worklog.php
$server = '';
$fromDate = '2017-11-07';
$toDate = '2012-11-08';
$project = 'X';
$assignee = 'bob';
$username = 'username';
$password = 'password';
isalgueiro /
Created Nov 6, 2017
Convert all ISO-8859 files to UTF-8
# Convert all ISO-8859 files in $1 directory to UTF-8
error_check() {
if [ $res -ne 0 ]; then
echo ""
echo "error $res"
exit $res
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
isalgueiro /
Last active Mar 16, 2018
Run metricbeat with old kernels where original init.d script fails with `kernel too old` message

In old kernels (~2.6.20) beats fail to start with a message like this:

FATAL: kernel too old
/bin/bash: line 1:  5496 Segmentation fault      /usr/share/metricbeat/bin/metricbeat-god -r / -n -p /var/run/ -- /usr/share/metricbeat/bin/metricbeat -c /etc/metricbeat/metricbeat.yml -path.home /usr/share/metricbeat -path.config /etc/metricbeat /var/lib/metricbeat -path.logs /var/log/metricbeat

You can replace original /etc/init.d/metricbeat file with this script to run metricbeat in old Red Hat systems. After replacing the file run checkconfig --add metricbeat so metricbeat starts automatically with every system start.

You can’t perform that action at this time.