Skip to content

Instantly share code, notes, and snippets.

View chalasr's full-sized avatar

Robin Chalas chalasr

View GitHub Profile
@jakzal
jakzal / 1 Readme.md
Last active December 13, 2023 21:18
Nextcloud behind Cloudflare on a Raspberry PI
@Ocramius
Ocramius / healthy-git-flow.sh
Created October 7, 2022 08:31
A healthy git-flow (if you can call git-flow healthy at all), in which `master` is correctly merged back to `develop`
git checkout -b master
git log -1
# commit 65345471c1040ceb90b1817d7427d58d7b09fdca (HEAD -> master)
git checkout -b develop
git log -1
# both branches are at the same ref:
# commit 65345471c1040ceb90b1817d7427d58d7b09fdca (HEAD -> develop, master)
echo "a feature" > feature.txt
@lyrixx
lyrixx / watch.sh
Created July 22, 2022 13:54
Watch dir and copy on change
watch -n 1 cp -u -R ./source ./dest
# Run every seconds: `-n 1`
# Copy everything from "source" to "dest":
# `-R ./source ./dest`
# But only if the content is different `-u`
@GregoireHebert
GregoireHebert / API-Platform-2.6-admin-login.md
Last active February 17, 2021 13:55
How to create a login experience from the admin with API Platform 2.6

Creating a login experience from the Admin with API Platform 2.6

You can use whatever authentication mode you want, but for the sake of the demonstration let's use JWT.

I'll grab a freshly downloaded api-platform distribution.

from the php container :

	composer require jwt-auth
	apk add openssl
@chanks
chanks / script.lua
Last active May 26, 2023 05:07
Lua script to delete/trim all processed messages from a Redis stream - an updated version is maintained here: https://gist.github.com/FSX/fb86595c64751201497e2050aeb722e2
-- The goal of this script is to trim messages that have been processed by
-- all extant groups from the a given Redis stream. It returns the number
-- of messages that were deleted from the stream, if any. I make no
-- guarantees about its performance, particularly if the stream is large
-- and not fully processed (so a simple XTRIM isn't possible).
-- First off, bail out early if the stream doesn't exist.
if redis.call("EXISTS", KEYS[1]) == 0 then
return false
end
@paragonie-scott
paragonie-scott / argon2id-bench.php
Created October 11, 2018 16:29
Updated argon2id-bench.php
<?php
define('BENCH_ROUNDS', 200);
$start = $stop = 0.0;
$short = str_repeat("A", 16);
$long = str_repeat("A", 1 << 20);
$start = microtime(true);
for ($i = 0; $i < BENCH_ROUNDS; ++$i) {
sodium_crypto_pwhash_str($short, SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE);
@ganapativs
ganapativs / iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup.md
Last active July 16, 2024 14:36
iTerm2 + oh-my-zsh + Pure theme + zsh plugins setup
@webdevilopers
webdevilopers / ConsoleExceptionListener.php
Last active December 11, 2017 11:48
Configure Symfony Monolog to send error emails when exceptions are thrown in console commands
<?php
namespace Acme\Foo\Infrastructure\Symfony\AppBundle\Listener;
use Psr\Log\LoggerInterface;
use Symfony\Component\Console\Event\ConsoleEvent;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@paragonie-scott
paragonie-scott / jose-security.md
Last active June 12, 2020 11:32
Suggestions for a Secure JOSE Alternative (or Protocol Upgrade)

Changes to JOSE that will prevent insecurity

Deletions

JWS and JWE

Drop the alg header

Neither JOSE users nor JOSE library designers should be required to understand cryptography primitives. At a lower level, this can lead to badly implemented primitives. On a higher level, this can lead to reasoning by lego.

@taylorotwell
taylorotwell / weather.sh
Last active August 27, 2019 13:40
Weather CLI
alias weather='curl -s wttr.in | sed -n "1,7p"'