Skip to content

Instantly share code, notes, and snippets.

View lucenarenato's full-sized avatar
🐘
Remoto

Renato Lucena lucenarenato

🐘
Remoto
View GitHub Profile
@lucenarenato
lucenarenato / prepare_linux.sh
Created October 27, 2022 21:51 — forked from edsonmsantos/prepare_linux.sh
[Prepare Linux] #linux
echo Preparando......
sudo mkdir /home/downloads
cd /home/downloads
sudo chmod -R 777 /home/downloads
#echo Google Chrome
get https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome-stable_current_amd64.deb
sudo rm ./google-chrome-stable_current_amd64.deb
@lucenarenato
lucenarenato / manual_paginate.php
Created October 14, 2022 21:47 — forked from nellytadi/manual_paginate.php
Manual Paginate In Laravel
<?php
namespace App\Http\Controllers\Api;
use App\Model;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
@lucenarenato
lucenarenato / docker-setup.sh
Created September 26, 2022 18:24 — forked from Gerst20051/docker-setup.sh
Automate Docker Setup Script
#!/usr/bin/env sh
# ASCII: http://patorjk.com/software/taag/#p=display&f=Graffiti&t=Docker%20Setup%20Script
# SOURCE: https://gist.github.com/Gerst20051/bf1341448bd43f430761c1f8150fb1b7
function double_echo {
echo && echo
}
function newline {
@lucenarenato
lucenarenato / age_counting.php
Created September 26, 2022 18:20 — forked from Gerst20051/age_counting.php
PHP Age Counting
<?php
// Your goal is to count how many items exist that have an age equal to or greater than 50, and print this final value.
$ch = curl_init('https://coderbyte.com/api/challenges/json/age-counting');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
$data = curl_exec($ch);
curl_close($ch);
@lucenarenato
lucenarenato / UsingFakerInPT-BR.md
Last active August 17, 2022 20:22 — forked from flyingluscas/UsingFakerInPT-BR.md
Utilizando Faker em pt-BR

Utilizando Faker em pt-BR

Acesse o seu arquivo app/Providers/AppServiceProvider.php, e no método register adicione o seguinte :

/**
 * Register any application services.
 *
 * @return void
 */
@lucenarenato
lucenarenato / signatureverification.php
Created July 28, 2022 01:42 — forked from ritou/signatureverification.php
ID Token Verification using JWK URL and x509 URL
# preparation
## OpenID Connect library(use only http client)
$ pear install openpear/Akita_OpenIDConnect-alpha
## RSA Crypt and X.509 handling library
$ pear channel-discover phpseclib.sourceforge.net
$ pear install phpseclib/Crypt_RSA
$ pear install phpseclib/File_X509
# PHP Source
$ cat signatureverification.php
@lucenarenato
lucenarenato / unique-token.php
Created July 27, 2022 23:12 — forked from barbietunnie/unique-token.php
Creating unique tokens in PHP
<?php
// bin2hex(random_bytes($length))
$token = bin2hex(random_bytes(64));
/*
Examples:
39e9289a5b8328ecc4286da11076748716c41ec7fb94839a689f7dac5cdf5ba8bdc9a9acdc95b95245f80a00d58c9575c203ceb541507cce40dd5a96e9399f4a
1c46538c712e9b5bf0fe43d692147004f617b494d004e29daaf33e4528f253db5d911a690856f0b77cfa98103c8231bffff869f179125d17d28e52bfadb9f205
...
@lucenarenato
lucenarenato / postman-deb.sh
Created June 7, 2022 12:21 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
curlExists=$(command -v curl)
echo "Testing Postman version"
targetName=""
if [ -z $curlExists ]; then
targetName=$(wget -S --spider "https://dl.pstmn.io/download/latest/linux64" 2>&1 | grep "Content-Disposition" | awk -F '=' '{ print $2 }')
else
@lucenarenato
lucenarenato / script.js
Created April 6, 2022 02:17 — forked from ATofighi/script.js
Grafana alert RocketChat webhook script
class Script {
/**
* @params {object} request
*/
process_incoming_request({ request }) {
let color = "#00FF00"; // green
switch(request.content.state) {
case 'ok':
color = '#00FF00';
break;
#!/bin/bash
### Variáveis
PROGRAMAS_APT=(
git
git-flow
google-chrome-stable
deepin-terminal
deepin-screen-recorder
gnome-tweak-tool