Skip to content

Instantly share code, notes, and snippets.

View patte's full-sized avatar

Patrick Recher patte

View GitHub Profile
@patte
patte / fixCombiningDiaeresis.js
Created October 8, 2018 14:05
fix UTF8 combining diaeresis
//https://www.fileformat.info/info/unicode/char/0308/index.htm
//https://vi.stackexchange.com/questions/3557/can-i-search-for-a-unicode-combining-character-in-vim
const fs = require('fs')
const path = __dirname+'/article.md'
const buffer = fs.readFileSync(path)
const fixed = buffer.toString('utf8')
.replace(/a\u0308/g, 'ä')

republik

  • greeting (+pubsub)
  • searches (expire 3d)
  • pubsub comment
  • pubsub webNotification

publikator

  • mailchimpCampaignId (expire 8w)
  • commits (expire 8w)
@patte
patte / Operation verbrennt.md
Last active June 22, 2018 17:54
delete (pre*)publications from redis
  1. connect to redis
heroku redis:cli redis-NAME -a republik-api
  1. delete keys
EVAL "return redis.call('del', unpack(redis.call('keys', ARGV[1])))" 0 *publication
@patte
patte / Operation Grillzange.md
Last active June 22, 2018 17:01
Steps to switch the production elasticsearch server.

Operation Grillzange

Steps to switch the production elasticsearch server.

  1. Preparations

    • write down current ELASTIC_URL of republik-api
    • test on staging first
    • export / import kibana (management -> saved objects -> export everything)

as root

USERNAME=patte
SSH_PUB_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDZ77RKQPFvL/oF0sTiNptv72z7WecByD8LBw1fXQhcXOhT1pCTplADOVuYWmuN2NVh4xO8Qk75Py8dg/XInHAX5M6qxPEwbWJvoBGhl4CgT5G1z+vdyDxLQkdW822jGK4GjhmerSWmvubTBS+zBLJ2falLjdtjsj2PlMkL4T6J6bQ6GfjuDL9rIm4ZXb6+GlgiqwuFEF0AKX4Hg6J78LiaHkb9w9cUG1j10cfv8eEmCpfm+qcDtKUCV6t2+jt69DBrFItQ+AEIqhP+d4ZgGfYslko0Kk7fOp+UVnj6GjUzJDrn3v0W+KxaDfEeEYj/Car694SRwvdsx3KxRXQomjGMkCHTgDoq0IwPClGfhTay75WKscRKm0yUWIWzsF6Rfmje81ptQveeM9azKjCnu9P177Ag6yWlDuzx3lKJnrgffbmmPSyFAL/ss0Kddh4N8AoeniRP9KyIEXmZLGMQ7Z4NEMTaCt9IG5RSy1aI14QPtiNUGq7hq9DAMjkh73LCAkJGoTIHtrH50bQnXQbpWeDEA2it0m/IWdLAQ8YacKKe16Y4vygpV9gPa9TPzdu6qW50nNhShYIFvjM3Lda5WfSg17YR4khY5xI/Q23CoZjnFAxDi5tibGQl5PL3BG5BbDXudfh3XaS+zV8XmW0vhF4VXPnmBLnMRVswZ5xfwPMnfQ== [email protected]"

useradd -s /bin/bash -G sudo -m $USERNAME
sudo -u $USERNAME mkdir /home/$USERNAME/.ssh
chmod 700 /home/$USERNAME/.ssh
echo $SSH_PUB_KEY > /home/$USERNAME/.ssh/authorized_keys

switch ctrl and caps

sudo vi /usr/share/X11/xkb/symbols/pc

make links from OSX work

sudo ln -s /home /Users

basic packages

sudo apt-get install git htop vim transmission tmux pass zsh mc sudo apt-get install kismet wireshark virtualbox gimp

Keybase proof

I hereby claim:

  • I am patte on github.
  • I am patte (https://keybase.io/patte) on keybase.
  • I have a public key ASAoHmQ623Seu8NC-NOmTZCkhBHiFsNruXyVBpr0hSrBLQo

To claim this, I am signing this object:

#!/bin/bash
# Generate a kubernetes secret for nginx
# github: patte
usage="generate a kubernetes secret for nginx
$(basename "$0") [-h] -n NAME [-c CRTPATH -k KEYPATH ] [-s] [-p HTPASSWDPATH]
where:
-h show this help text
-n NAME name of the secret and the generated file
namespace :figaro do
desc "SCP transfer figaro configuration to the shared folder"
task :setup do
on roles(:app) do
upload! "config/application.yml", "#{shared_path}/application.yml", via: :scp
end
end
desc "Symlink application.yml to the release path"
task :symlink do