Skip to content

Instantly share code, notes, and snippets.

View denisdemaisbr's full-sized avatar

DENIS DOS SANTOS SILVA denisdemaisbr

View GitHub Profile
@denisdemaisbr
denisdemaisbr / test.php
Created November 12, 2024 21:59
gerador lotofacil #1
<?php
ini_set('memory_limit', '8196M');
require 'combine.php';
require 'stats.php';
$range = range(1,22);
$full = array_combination(15, $range);
$qty = count($full);
@denisdemaisbr
denisdemaisbr / test.c
Created November 8, 2024 15:55
a c example of constructor/destructor
/*
https://www.geeksforgeeks.org/functions-that-are-executed-before-and-after-main-in-c/
*/
#include<stdio.h>
/* Apply the constructor attribute to myStartupFun() so that it
is executed before main() */
@denisdemaisbr
denisdemaisbr / ffmpeg_remove_audio.sh
Created October 18, 2024 04:30
ffmpeg: create a copy of original file without sound
#!/bin/sh
ffmpeg -i {{input.mp4}} -c copy -an {{output.mp4}}
exit 0
@denisdemaisbr
denisdemaisbr / lotodicas.php
Created September 26, 2024 19:26
download all files from lotodicas (php, fopen_url, xls, lottery)
<?php
/*
download all xls files from a url
note: requires fopen_url enabled!
*/
function downloadFile($fileUrl, $saveTo)
{
$fileContent = file_get_contents($fileUrl);
@denisdemaisbr
denisdemaisbr / test.c
Created September 21, 2024 15:03
c variable macro
...
#define isEmpty(_str, ...) \
if (!_str || _str[0] == 0x0 || strlen(_str) == 0) { \
if (sizeof((int[]){__VA_ARGS__}) > 1) { \
return __VA_ARGS__; \
} else { \
return; \
} \
}
@denisdemaisbr
denisdemaisbr / test.regex1.c
Created September 19, 2024 19:37
an example of tiny regex library
#include <stdio.h>
#include <string.h>
// clone or clib
// https://github.com/kokke/tiny-regex-c
#include "tiny-regex-c/re.h"
#include "tiny-regex-c/re.c"
int main() {
const char *input = "joao;maria;jose";
@denisdemaisbr
denisdemaisbr / binance_kline.c
Created September 15, 2024 00:38
binance kline kline/tick fetch
/*
fetch data from binance, using kline
using libcurl and cjson
gcc -I. -Icjson -o /cygdrive/x/test test.fetch.c cjson/libcjson.a -lcurl -lrt && /cygdrive/x/test
=================================
it's a poc of a ubot binance bot!
=================================
@denisdemaisbr
denisdemaisbr / install.sh
Created August 24, 2024 06:36
ubuntu 20.x ntpd ntp timesyncd timesync br
#!/bin/bash
# ******************** #
# use it own your risk #
# ******************** #
# checkotu: https://ntp.br/guia/linux/ #
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
@denisdemaisbr
denisdemaisbr / disable-updates.sh
Created July 27, 2024 07:54
disable unbutu/debian automatic-updates
#!/bin/sh
set -e
sudo apt install unattended-upgrades -y
sudo dpkg-reconfigure --priority=low unattended-upgrades # choose yes
exit 0
@denisdemaisbr
denisdemaisbr / install.sh
Created July 20, 2024 05:40
install freqtrade Ubuntu 22.04.4 LTS
#!/bin/sh
# https://www.freqtrade.io/
# https://github.com/freqtrade/
mkdir -p /opt
cd /opt
git clone --branch=stable --depth=1 https://github.com/freqtrade/freqtrade.git
cd freqtrade