Skip to content

Instantly share code, notes, and snippets.

View dpalomar's full-sized avatar

David Palomar dpalomar

View GitHub Profile
@dpalomar
dpalomar / TIW-install-linux.sh
Last active September 15, 2015 12:12
TIW maven archetype automatically install on linux
#!/bin/sh
# This script allows to install the maven archetype for TIW subject.
# Use: wget -qO- https://goo.gl/NEIuFi | sh
# or curl -sSL https://goo.gl/NEIuFi | sh
echo "**** THIS WILL INSTALL THE ARCHETYPE, PLEASE BE PATIENT ****"
echo "**** You need git and maven instaled and a live connection ****"
echo "**Removing last version**"
rm -rf ~/.m2/repository/es/
echo "1- Download from git"
echo "2- installing with maven "
@dpalomar
dpalomar / Operaciones-Git
Last active January 29, 2019 09:39 — forked from jelcaf/Operaciones-Git
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@dpalomar
dpalomar / settings.xml
Created November 4, 2015 11:38
Configuracion settings.xml para gh-pages
<settings>
<servers>
<server>
<id>github</id>
<username>changeme</username>
<password>changeme</password>
</server>
</servers>
</settings>
@dpalomar
dpalomar / .gitattributes
Created April 8, 2016 12:43
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@dpalomar
dpalomar / Ansible install
Last active October 15, 2021 09:05
Steps to install Ansible on Debian/Ubuntu
# base requirements
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-setuptools python-dev libffi-dev libssl-dev git sshpass tree
sudo easy_install pip
sudo -H pip install cryptography
# sudo -H pip install ansible==2.1.1.0 if you don't need virtualenv
# virtualenv
@dpalomar
dpalomar / TrueColour.md
Created November 15, 2016 12:22 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@dpalomar
dpalomar / resource_alloc_docker.md
Created December 27, 2016 10:02 — forked from afolarin/resource_alloc_docker.md
Resource Allocation in Docker

#Container Resource Allocation Options in docker-run You have various options for controlling resources (cpu, memory, disk) in docker. These are principally via the docker-run command options.

##Dynamic CPU Allocation -c, --cpu-shares=0
CPU shares (relative weight, specify some numeric value which is used to allocate relative cpu share)

##Reserved CPU Allocation

@dpalomar
dpalomar / howto-manually-add-trust-cert-to-rubygems.md
Created January 19, 2017 20:03
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2016-12-01: Please refer to the official guide instead of this process.

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

@dpalomar
dpalomar / openshift-cheatsheet.md
Created January 28, 2019 10:18 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install pkgs using yum in a Dockerfile

@dpalomar
dpalomar / Kafka commands.md
Created March 21, 2019 17:19 — forked from vkroz/Kafka commands.md
Kafka frequent commands

Kafka frequent commands

Assuming that the following environment variables are set:

  • KAFKA_HOME where Kafka is installed on local machine (e.g. /opt/kafka)
  • ZK_HOSTS identifies running zookeeper ensemble, e.g. ZK_HOSTS=192.168.0.99:2181
  • KAFKA_BROKERS identifies running Kafka brokers, e.g. KAFKA_BROKERS=192.168.0.99:9092

Server

Start Zookepper and Kafka servers