Skip to content

Instantly share code, notes, and snippets.

View jms's full-sized avatar

Jeronimo Martinez Sanchez jms

View GitHub Profile
@jms
jms / Amazon_AWS_Linux_2_on_KVM_qemu.md
Created September 21, 2023 00:17 — forked from alsunseri/Amazon_AWS_Linux_2_on_KVM_qemu.md
Install and run Amazon AWS Linux 2 locally on KVM virt-manager with qemu virtual disk
@jms
jms / ansible-bender-no-python
Created August 5, 2022 02:54
ansible-bender-no-python
# ansible-bender build --python-interpreter /usr/bin/python3 playbooks/build-container.yml
---
- name: Build latest-bash container using ansible-bender
hosts: all
# Alpine doesn't have Python installation by default we collect these
# later after we have one
gather_facts: False
vars:
ansible_bender:
# generate a patch from you feature branch
git checkout feature-branch
git format-patch --stdout [development branch] > feature-branch.patch
# verify the patch
git apply --stat feature-branch.patch
# dry run to detect errors:
git apply --check feature-branch.patch
@jms
jms / gitflow-breakdown.md
Created April 29, 2020 15:39 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@jms
jms / attributes.rb
Created April 21, 2019 15:24 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@jms
jms / decode_flask_cookie.py
Created October 31, 2018 15:46 — forked from babldev/decode_flask_cookie.py
Decode a Flask Session cookie, given the cookie and secret key
@jms
jms / restore.sql
Created June 5, 2018 20:47 — forked from juike/restore.sql
Restoring a 'template1' database in PostgreSQL. (https://wiki.postgresql.org/wiki/Adventures_in_PostgreSQL,_Episode_1)
UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = 'template0';
\c template1
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template0';
@jms
jms / update.sh
Created February 20, 2018 16:17 — forked from odlp/update.sh
Rbenv update Rubygems
#!/usr/bin/env sh
# Multiple vulnerabilities have been disclosed in RubyGems:
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/
#
# If you're an Rbenv user, here's any easy one-liner to upgrade to a
# safe version of Rubygems (2.7.6 or later) for each installed Ruby version:
for i in $( rbenv versions --bare ); do RBENV_VERSION=$i gem update --system && echo "\n$(ruby -v) using rubygems $(gem --version)\n"; done

Keybase proof

I hereby claim:

  • I am jms on github.
  • I am jfms (https://keybase.io/jfms) on keybase.
  • I have a public key ASD4xDpQSPtM4f43bWIFvGckV6ylcPaGtGcCUbcGtu1tzQo

To claim this, I am signing this object:

@jms
jms / profile-svg.sh
Created August 20, 2017 17:41
pytest profile-svg
FLASK_CONFIG=test pytest --profile-svg
for i in $(ls *.prof); do gprof2dot -f pstats $i | dot -Tsvg -o $i.svg ; done