Skip to content

Instantly share code, notes, and snippets.

View gvisoc's full-sized avatar
👾

Gabriel Viso Carrera gvisoc

👾
View GitHub Profile
@gvisoc
gvisoc / README.md
Last active January 11, 2023 22:05
Effective `ddclient.conf` (uncommented lines only) to work with Cloudflare DDNS

Configuration values for ddclient to work with Cloudflare

The date of last review of this Gist is 2023-01-12. Some changes may be needed depending on when you read this

This configuration works with an API Token generated on your Cloudflare profile with Edit Zone DNS (Zone.DNS) permission for a particular domain (1 Zone), that has to be the same domain.com referred in the configuration.

You will have to update domain and subdomains, and also the line password=[token] with your token:

password=238AF6723EF...
# User specific environment and startup programs
. /usr/share/git-core/contrib/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='\[\e[1;32m\][\[\e[m\]l:$?, a:$(jobs | wc -l | xargs)\[\e[1;32m\]]\[\e[m\] \w \[\e[1;33m\]$(__git_ps1 "(%s)")\[\e[m\] '
@gvisoc
gvisoc / gvisoc.zsh-theme
Last active February 4, 2022 06:00
gvisoc.zsh-theme
# My "Oh My ZSH" theme.
# Based on juanghurtado.zsh-theme, tested on Gnome Terminal
#
# - Adds *l*ast execution code, number of *a*live processes.
# - Removes right prompt and the user@host.
# - Less marks for git-ahead. Uses ^ instead of !.
# - Instead of '>' uses '#%': the prompt is % for regulars and # for root.
# - Bold colors predominant, for Gnome Terminal's "Show bold text in bright colors"
# Color shortcuts
@gvisoc
gvisoc / .zshrc
Created June 4, 2019 21:17
.zshrc -- same as .bash_profile except for the PS1 escape sequences that differ
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export PS1='%m (%j):%1~ %n 👾 '
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
# upstart config - wipes swap space on shutdown
# place in /etc/init
description "Wipes swap space on shutdown"
start on (runlevel [016] and stopped gdm)
script
swapoff -a
# change /swapfile for your file or device
@gvisoc
gvisoc / .bash_profile
Last active June 4, 2019 21:17
.bash_profile. Same as .zshrc except for the PS1 escape sequences that differ
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export PS1='\h (\j):\W \u 👾 '
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
@gvisoc
gvisoc / JavaTwoWaySSLClient.md
Last active November 7, 2023 05:52
2-Way SSL: HTTPs Client

What is this

This Gist is about using Client Certificates in Java when making HTTPs calls with plain Java code (java(x).net, no other frameworks) in a 2-way SSL context, that is: the Server trusts and uses a Client Public Key to establish the secure connection. The example is a Java runnable class for a Client that uses a Certificate to establish a Two Way SSL communication with a Server.

Disclaimer: this gist reflects my understanding, and is not necessarily 100% accurate. Feedback is appreciated.

Context

For this to work, the Client certificate has to be issued by a CA (Certification Authority) trusted by the Server, the same way that the Client has to trust the CA of the Server. In Java, "trust a CA" means having that CA stored in an encrypted file called "trust store" accessible from our code by the use of a password and the appropriate security SDK provided by the JDK.

How to store that trust stores' passwords securely in our enviroments is another story.

### Keybase proof
I hereby claim:
* I am gvisoc on github.
* I am gvisoc (https://keybase.io/gvisoc) on keybase.
* I have a public key ASCc5Yhg6U7C4Ik8ijSpIP4gozC2FHAuQUdOja1BMMLJtgo
To claim this, I am signing this object:
@gvisoc
gvisoc / account_behaviour.feature
Created February 6, 2017 20:42
An example on how to specify features using #Gherkin grammar. This is actually working part of the repo https://github.com/gvisoc/test-bdd-cucumber
Feature: non-overdraft account balance operations
In order to have a functional account
As a user
I want to be able to make deposits and withdraws
Scenario Outline: making deposits
Given an account with balance <bal>
When I make a deposit of <increment>
Then the account's balance should be <result>