Skip to content

Instantly share code, notes, and snippets.

@grizmio
grizmio / SonarQube howto
Last active January 19, 2023 15:33
SonarQube 8.9.6
First, the server
docker run -d --name sonarqube -p 8000:8000 -p 9000:9000 sonarqube:8.9.6-community
Then login with admin:admin
http://127.0.0.1:9000
Create the project and its token
An example for running the scanner with docker
sudo cat /var/log/audit/audit.log | audit2why
@grizmio
grizmio / unnecesary
Created October 23, 2022 19:32
Typescript traducciones en un enum, y no más strings weando
Lo uso con expo/reactnative, pero sirve para cualquier proyecto con typescript
Para agregar las traducciones, agregar al:
enum Words {
Después los archivos de traducciones ingles y español llorarán
// I18nService.ts
import * as Localization from 'expo-localization';
import { I18n } from 'i18n-js';
import { ITranslationLanguage } from '../interfaces/ITranslationLanguage';
@grizmio
grizmio / scoop commands.ps1
Created August 18, 2022 03:53
scoop commands
scoop cleanup '*'
scoop cache rm '*'
scoop update '*'
@grizmio
grizmio / jwt show command line
Created August 11, 2022 04:03
jwt show command line
Thanks: https://prefetch.net/blog/2020/07/14/decoding-json-web-tokens-jwts-from-the-linux-command-line/
jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' <<< $(cat "${JWT}")
@grizmio
grizmio / gist:e36b969af8c83971bd9961b066ec10cd
Created August 4, 2022 13:03
gunicorn and cpu, resources
https://rachelbythebay.com/w/2020/03/07/costly/
https://blog.clubhouse.com/reining-in-the-thundering-herd-with-django-and-gunicorn/
@grizmio
grizmio / strace the shit
Created August 4, 2022 00:59
strace gunicorn or anything
sudo strace -s 4096 -f $( ps ax |grep gunicorn|grep -v grep|cut -d'?' -f1|while read p; do echo "-p $p" ; done|tr '\n' ' ' )
@grizmio
grizmio / client.js
Created July 22, 2022 23:02 — forked from PierBover/client.js
Node.js UDP Broadcast example
const dgram = require('dgram');
const message = new Buffer('Server?');
const socket = dgram.createSocket('udp4');
socket.on('listening', function () {
socket.setBroadcast(true);
setInterval(() => {
socket.send(message, 0, message.length, 5555, '255.255.255.255');
}, 5000);
});
@grizmio
grizmio / awk all except n-th column
Created July 14, 2022 19:24
awk all except n-th column
$ history |grep docker|awk -F' ' '{ for (i=2;i<NF;i++) printf " " $i; print " "$NF }'|grep -v history
@grizmio
grizmio / oh-my-zsh zsh slow
Created July 13, 2022 16:11
oh-my-zsh zsh git status slow
$ git config --global --add oh-my-zsh.hide-dirty 1