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 / 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
@jms
jms / install-tmux
Created January 10, 2017 05:17 — forked from relaxdiego/install-tmux
Install tmux 2.2 on CentOS 7.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make
sudo make install
@jms
jms / web-servers.md
Created December 22, 2016 20:25 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jms
jms / protocol-fix.txt
Created December 2, 2016 23:41 — forked from eculver/protocol-fix.txt
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@jms
jms / mysql.database.yml
Created September 3, 2016 17:53 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development: