Skip to content

Instantly share code, notes, and snippets.

View jpcweb's full-sized avatar
🏝️

Jérémie Payet jpcweb

🏝️
  • JPC WEB
  • Tahiti
View GitHub Profile
@jpcweb
jpcweb / add-multiple-remotes-to-git-repo.md
Created May 26, 2023 20:23 — forked from miztiik/add-multiple-remotes-to-git-repo.md
Adding multiple remote url to git repo

Add Multiple Remotes URLs to git

Adding the first remote origin

git remote add origin remote_1_url
git remote set-url origin remote_1_url

# Set the default remote branch for the current local branch
git branch --set-upstream master
# or
@jpcweb
jpcweb / vagrant-vmware-tech-preview-apple-m1-pro.md
Created November 25, 2021 07:00 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Installing Rosetta

First install Rosetta if not already done, this is needed to run x86 code:

@jpcweb
jpcweb / Github-style-syntax-in-pages.md
Created December 31, 2020 02:49 — forked from sudara/Github-style-syntax-in-pages.md
Github style syntax highlighting in Pages.app

I like Pages.app, but don't want to deal with constantly copying and pasting code around.

Here is how I do syntax highlighting in Pages.app by pressing a key command. It's based off of this post on stack exchange.

install pygments

sudo easy_install Pygments

install github syntax

@jpcweb
jpcweb / Ansible-Vault how-to.md
Created December 9, 2020 23:45 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@jpcweb
jpcweb / .tmux.conf
Last active September 12, 2020 03:05 — forked from paulodeleo/.tmux.conf
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
set -g mouse on
# Scroll History
set -g history-limit 30000
# Set ability to capture on start and restore on exit window data when running an application
setw -g alternate-screen on
# Lower escape timing from 500ms to 50ms for quicker response to scroll-buffer access.
set -s escape-time 50

Application specific host grouping in Riemann-dash

It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.

This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.

Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.

riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"

@jpcweb
jpcweb / gist:9b5aaadb461c8bdb78ccf8aabfc30902
Last active June 16, 2020 02:04 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@jpcweb
jpcweb / main.yml
Created June 11, 2020 21:25 — forked from fulv/main.yml
Ansible - Creating users and copying ssh keypair files to the remote server
Put this in your `local-configure.yml` file, add as many users as you need:
users:
- name: fulvio
sudoer: yes
auth_key: ssh-rsa blahblahblahsomekey this is actually the public key in cleartext
- name: plone_buildout
group: plone_group
sudoer: no
auth_key: ssh-rsa blahblahblah ansible-generated on default
@jpcweb
jpcweb / SmartGit Trial
Created August 1, 2019 08:59 — forked from thanhtam92/SmartGit Trial
Changing SmartGit Free Trial License to Non-Commercial
Changing SmartGit Free Trial License to Non-Commercial
Some developers might overlook the license selection when using the SmartGit. Instead of choose non-commercial, they by default clicked Next on the “30 days Free Trial”. Worse thing is reinstall the SmartGit won’t get you to change the license.
To alter the license. First, go to
Windows: %APPDATA%\syntevo\SmartGit\<main-smartgit-version>
OS X: ~/Library/Preferences/SmartGit/<main-smartgit-version>
Unix/Linux: ~/.smartgit/<main-smartgit-version>