This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Convert CardDav contacts to GrandStream DP720 / DP750 XML phonebook | |
import vobject | |
vcf_path = "./contacts.vcf" | |
xml_path = './xml_contacts.xml' | |
# phone number: CardDav to Grandstream | |
map_number_types = { | |
"work": "Work", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to use "acme.sh" to set up Lets Encrypt without root permissions | |
# See https://github.com/Neilpang/acme.sh for more | |
# This assumes that your website has a webroot at "/var/www/<domain>" | |
# I'll use the domain "EXAMPLE.com" as an example | |
# When this is done, there will be an "acme" user that handles issuing, | |
# updating, and installing certificates. This account will have the following | |
# (fairly minimal) permissions: | |
# - Host files at http://EXAMPLE.com/.well-known/acme-challenge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private short computeHmacSha256(byte[] key, short key_offset, short key_length, | |
byte[] message, short message_offset, short message_length, | |
byte[] mac, short mac_offset){ | |
short BLOCKSIZE=64; | |
short HASHSIZE=32; | |
// compute inner hash | |
for (short i=0; i<key_length; i++){ | |
hmacBuffer[i]= (byte) (key[(short)(key_offset+i)] ^ (0x36)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.tsenger.sandbox; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import javax.smartcardio.Card; | |
import javax.smartcardio.CardException; | |
import javax.smartcardio.CardTerminal; | |
import javax.smartcardio.TerminalFactory; |