Skip to content

Instantly share code, notes, and snippets.

View Metrakit's full-sized avatar
🤘
Coding

Jordane Metrakit

🤘
Coding
View GitHub Profile
@nesk
nesk / README.md
Last active October 26, 2022 09:29
Delete the latest workflow runs of a repo (up to 100)

A fish oneliner to delete the latest workflow runs of a repo.

Install the GitHub CLI and replace <owner>/<repository> with your repository.

You can also change ?per_page=100 with the number of runs you want to delete.

@NAR8789
NAR8789 / dnsmasq.conf
Last active September 12, 2023 10:07
wildcard dns for docker-compose using dnsmasq
# explicitly define host-ip mappings
address=/myapp.local/172.16.1.2
# dnsmasq entries are always wildcard entries, so this maps both myapp.local and *.myapp.local
# (yes, it's fine for this to be your entire dnsmasq config. the defaults are pretty sensible)
@jastisriradheshyam
jastisriradheshyam / rsa_oaep_decrypt.js
Created August 17, 2019 19:06
RSA OAEP, encryption with Golang and decryption with NodeJS (node-rsa)
const nodeRSA = require('node-rsa');
/**
* return the decrypted Data (RSA OAEP Encryption)
* @param {string} RSAPrivateKey
* @param {string} EncrypteDataBuffer
* @returns {string} Data decrypted data
*/
var RSA_OAEP_Decrypt = function(RSAPrivateKey, EncrypteDataBuffer){
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@Metrakit
Metrakit / node-pm2.sh
Created December 7, 2018 16:28
Scripts for setup php-fpm (ready for symfony), apache2, Cerbot, Composer, Cachetool, Node, NPM, pm2
#!/bin/sh
echo "This script is going to setup Node, NPM, pm2"
echo "WARNING: The sudouser password will be prompted sometimes !"
echo "==> Setup Node/NPM"
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
node -v
#
# based on: http://knowledgevoid.com/blog/2012/01/13/logging-the-correct-ip-address-using-apache-2-2-x-and-amazons-elastic-load-balancer/
# mod_evasive based on
# https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache
# update cloudflare download link
# make sure you're root
sudo -i
@merikan
merikan / Jenkinsfile
Last active April 27, 2024 03:58
Some Jenkinsfile examples
Some Jenkinsfile examples
@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@botic
botic / gulpfile.js
Created March 29, 2017 14:56
VueJS 2.x Gulpfile
"use strict";
const del = require("del");
const gulp = require("gulp");
const gulpsync = require("gulp-sync")(gulp);
const gulpif = require("gulp-if");
const rename = require('gulp-rename');
const sourcemaps = require("gulp-sourcemaps");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
@martincarlin87
martincarlin87 / deploy.php
Last active October 2, 2021 20:39
Deployer Laravel 5 Example
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Configuration
set('ssh_type', 'native');
set('repository', '[REPO URL]');
set('branch', 'master');
set('keep_releases', 5);