Skip to content

Instantly share code, notes, and snippets.

@paolocarrasco
paolocarrasco / README.md
Last active April 23, 2024 14:50
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@milouse
milouse / soffice.service
Created December 21, 2016 17:52
Headless LibreOffice systemd service file
[Unit]
Description=Control headless soffice instance
After=network.target xvfb.service
Requires=xvfb.service
[Service]
Type=simple
ExecStart=/opt/libreoffice4.4/program/soffice --headless \
--accept=socket,host=127.0.0.1,port=8101;urp; --display :5.0 \
--pidfile=/var/run/soffice.pid --nologo --nodefault --nofirststartwizard
@kingtuna
kingtuna / openresty-ubuntu-install.sh
Last active July 24, 2020 01:07 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@fevangelou
fevangelou / my.cnf
Last active April 23, 2024 03:35
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 17, 2024 04:10
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@salipro4ever
salipro4ever / rc4.js
Last active May 31, 2023 18:48 — forked from farhadi/rc4.js
/*
* RC4 symmetric cipher encryption/decryption
*
* @license Public Domain
* @param string key - secret key for encryption/decryption
* @param string str - string to be encrypted/decrypted
* @return string
*/
function rc4(key, str) {
var s = [], j = 0, x, res = '';
@timcheadle
timcheadle / server.conf
Last active April 19, 2024 09:53
SSL nginx config example
server {
listen 80;
server_name www.example.com example.com;
# Redirect all traffic to SSL
rewrite ^ https://$host$request_uri? permanent;
}
server {
listen 443 ssl default_server;
@juxtin
juxtin / vim74centos
Last active May 2, 2022 03:45
Compile Vim 7.4 on Centos and install my vimrc
#!/bin/bash
yum groupinstall 'Development tools' -y
yum install ncurses ncurses-devel wget git -y
cd /usr/local/src
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
tar -xjf vim-7.4.tar.bz2
cd vim74
./configure --prefix=/usr --with-features=huge --enable-rubyinterp --enable-pythoninterp
make && make install
@cassiocardoso
cassiocardoso / select-estados-br
Created February 12, 2014 23:31
Select com uma lista de todos os estados brasileiros.
<select name="estados-brasil">
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AP">Amapá</option>
<option value="AM">Amazonas</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>
<option value="ES">Espírito Santo</option>
<option value="GO">Goiás</option>
@pbojinov
pbojinov / README.md
Last active December 8, 2023 21:09
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe