Skip to content

Instantly share code, notes, and snippets.

View alexfernandez803's full-sized avatar

Alex Fernandez alexfernandez803

  • 01:42 (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
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd">
<cxf:bus>
<cxf:features>
@alexfernandez803
alexfernandez803 / gist:704ab83aa593f83e8617801b9bec0b6c
Created November 15, 2017 01:26
cashbox-log-request-response
INFO 2017-11-15 09:25:46,189 [[cashbox-test].HTTP_Listener_Configuration.worker.01] org.apache.cxf.services.ProxyService.ProxyServicePort.ProxyServicePortType: Outbound Message
---------------------------
ID: 1
Encoding: UTF-8
Content-Type: text/xml
Headers: {SOAPAction=["http://soap.vindicia.com/v21_0/Account#fetchByEmail"]}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns0:fetchByEmail xmlns:ns0="http://soap.vindicia.com/v21_0/Account">
<auth>
<version>21.0</version>
<login>xxxxx</login>
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDX/HanLm3N4s4m7bf8I1EwZyPElc5UbudOoS6kqIoCWrDgwZjhabzCxHaAyj+UP3G6Bj2wOfhwfDOA/imVBqVbHFq+0rwpfo47Ur8jc07fW7jKPhi0hi4MabMR8P+rqdcgRuxeo1qIgL1mmczgQQPhrEUpJOXVxEjr4Ih+DoFswL7l0GQcLZMkqRjM7vlYqCwQMG3ef2/L51Z2GaeaSotmud9YU3HPnhhaZHphqcyHuVPvdcqNyLJ7WX+6N2sryWZ1iLTnP0N7nAec8NbDTlTO7Q19dlqYPjiIa5eiBt6aveBAbItaHUY7llNf7H/F2H1mNbnUfl5S/Rr/xkcAWbKj alex@alexs-MacBook-Pro.local
<catch-exception-strategy when="#[message.inboundProperties.'http.status' == 403]" doc:name="403">
<message-properties-transformer doc:name="Message Properties">
<add-message-property key="http.status" value="403"/>
<add-message-property key="Content-Type" value="application/json"/>
</message-properties-transformer>
<choice doc:name="Choice">
<when expression="#[message.inboundProperties.'http.status' == 403]">
<dw:transform-message doc:name="Transform Message" metadata:id="fc8f73d9-01b7-46a5-bfca-891462b91778">
<dw:input-payload mimeType="application/json"/>
public string ExtractReply(string text, string address)
{
var regexes = new List<Regex>() { new Regex("From:\\s*" + Regex.Escape(address), RegexOptions.IgnoreCase),
new Regex("<" + Regex.Escape(address) + ">", RegexOptions.IgnoreCase),
new Regex(Regex.Escape(address) + "\\s+wrote:", RegexOptions.IgnoreCase),
new Regex("\\n.*On.*(\\r\\n)?wrote:\\r\\n", RegexOptions.IgnoreCase | RegexOptions.Multiline),
new Regex("-+original\\s+message-+\\s*$", RegexOptions.IgnoreCase),
new Regex("from:\\s*$", RegexOptions.IgnoreCase),
new Regex("^>.*$", RegexOptions.IgnoreCase | RegexOptions.Multiline)
};
@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);
Use jenv is an easy way.
1.Install jenv
curl -s get.jenv.io | bash
2.Config jenv
cd ~/.jenv/candidates/
mkdir java
cd java