Skip to content

Instantly share code, notes, and snippets.

View alexfernandez803's full-sized avatar

Alex Fernandez alexfernandez803

  • 04:47 (UTC +11:00)
View GitHub Profile
@alexfernandez803
alexfernandez803 / README.md
Created July 20, 2025 10:20 — forked from aidos-dev/README.md
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@alexfernandez803
alexfernandez803 / gist:7ed88390c4dffb1ba6237bc98acba25d
Created November 8, 2018 04:17 — forked from fduran/gist:4586880
Create Java KeyStore from SSL certificate
# www.fduran.com
# Create Java KeyStore from SSL certificate for domain example.com
# Change format from cert.crt PEM (----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----) to DER
openssl x509 -in cert.crt -inform PEM -out cert.der -outform DER
# create KeyStore cert.jks for your domain ("alias" in keytool, "common name" or CN in openssl req)
keytool -import -trustcacerts -alias example.com -file cert.der -keystore cert.jks
@alexfernandez803
alexfernandez803 / nginx.conf
Created April 5, 2017 22:51 — forked from utahta/nginx.conf
nginx + php-fpm + reverse proxy
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@alexfernandez803
alexfernandez803 / binary.java
Created January 27, 2017 05:37 — forked from abdulateef/binary.java
Given a base- 10 integer, n , convert it to binary (base-2). Then find and print the base- 10 integer denoting the maximum number of consecutive 1's in n's binary representation.
import java.util.Scanner;
public class Binary
{
public static String convertToBinary(int decnumber)
{
String binaryString = " ";
if (decnumber > 0)
{
binaryString = Integer.toBinaryString(decnumber);
@alexfernandez803
alexfernandez803 / choice-exception-strategy.xml
Created September 27, 2016 05:34 — forked from cgorshing/choice-exception-strategy.xml
Small Mule example showing a choice-exception-strategy (copied from the Mule docs)
<flow name="RouteByExceptionType">
<jms:inbound-endpoint queue="in">
<jms:transaction action="ALWAYS_BEGIN" />
</jms:inbound-endpoint>
<test:component/>
<jms:outbound-endpoint queue="out">
<jms:transaction action="ALWAYS_JOIN" />
</jms:outbound-endpoint>
<choice-exception-strategy>
<catch-exception-strategy when="exception.causedBy(com.company.BusinessException)">

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
@alexfernandez803
alexfernandez803 / gist:3162af2781f04c8ebdf84c4d660f7c17
Created May 10, 2016 12:47 — forked from dsummersl/gist:3744192
Example log4j logstash configuration
# one way w/o web interface:
# java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf
# another with a web interface(http://localhost:9292) :
# java -jar lib/playbooks/servers/files/logstash-1.1.1-monolithic.jar agent -f lib/playbooks/servers/files/logstash.conf -- web --backend 'elasticsearch:///?local'
# nc localhost 3333 < logfile
#
# When you are all done, you can delete the 'data' folder to delete the database.
input {
tcp {
@alexfernandez803
alexfernandez803 / github_oauth.js
Created February 20, 2016 09:47 — forked from arb/github_oauth.js
Example hapi server using GitHub OAuth
var Hapi = require('hapi');
var Bell = require('bell');
var AuthCookie = require('hapi-auth-cookie');
var server = new Hapi.Server();
server.connection({ port: 9001 });
server.register([Bell, AuthCookie], function (err) {
if (err) {
@alexfernandez803
alexfernandez803 / mule-m2e-3.4-notes.txt
Created December 15, 2015 09:20 — forked from rhoegg/mule-m2e-3.4-notes.txt
Mule Studio 3.4 with m2e
notes on getting m2e to work in studio 3.4:
1. Needed to use settings.xml mirrors to avoid dev.ee.mulesource.com. This is coming from muleesb-3.4-M3.pom.
<mirrors>
<mirror>
<id>mule-ee-proxy</id>
<name>Hack to not use dev.ee.mulesource.com</name>
<url>https://repository.mulesoft.org/releases/</url>
<mirrorOf>mule-ee-releases,mule-ee-snapshots,libs-releases,ext-releases</mirrorOf>
@alexfernandez803
alexfernandez803 / persistence.xml
Created November 8, 2015 10:21 — forked from bjorn-ali-goransson/persistence.xml
Example of a minimal persistence.xml for use in the Play! framework
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>DefaultDS</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<!-- <property name="hibernate.hbm2ddl.auto" value="create"/> -->