Skip to content

Instantly share code, notes, and snippets.

View fedetibaldo's full-sized avatar
🌱
Living, I guess

Federico Tibaldo fedetibaldo

🌱
Living, I guess
View GitHub Profile
@uberboom
uberboom / PageLayoutView.php
Last active January 30, 2020 19:17
TYPO3: Render a backend preview of custom content elements (TYPO3 CMS 6.2)
<?php
namespace Your\Extension\Namespace\Hooks;
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
{
/**
* Preprocesses the preview rendering of a content element.
*
@ygotthilf
ygotthilf / jwtRS256.sh
Last active November 7, 2024 10:42
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
@AtulKsol
AtulKsol / psql-error-fix.md
Last active November 13, 2024 12:43
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

@0m3r
0m3r / build.js
Created December 26, 2018 15:29
Magento 2 Advanced js bundling config
{
// Usage:
// mv pub/static/frontend/Magento/luma/en_US pub/static/frontend/Magento/luma/en_US_orig
// r.js -o build.js baseUrl=pub/static/frontend/Magento/luma/en_US_origin dir=pub/static/frontend/Magento/luma/en_US
// Enable js minification with Uglify. Uncomment this out during development tomake builds faster
//optimize: 'none',
inlineText: true,
// Files that are required for all pages will be included in require.js file
deps: [
'jquery/jquery.cookie',
// AUTOGENERATED CONFIGURATION (Thu May 02 2019 15:09:04 GMT-0400 (Eastern Daylight Time))
// Full config reference:
// https://github.com/requirejs/r.js/blob/b8a6982/build/example.build.js
({
// Set "optimize" to "none" to speed up bundling while debugging
"optimize": "uglify2",
"generateSourceMaps": true,
"wrapShim": true,
"inlineText": true,