Skip to content

Instantly share code, notes, and snippets.

View caio-vinicius's full-sized avatar
🚤
42

Caio Souza | csouza-f caio-vinicius

🚤
42
View GitHub Profile
{
"workbench.activityBar.visible": true,
"window.menuBarVisibility": "default",
"files.exclude": {
".*": true
},
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.renderWhitespace": "all",
"workbench.startupEditor": "newUntitledFile",
@caio-vinicius
caio-vinicius / default
Created December 21, 2020 19:07
Nginx config
log_format info '$remote_addr - [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent $gzip_ratio';
server {
listen 80;
server_name $host;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
git checkout --orphan media
git rm -rf .
cp image .
git add .
git commit -m "something"
git push origin media
@caio-vinicius
caio-vinicius / python.yaml
Created January 3, 2021 14:11
CI Python projects
name: CI Pytest and Flake8
on:
pull_request:
branches:
- main
paths:
- '**.py'
jobs:
@caio-vinicius
caio-vinicius / vim-nginx-conf-highlight.sh
Created January 7, 2021 13:05 — forked from ralavay/vim-nginx-conf-highlight.sh
Enable syntax highlight for Nginx conf file in Vim
#!/bin/bash
#
# Highligh Nginx config file in Vim
# Download syntax highlight
mkdir -p ~/.vim/syntax/
wget http://www.vim.org/scripts/download_script.php?src_id=19394 -O ~/.vim/syntax/nginx.vim
# Set location of Nginx config file
cat > ~/.vim/filetype.vim <<EOF
setInterval(function() {
fetch(URL).then(function (result) {
if (result.status == 200) {
window.location.href = URL;
}
})
}, 1000);
@caio-vinicius
caio-vinicius / backup.sh
Created January 27, 2021 20:55
backup with mongodump script discord webhooks
url="https://discord.com/api/webhooks/#/#"
if mongodump mongodb+srv://-:-@-.mongodb.net/ --db=-; then
curl -H "Content-Type: application/json" -X POST -d '{"content":"Database backup was successful!"}' $url
else
curl -H "Content-Type: application/json" -X POST -d '{"content":"@everyone Database backup failed."}' $url
fi
# crontab -e
# 0 */2 * * * path/backup.sh
@caio-vinicius
caio-vinicius / docker_install.sh
Last active April 9, 2021 12:51
Install Docker
debian
sudo apt-get remove docker docker-engine docker.io containerd runc -y
sudo apt-get update -y
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
mkdir /root/.ssh
touch /root/.ssh/authorized_keys
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ1UZTmft6TzwKHLgbM9Cbbt+Pdc/Z96dVG+smnkSNlQd38CnOpYhnb0j1bG9LCRqGhWUeP+M3p4mAJ639h6xr7fL/ft1iNkC2cUfutd2m5vX5C+MhVcvgbhuT3qUDgNFTH4498gTN5Ihf/OuG2K5aoF/s5FMg+uVuIQRdOExYzlgtMuUV6qxEkWpopUfEI1B3OUqQN9wO846LqSus1PJd+lUddaMPijYJiOZxpPcT9XWlN7QwuB9tYUKiX0g53VGJn/FEKTFr1pj0syugz+C0rwVacHQdaKEXlye/gKDLnSQLJXaPUDNwyqRisSxaK2HacX9WkiuZzsc2AcJVUjM1 caio@caio" >> /root/.ssh/authorized_keys
#include <mlx.h>
typedef struct s_data {
void *img;
char *addr;
int bits_per_pixel;
int line_length;
int endian;
} t_data;